Search in sources :

Example 26 with StackPane

use of javafx.scene.layout.StackPane in project jgnash by ccavanaugh.

the class MainView method start.

public void start(final Stage stage, @Nullable final File dataFile, final char[] password, @Nullable final String host, final int port) throws Exception {
    ThemeManager.restoreLastUsedTheme();
    primaryStage = stage;
    busyPane = new BusyPane();
    final FXMLLoader fxmlLoader = new FXMLLoader(MenuBarController.class.getResource("MainMenuBar.fxml"), resources);
    menuBar = fxmlLoader.load();
    final ToolBar mainToolBar = FXMLLoader.load(MainToolBarController.class.getResource("MainToolBar.fxml"), resources);
    tabViewPane = new TabViewPane();
    final VBox top = new VBox();
    top.getChildren().addAll(menuBar, mainToolBar);
    top.setFillWidth(true);
    statusBar = new StatusBar();
    final BorderPane borderPane = new BorderPane();
    borderPane.setTop(top);
    borderPane.setCenter(tabViewPane);
    borderPane.setBottom(statusBar);
    final StackPane stackPane = new StackPane();
    stackPane.getChildren().addAll(borderPane, busyPane);
    final Scene scene = new Scene(stackPane, 640, 480);
    scene.getStylesheets().add(DEFAULT_CSS);
    scene.getRoot().styleProperty().bind(ThemeManager.styleProperty());
    stage.setTitle(title);
    stage.getIcons().add(StaticUIMethods.getApplicationIcon());
    stage.setScene(scene);
    stage.setResizable(true);
    // enforce a min width to prevent it from disappearing with a bad click and drag
    stage.setMinWidth(640);
    stage.setMinHeight(480);
    installHandlers();
    MessageBus.getInstance().registerListener(this, MessageChannel.SYSTEM);
    StageUtils.addBoundsListener(stage, MainView.class);
    stage.show();
    Engine.addLogHandler(statusBarLogHandler);
    EngineFactory.addLogHandler(statusBarLogHandler);
    YahooParser.addLogHandler(statusBarLogHandler);
    UpdateFactory.addLogHandler(statusBarLogHandler);
    // listen to my own logger
    logger.addHandler(statusBarLogHandler);
    stage.toFront();
    stage.requestFocus();
    if (host != null) {
        // connect to a remote server instead of loading a local file
        new Thread(() -> {
            try {
                Thread.sleep(BootEngineTask.FORCED_DELAY);
                backgroundExecutor.execute(() -> JavaFXUtils.runLater(() -> BootEngineTask.initiateBoot(null, password, true, host, port)));
            } catch (InterruptedException e) {
                logger.log(Level.SEVERE, e.getLocalizedMessage(), e);
            }
        }).start();
    } else if (dataFile != null) {
        // Load the specified file, this overrides the last open file
        new Thread(() -> {
            try {
                Thread.sleep(BootEngineTask.FORCED_DELAY);
                backgroundExecutor.execute(() -> JavaFXUtils.runLater(() -> BootEngineTask.initiateBoot(dataFile.getAbsolutePath(), password, false, null, 0)));
            } catch (InterruptedException e) {
                logger.log(Level.SEVERE, e.getLocalizedMessage(), e);
            }
        }).start();
    } else if (Options.openLastProperty().get()) {
        // Load the last open file if enabled
        new Thread(() -> {
            try {
                Thread.sleep(BootEngineTask.FORCED_DELAY);
                backgroundExecutor.execute(() -> JavaFXUtils.runLater(BootEngineTask::openLast));
            } catch (InterruptedException e) {
                logger.log(Level.SEVERE, e.getLocalizedMessage(), e);
            }
        }).start();
    }
    loadPlugins();
    checkForLatestRelease();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) Scene(javafx.scene.Scene) FXMLLoader(javafx.fxml.FXMLLoader) StatusBar(jgnash.uifx.control.StatusBar) TabViewPane(jgnash.uifx.control.TabViewPane) BusyPane(jgnash.uifx.control.BusyPane) BootEngineTask(jgnash.uifx.tasks.BootEngineTask) ToolBar(javafx.scene.control.ToolBar) VBox(javafx.scene.layout.VBox) StackPane(javafx.scene.layout.StackPane)

Example 27 with StackPane

