Skip to content

Modifying CAViewer

jedlimlx edited this page Aug 15, 2020 · 1 revision

Modifying the GUI

You will need to install SceneBuilder.

CAViewer uses the MVC or Model, View, Controller framework.
Model contains the classes the run the simulation as well as search programs.
Controller contains the event handling classes and the dialogs.
Resources contains the resources needed to render the application such as the *.fxml files and icons.

main.fxml contains the GUI of the main window. Open it in SceneBuilder to modify it.
Events from main.fxml are handled by MainController.java. See the comments / javadoc in MainController.java for more information.

Adding custom rule families

Note: Documentation under construction

Adding custom named neighbourhood types

  1. Add a generator function in NeighbourhoodGenerator.java. It should generate an array of Coordinates.
  2. Add a new case in the switch in the generateFromSymbol method.
  3. If the neighbourhood has weights, add another generator function for the weights. It should generate an array of integers which correspond to the weights of each of the coordinates in the first generator function.
  4. Add a new case in the switch in the generateWeightsFromSymbol method.
  5. Finally, add the symbol used to the static neighbourhoodSymbols variable.
Clone this wiki locally