use of javafx.scene.layout.StackPane in project aima-java by aimacode.
the class EightPuzzleApp 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 EightPuzzleViewCtrl(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.StackPane in project aima-java by aimacode.
the class SimpleSudokuApp method createRootPane.
@Override
public Pane createRootPane() {
StackPane root = new StackPane();
stateViewCtrl = new SudokuViewCtrl(root);
return root;
}
use of javafx.scene.layout.StackPane 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;
}
use of javafx.scene.layout.StackPane in project aima-java by aimacode.
the class OsmViewerApp method start.
@Override
public void start(Stage primaryStage) throws Exception {
// indicates progress when reading large maps (for testing only)
// Logger.getLogger("aimax.osm").setLevel(Level.FINEST);
// Logger.getLogger("").getHandlers()[0].setLevel(Level.FINE);
Locale.setDefault(Locale.US);
StackPane mapPane = new StackPane();
MapPaneCtrl mapPaneCtrl = new MapPaneCtrl(mapPane);
mapPaneCtrl.loadMap(DataResource.getULMFileResource());
BorderPane root = new BorderPane();
root.setCenter(mapPane);
Scene scene = new Scene(root, 800, 600);
primaryStage.setTitle("Osm Viewer App");
primaryStage.setScene(scene);
primaryStage.show();
}
use of javafx.scene.layout.StackPane in project bitsquare by bitsquare.
the class BitsquareApp method showFPSWindow.
private void showFPSWindow() {
Label label = new Label();
EventStreams.animationTicks().latestN(100).map(ticks -> {
int n = ticks.size() - 1;
return n * 1_000_000_000.0 / (ticks.get(n) - ticks.get(0));
}).map(d -> String.format("FPS: %.3f", d)).feedTo(label.textProperty());
Pane root = new StackPane();
root.getChildren().add(label);
Stage stage = new Stage();
stage.setScene(new Scene(root));
stage.setTitle("FPS");
stage.initModality(Modality.NONE);
stage.initStyle(StageStyle.UTILITY);
stage.initOwner(scene.getWindow());
stage.setX(primaryStage.getX() + primaryStage.getWidth() + 10);
stage.setY(primaryStage.getY());
stage.setWidth(200);
stage.setHeight(100);
stage.show();
}
Aggregations