package cellsociety.util; public class ValidationResult { public ValidationResult(boolean valid, String message, String simulationType) public boolean isValid() public String getMessage() public String getSimulationType() public static ValidationResult ok(String simulationType) public static ValidationResult fail(String message) } package cellsociety.util; public class SimulationXmlValidator { public static ValidationResult validate(File dataFile) public static boolean isXmlFile(File f) } package cellsociety.controller; public abstract class Simulation { public Simulation(File xmlFile, Stage stage) public void step() protected String[][] getGridColorStates(int[][] gridStates) protected void setupSimulationScene(File xmlFile) protected abstract CellFactory calculateCellFactory(File xmlFile); protected abstract int[][] calculateInitialStates(File xmlFile); protected final int calculateNumCols(File xmlFile) protected final int calculateNumRows(File xmlFile) protected void markCellByState(int[][] states, Element cellGroup, int cellStateValue) public int getNextState(Cell currentCell, List neighbors) public void makeNextMove(Cell currentCell, List neighbors, Map cellMap) protected void showMessage (AlertType type, String message) protected String getTextValue (Element e, String tagName) protected int getIntValue(Element parent, String tagName, int defaultValue) } package cellsociety.controller; public class SpreadingOfFireSimulation extends Simulation { public SpreadingOfFireSimulation(File xmlFile, Stage stage) protected CellFactory calculateCellFactory(File xmlFile) protected int[][] calculateInitialStates(File xmlFile) public int getNextState(Cell currentCell, List neighbors) } package cellsociety.controller; public class WaTorSimulation extends Simulation{ public WaTorSimulation(File xmlFile, Stage stage) protected CellFactory calculateCellFactory(File xmlFile) protected int[][] calculateInitialStates(File xmlFile) public void makeNextMove(Cell currentCell, List neighbors, Map cellMap) public void removePredator(Map cellMap, WaTorCell current) } package cellsociety.controller; public class GameOfLifeSimulation extends Simulation{ public GameOfLifeSimulation(File xmlFile, Stage stage) protected CellFactory calculateCellFactory(File xmlFile) protected int[][] calculateInitialStates(File xmlFile) public int getNextState(Cell currentCell, List neighbors) } package cellsociety; public class Main extends Application { public static final String DATA_FILE_FOLDER public void start (Stage primaryStage) public double getVersion () protected void showMessage (AlertType type, String message) } package cellsociety.model; public interface CellFactory { Cell makeCell(int state); } package cellsociety.model; public class Grid { public Grid(int numRows, int numCols) public Cell getCell(int row, int col) public int getNumRows() public int getNumCols() public boolean isInBounds(int row, int col) public void checkInBounds(int row, int col) public void setCell(int row, int col, Cell cell) public List getNeighbors(int row, int col) public List getAdjacentCells(int row, int col) } package cellsociety.model.cell; public class PercolationCell extends Cell { public PercolationCell(int initialState) public PercolationState getPercolationState() public void setPercolationState(PercolationState state) public Cell copy() public String getColor() } package cellsociety.model.cell; public class SegregationCell extends Cell { public SegregationCell(int initialState) public SegregationState getSegregationState() public void setSegregationState(SegregationState state) public Cell copy() public String getColor() } package cellsociety.model.cell; public class FireCell extends Cell { public FireCell(int initialState) public FireState getFireState() public void setFireState(FireState state) public Cell copy() public String getColor() } package cellsociety.model.cell; public class LifeCell extends Cell { public LifeCell(int initialState) public LifeState getLifeState() public void setLifeState(LifeState state) public Cell copy() public String getColor() } package cellsociety.model.cell; public class WaTorCell extends Cell { public WaTorCell(int initialState, int energy, int breedTime) public WaTorState getWaTorState() public void setWaTorState(WaTorState state) public int getEnergy() public void setEnergy(int energy) public int getBreedTime() public void setBreedTime(int breedTime) public Cell copy() public String getColor() } package cellsociety.model.cell; public abstract class Cell { public Cell(int initialStateValue) public int getCurrentStateValue() public void setCurrentStateValue(int stateValue) public boolean isInState(int stateValue) public abstract Cell copy(); public abstract String getColor(); } package cellsociety.model; public class GridManager { public GridManager(int numRows, int numCols, int[][] initialStates, CellFactory cellFactory) public GridManager(int numRows, int numCols, CellFactory cellFactory) public void setGridStates(int[][] gridStates) public int[][] getGridStates() public void computeNextGridByState(Simulation rule) public void computeNextGridByMovement(Simulation rule) public void updateGrid() public Grid getGrid() public void computeAndUpdateGridByState(Simulation rule) public void computeAndUpdateGridByMovement(Simulation rule) } package cellsociety.views; public class FireCellStateLegend extends CellStateLegend { protected void populate() } package cellsociety.views; public class LifeCellStateLegend extends CellStateLegend { protected void populate() } package cellsociety.views; public class SegregationCellStateLegend extends CellStateLegend { protected void populate() } package cellsociety.views; public abstract class CellStateLegend extends HBox { protected CellStateLegend() protected abstract void populate(); public void updateForSimulationType(String simulationType) } package cellsociety.views; public class SimulationScene extends AbstractScene { public SimulationScene(String name, String author, String desc, String type, GridManager gridManagerPassed) protected VBox createRoot() public void onShow(Stage stage) public void handleSave() public void onHide() public void changeBoard(String[][] gridColors) public float getSpeed() public void setSpeed(int diff) public boolean getPauseStatus() } package cellsociety.views; public class EndScene extends AbstractScene { public EndScene(String name, String author, String desc, String type, Grid finalGrid) protected VBox createRoot() public void onShow(Stage stage) } package cellsociety.views; public abstract class AbstractScene { protected AbstractScene(Stage stage) protected abstract Parent createRoot(); public void onShow(Stage stage) public void onHide() public Scene createScene(int width, int height, String cssResourcePath) public Scene getScene() public static Stage getStage() public Parent getRoot() } package cellsociety.views; public class WaTorCellStateLegend extends CellStateLegend { protected void populate() } package cellsociety.views; public class StartScene extends AbstractScene { public StartScene(Stage stage) protected VBox createRoot() public void onShow(Stage stage) public void setOnUpload(Consumer uploadAction) public File getSelectedFile() public void notifyFileChosen(File file) public void setOnStart(Runnable startAction) public void setRequestFileChooser(Runnable chooseAction) } package cellsociety.views; public final class SaveConfigWriter { public static class ConfigOptions { public ConfigOptions() public static ConfigOptions defaultOptionsForType(String simulationType) public static File saveSimulationToDownloads(String title, } package cellsociety.views; public class PercolationCellStateLegend extends CellStateLegend { protected void populate() } package cellsociety.views; public final class CellStateLegendFactory { public static CellStateLegend create(String simulationType) } package cellsociety.views; public class SceneManager { public SceneManager(Stage stage, int width, int height, String cssPath) public void show(AbstractScene scene) public Stage getStage() }