Search in sources :

Example 1 with SimpleEnvironmentViewCtrl

use of aima.gui.fx.views.SimpleEnvironmentViewCtrl in project aima-java by aimacode.

the class OsmAgentBaseApp method createRootPane.

/**
	 * Defines state view, parameters, and call-back functions and calls the
	 * simulation pane builder to create layout and controller objects.
	 */
@Override
public Pane createRootPane() {
    BorderPane root = new BorderPane();
    List<Parameter> params = createParameters();
    StackPane mapPane = new StackPane();
    mapPaneCtrl = new MapPaneCtrl(mapPane);
    loadMap();
    StackPane envView = new StackPane();
    envViewCtrl = new SimpleEnvironmentViewCtrl(envView, mapPane, 0.75);
    SimulationPaneBuilder builder = new SimulationPaneBuilder();
    builder.defineParameters(params);
    builder.defineStateView(envView);
    builder.defineInitMethod(this::initialize);
    builder.defineSimMethod(this::simulate);
    simPaneCtrl = builder.getResultFor(root);
    simPaneCtrl.setParam(SimulationPaneCtrl.PARAM_SIM_SPEED, 0);
    return root;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) MapPaneCtrl(aimax.osm.gui.fx.viewer.MapPaneCtrl) SimulationPaneBuilder(aima.gui.fx.framework.SimulationPaneBuilder) Parameter(aima.gui.fx.framework.Parameter) StackPane(javafx.scene.layout.StackPane) SimpleEnvironmentViewCtrl(aima.gui.fx.views.SimpleEnvironmentViewCtrl)

Aggregations

Parameter (aima.gui.fx.framework.Parameter)1 SimulationPaneBuilder (aima.gui.fx.framework.SimulationPaneBuilder)1 SimpleEnvironmentViewCtrl (aima.gui.fx.views.SimpleEnvironmentViewCtrl)1 MapPaneCtrl (aimax.osm.gui.fx.viewer.MapPaneCtrl)1 BorderPane (javafx.scene.layout.BorderPane)1 StackPane (javafx.scene.layout.StackPane)1