use of javafx.scene.layout.StackPane in project Gargoyle by callakrsos.

the class AbstractGoogleTrendChart method fillChartData.

/**
	 * 차트 그리는 작업 처리
	 * @작성자 : KYJ
	 * @작성일 : 2016. 11. 2.
	 */
protected void fillChartData() {
    IGargoyleChartAdapter<T, C> adapter = this.adapter;
    String title = adapter.getTitle(this.json.get());
    setTitle(title);
    //this.getJson();
    T json = this.json.get();
    if (ValueUtil.isNotEmpty(json)) {
        int columnCount = adapter.getColumnCount();
        for (int i = 0; i < columnCount; i++) {
            String columnName = adapter.getColumnName(i);
            ObservableList<Data<String, Number>> data = FXCollections.observableArrayList();
            javafx.scene.chart.XYChart.Series<String, Number> series = new Series<>(columnName, data);
            getData().add(series);
            int valueCount = adapter.getValueCount(columnName);
            for (int v = 0; v < valueCount; v++) {
                Data<String, Number> value = adapter.getValue(i, columnName, v);
                if (value == null)
                    continue;
                StackPane s = new StackPane(new Rectangle());
                value.setNode(s);
                s.setUserData(new ChartOverTooltip(i, columnName, value));
                data.add(value);
            }
        }
    }
}
Also used : Rectangle(javafx.scene.shape.Rectangle) StackPane(javafx.scene.layout.StackPane)

Example 28 with StackPane

use of javafx.scene.layout.StackPane in project Gargoyle by callakrsos.

the class XY method convert.

public static ScrollPane convert(Node target) {
    StackPane stackPane = new StackPane();
    ScrollPane scrollPane = new ScrollPane(stackPane);
    stackPane.getChildren().add(target);
    stackPane.getChildren().add(draw());
    return scrollPane;
}
Also used : ScrollPane(javafx.scene.control.ScrollPane) StackPane(javafx.scene.layout.StackPane)

Example 29 with StackPane

use of javafx.scene.layout.StackPane in project Gargoyle by callakrsos.

the class SVNViewer method setDataNode.

private void setDataNode(SVNLogEntry entry, Data<String, String> data) {
    Group group = new Group();
    group.setManaged(false);
    Text value = new Text(entry.getRevision() + "");
    value.setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);
    value.translateYProperty().set(-15);
    Circle circle = new Circle(4, Color.WHITE);
    circle.setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);
    circle.setStroke(Color.web("#f3622d"));
    StackPane stackPane = new StackPane(value, circle);
    stackPane.setPrefSize(30, 60);
    group.getChildren().add(stackPane);
    data.setNode(group);
}
Also used : Group(javafx.scene.Group) Circle(javafx.scene.shape.Circle) Text(javafx.scene.text.Text) StackPane(javafx.scene.layout.StackPane)

Example 30 with StackPane

use of javafx.scene.layout.StackPane in project jabref by JabRef.

the class EntryEditor method addSpecialTabs.

private void addSpecialTabs() {
    // MathSciNet Review
    entry.getField(FieldName.MR_NUMBER).flatMap(MathSciNetId::parse).ifPresent(mrNumber -> {
        JFXPanel reviewPane = new JFXPanel();
        tabbed.addTab(Localization.lang("MathSciNet Review"), reviewPane);
        tabs.add(reviewPane);
        Platform.runLater(() -> {
            StackPane root = new MathSciNetPaneView(mrNumber).getPane();
            reviewPane.setScene(new Scene(root));
        });
    });
}
Also used : JFXPanel(javafx.embed.swing.JFXPanel) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Aggregations

StackPane (javafx.scene.layout.StackPane)65 Scene (javafx.scene.Scene)36 Insets (javafx.geometry.Insets)15 BorderPane (javafx.scene.layout.BorderPane)12 Label (javafx.scene.control.Label)10 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 ArrayList (java.util.ArrayList)5 Platform (javafx.application.Platform)5 MapPaneCtrl (aimax.osm.gui.fx.viewer.MapPaneCtrl)4 List (java.util.List)4 Node (javafx.scene.Node)4 Button (javafx.scene.control.Button)4 KeyCode (javafx.scene.input.KeyCode)4 Pane (javafx.scene.layout.Pane)4 Color (javafx.scene.paint.Color)4 WebView (javafx.scene.web.WebView)4