Search in sources :

Example 56 with StackPane

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;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) SimulationPaneBuilder(aima.gui.fx.framework.SimulationPaneBuilder) EightPuzzleViewCtrl(aima.gui.fx.views.EightPuzzleViewCtrl) Parameter(aima.gui.fx.framework.Parameter) StackPane(javafx.scene.layout.StackPane)

Example 57 with StackPane

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;
}
Also used : SudokuViewCtrl(aima.gui.fx.views.SudokuViewCtrl) StackPane(javafx.scene.layout.StackPane)

Example 58 with StackPane

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;
}
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)

Example 59 with StackPane

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();
}
Also used : MapPaneCtrl(aimax.osm.gui.fx.viewer.MapPaneCtrl) BorderPane(javafx.scene.layout.BorderPane) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Example 60 with StackPane

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();
}
Also used : StageStyle(javafx.stage.StageStyle) Popup(io.bitsquare.gui.main.overlays.popups.Popup) LoggerFactory(org.slf4j.LoggerFactory) Security(java.security.Security) View(io.bitsquare.gui.common.view.View) StackPane(javafx.scene.layout.StackPane) KeyCombination(javafx.scene.input.KeyCombination) Application(javafx.application.Application) Parent(javafx.scene.Parent) UITimer(io.bitsquare.gui.common.UITimer) TradeWalletService(io.bitsquare.btc.TradeWalletService) ResultHandler(io.bitsquare.common.handlers.ResultHandler) BlockStoreException(org.bitcoinj.store.BlockStoreException) Pane(javafx.scene.layout.Pane) Font(javafx.scene.text.Font) LimitedKeyStrengthException(io.bitsquare.common.util.LimitedKeyStrengthException) FilterManager(io.bitsquare.filter.FilterManager) KeyEvent(javafx.scene.input.KeyEvent) InjectorViewFactory(io.bitsquare.gui.common.view.guice.InjectorViewFactory) Platform(javafx.application.Platform) List(java.util.List) io.bitsquare.gui.main.overlays.windows(io.bitsquare.gui.main.overlays.windows) Logger(ch.qos.logback.classic.Logger) MainViewModel(io.bitsquare.gui.main.MainViewModel) Environment(org.springframework.core.env.Environment) Dialogs(org.controlsfx.dialog.Dialogs) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) EventStreams(org.reactfx.EventStreams) CommonOptionKeys(io.bitsquare.common.CommonOptionKeys) ExceptionUtils(org.apache.commons.lang3.exception.ExceptionUtils) Scene(javafx.scene.Scene) MainView(io.bitsquare.gui.main.MainView) DebugView(io.bitsquare.gui.main.debug.DebugView) P2PService(io.bitsquare.p2p.P2PService) ArrayList(java.util.ArrayList) TradeManager(io.bitsquare.trade.TradeManager) CachingViewLoader(io.bitsquare.gui.common.view.CachingViewLoader) WalletService(io.bitsquare.btc.WalletService) SystemTray(io.bitsquare.gui.SystemTray) APP_NAME_KEY(io.bitsquare.app.AppOptionKeys.APP_NAME_KEY) KeyCode(javafx.scene.input.KeyCode) Modality(javafx.stage.Modality) Utilities(io.bitsquare.common.util.Utilities) Label(javafx.scene.control.Label) UserThread(io.bitsquare.common.UserThread) ImageUtil(io.bitsquare.gui.util.ImageUtil) IOException(java.io.IOException) ViewLoader(io.bitsquare.gui.common.view.ViewLoader) BouncyCastleProvider(org.bouncycastle.jce.provider.BouncyCastleProvider) Injector(com.google.inject.Injector) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) TimeUnit(java.util.concurrent.TimeUnit) Level(ch.qos.logback.classic.Level) Stage(javafx.stage.Stage) Paths(java.nio.file.Paths) OpenOfferManager(io.bitsquare.trade.offer.OpenOfferManager) ArbitratorManager(io.bitsquare.arbitration.ArbitratorManager) Guice(com.google.inject.Guice) Profiler(io.bitsquare.common.util.Profiler) Storage(io.bitsquare.storage.Storage) Image(javafx.scene.image.Image) AlertManager(io.bitsquare.alert.AlertManager) Label(javafx.scene.control.Label) Stage(javafx.stage.Stage) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane) StackPane(javafx.scene.layout.StackPane)

Aggregations

StackPane (javafx.scene.layout.StackPane)63 Scene (javafx.scene.Scene)34 Insets (javafx.geometry.Insets)15 BorderPane (javafx.scene.layout.BorderPane)12 Label (javafx.scene.control.Label)9 Parameter (aima.gui.fx.framework.Parameter)8 SimulationPaneBuilder (aima.gui.fx.framework.SimulationPaneBuilder)8 FlowPane (javafx.scene.layout.FlowPane)8 VBox (javafx.scene.layout.VBox)6 JFXButton (com.jfoenix.controls.JFXButton)5 Group (javafx.scene.Group)5 MapPaneCtrl (aimax.osm.gui.fx.viewer.MapPaneCtrl)4 ArrayList (java.util.ArrayList)4 Platform (javafx.application.Platform)4 Node (javafx.scene.Node)4 Button (javafx.scene.control.Button)4 Color (javafx.scene.paint.Color)4 WebView (javafx.scene.web.WebView)4 JFXHamburger (com.jfoenix.controls.JFXHamburger)3 JFXTextField (com.jfoenix.controls.JFXTextField)3