use of javafx.scene.layout.BorderPane in project aima-java by aimacode.
the class VacuumAgentApp 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 envView = new StackPane();
envViewCtrl = new VacuumEnvironmentViewCtrl(envView);
List<Parameter> params = createParameters();
SimulationPaneBuilder builder = new SimulationPaneBuilder();
builder.defineParameters(params);
builder.defineStateView(envView);
builder.defineInitMethod(this::initialize);
builder.defineSimMethod(this::simulate);
simPaneCtrl = builder.getResultFor(root);
return root;
}
use of javafx.scene.layout.BorderPane in project aima-java by aimacode.
the class MapColoringCspApp 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 CspViewCtrl<>(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);
return root;
}
use of javafx.scene.layout.BorderPane in project aima-java by aimacode.
the class GeneticMaximumFinderApp 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();
Canvas canvas = new Canvas();
funcPlotterCtrl = new FunctionPlotterCtrl(canvas);
funcPlotterCtrl.setLimits(Functions.minX, Functions.maxX, Functions.minY, Functions.maxY);
List<Parameter> params = createParameters();
SimulationPaneBuilder builder = new SimulationPaneBuilder();
builder.defineParameters(params);
builder.defineStateView(canvas);
builder.defineInitMethod(this::initialize);
builder.defineSimMethod(this::simulate);
simPaneCtrl = builder.getResultFor(root);
return root;
}
use of javafx.scene.layout.BorderPane 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;
}
use of javafx.scene.layout.BorderPane in project aima-java by aimacode.
the class VacuumEnvironmentViewCtrl method updateEnvStateView.
@Override
protected void updateEnvStateView(Environment env) {
if (env instanceof VacuumEnvironment) {
VacuumEnvironment vEnv = (VacuumEnvironment) env;
for (String loc : locations) {
BorderPane pane = getLocPane(loc);
if (vEnv.getLocationState(loc).equals(LocationState.Dirty))
pane.setStyle("-fx-background-color: lightgrey");
else
pane.setStyle("-fx-background-color: white");
pane.setCenter(null);
}
for (Agent agent : vEnv.getAgents()) {
BorderPane pane = getLocPane(vEnv.getAgentLocation(agent));
pane.setCenter(createAgentRep(agent == agentInAction));
}
}
}
Aggregations