Search in sources :

Example 1 with NQueensViewCtrl

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

the class NQueensCspApp 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();
    StackPane stateView = new StackPane();
    stateViewCtrl = new NQueensViewCtrl(stateView);
    List<Parameter> params = createParameters();
    SimulationPaneBuilder builder = new SimulationPaneBuilder();
    builder.defineParameters(params);
    builder.defineStateView(stateView);
    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) SimulationPaneBuilder(aima.gui.fx.framework.SimulationPaneBuilder) NQueensViewCtrl(aima.gui.fx.views.NQueensViewCtrl) Parameter(aima.gui.fx.framework.Parameter) StackPane(javafx.scene.layout.StackPane)

Example 2 with NQueensViewCtrl

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

the class NQueensSearchApp 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();
    StackPane stateView = new StackPane();
    stateViewCtrl = new NQueensViewCtrl(stateView);
    List<Parameter> params = createParameters();
    SimulationPaneBuilder builder = new SimulationPaneBuilder();
    builder.defineParameters(params);
    builder.defineStateView(stateView);
    builder.defineInitMethod(this::initialize);
    builder.defineSimMethod(this::simulate);
    simPaneCtrl = builder.getResultFor(root);
    simPaneCtrl.setParam(SimulationPaneCtrl.PARAM_SIM_SPEED, 1);
    return root;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) SimulationPaneBuilder(aima.gui.fx.framework.SimulationPaneBuilder) NQueensViewCtrl(aima.gui.fx.views.NQueensViewCtrl) Parameter(aima.gui.fx.framework.Parameter) StackPane(javafx.scene.layout.StackPane)

Aggregations

Parameter (aima.gui.fx.framework.Parameter)2 SimulationPaneBuilder (aima.gui.fx.framework.SimulationPaneBuilder)2 NQueensViewCtrl (aima.gui.fx.views.NQueensViewCtrl)2 BorderPane (javafx.scene.layout.BorderPane)2 StackPane (javafx.scene.layout.StackPane)2