List of usage examples for javafx.scene.layout BorderPane setBottom
public final void setBottom(Node value)
From source file:AudioPlayer3.java
@Override public void start(Stage primaryStage) { System.out.println("JavaFX version: " + VersionInfo.getRuntimeVersion()); songModel.setURL("http://traffic.libsyn.com/dickwall/JavaPosse373.mp3"); metaDataView = new MetadataView(songModel); playerControlsView = new PlayerControlsView(songModel); final BorderPane root = new BorderPane(); root.setCenter(metaDataView.getViewNode()); root.setBottom(playerControlsView.getViewNode()); final Scene scene = new Scene(root, 800, 400); initSceneDragAndDrop(scene);//from w ww . j a v a 2 s . c o m final URL stylesheet = getClass().getResource("media.css"); scene.getStylesheets().add(stylesheet.toString()); primaryStage.setScene(scene); primaryStage.setTitle("Audio Player 3"); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { Group root = new Group(); Scene scene = new Scene(root, 330, 120, Color.WHITE); BorderPane mainPane = new BorderPane(); root.getChildren().add(mainPane);//from www. jav a 2 s . c o m final Label label = new Label("Files Transfer:"); final ProgressBar progressBar = new ProgressBar(0); final HBox hb = new HBox(); hb.setSpacing(5); hb.setAlignment(Pos.CENTER); hb.getChildren().addAll(label, progressBar); mainPane.setTop(hb); final Button startButton = new Button("Start"); final Button cancelButton = new Button("Cancel"); final HBox hb2 = new HBox(); hb2.setSpacing(5); hb2.setAlignment(Pos.CENTER); hb2.getChildren().addAll(startButton, cancelButton); mainPane.setBottom(hb2); startButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { startButton.setDisable(true); progressBar.setProgress(0); cancelButton.setDisable(false); copyWorker = createWorker(); progressBar.progressProperty().unbind(); progressBar.progressProperty().bind(copyWorker.progressProperty()); copyWorker.messageProperty().addListener(new ChangeListener<String>() { public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { System.out.println(newValue); } }); new Thread(copyWorker).start(); } }); cancelButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { startButton.setDisable(false); cancelButton.setDisable(true); copyWorker.cancel(true); progressBar.progressProperty().unbind(); progressBar.setProgress(0); System.out.println("cancelled."); } }); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { Group root = new Group(); Scene scene = new Scene(root, 330, 120, Color.WHITE); BorderPane mainPane = new BorderPane(); root.getChildren().add(mainPane);//from ww w .j a va2 s . c om final Label label = new Label("Files Transfer:"); final ProgressBar progressBar = new ProgressBar(0); final HBox hb = new HBox(); hb.setSpacing(5); hb.setAlignment(Pos.CENTER); hb.getChildren().addAll(label, progressBar); mainPane.setTop(hb); final Button startButton = new Button("Start"); final Button cancelButton = new Button("Cancel"); final HBox hb2 = new HBox(); hb2.setSpacing(5); hb2.setAlignment(Pos.CENTER); hb2.getChildren().addAll(startButton, cancelButton); mainPane.setBottom(hb2); startButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { startButton.setDisable(true); progressBar.setProgress(0); cancelButton.setDisable(false); copyWorker = createWorker(); progressBar.progressProperty().unbind(); progressBar.progressProperty().bind(copyWorker.progressProperty()); copyWorker.messageProperty().addListener(new ChangeListener<String>() { public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { System.out.println(newValue); } }); new Thread(copyWorker).start(); } }); cancelButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { startButton.setDisable(false); cancelButton.setDisable(true); copyWorker.cancel(true); progressBar.progressProperty().unbind(); progressBar.setProgress(0); System.out.println("cancelled."); } }); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Background Processes"); Group root = new Group(); Scene scene = new Scene(root, 330, 120, Color.WHITE); BorderPane mainPane = new BorderPane(); root.getChildren().add(mainPane);/*from www.jav a 2 s . c o m*/ final Label label = new Label("Files Transfer:"); final ProgressBar progressBar = new ProgressBar(0); final HBox hb = new HBox(); hb.setSpacing(5); hb.setAlignment(Pos.CENTER); hb.getChildren().addAll(label, progressBar); mainPane.setTop(hb); final Button startButton = new Button("Start"); final Button cancelButton = new Button("Cancel"); final HBox hb2 = new HBox(); hb2.setSpacing(5); hb2.setAlignment(Pos.CENTER); hb2.getChildren().addAll(startButton, cancelButton); mainPane.setBottom(hb2); startButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { startButton.setDisable(true); progressBar.setProgress(0); cancelButton.setDisable(false); copyWorker = createWorker(); progressBar.progressProperty().unbind(); progressBar.progressProperty().bind(copyWorker.progressProperty()); copyWorker.messageProperty().addListener(new ChangeListener<String>() { public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { System.out.println(newValue); } }); new Thread(copyWorker).start(); } }); cancelButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { startButton.setDisable(false); cancelButton.setDisable(true); copyWorker.cancel(true); progressBar.progressProperty().unbind(); progressBar.setProgress(0); System.out.println("cancelled."); } }); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Background Processes"); Group root = new Group(); Scene scene = new Scene(root, 330, 120, Color.WHITE); BorderPane mainPane = new BorderPane(); root.getChildren().add(mainPane);/*from w w w .j ava 2 s . co m*/ final Label label = new Label("Files Transfer:"); final ProgressIndicator progressIndicator = new ProgressIndicator(0); final HBox hb = new HBox(); hb.setSpacing(5); hb.setAlignment(Pos.CENTER); hb.getChildren().addAll(label, progressIndicator); mainPane.setTop(hb); final Button startButton = new Button("Start"); final Button cancelButton = new Button("Cancel"); final HBox hb2 = new HBox(); hb2.setSpacing(5); hb2.setAlignment(Pos.CENTER); hb2.getChildren().addAll(startButton, cancelButton); mainPane.setBottom(hb2); startButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { startButton.setDisable(true); progressIndicator.setProgress(0); cancelButton.setDisable(false); copyWorker = createWorker(); progressIndicator.progressProperty().unbind(); progressIndicator.progressProperty().bind(copyWorker.progressProperty()); copyWorker.messageProperty().addListener(new ChangeListener<String>() { public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) { System.out.println(newValue); } }); new Thread(copyWorker).start(); } }); cancelButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { startButton.setDisable(false); cancelButton.setDisable(true); copyWorker.cancel(true); progressIndicator.progressProperty().unbind(); progressIndicator.setProgress(0); System.out.println("cancelled."); } }); primaryStage.setScene(scene); primaryStage.show(); }
From source file:org.jevis.jeconfig.JEConfig.java
/** * Build an new JEConfig Login and main frame/stage * * @param primaryStage/*from w w w. j a v a 2 s . c om*/ */ //@AITBilal - Dieses Method wird nirgendwo aufgerufen! private void buildGUI(Stage primaryStage) { try { LoginDialog loginD = new LoginDialog(); // ds = loginD.showSQL(primaryStage, _config.get<LoginIcon()); ds = loginD.showSQL(primaryStage);//Default // ds = loginD.showSQL(primaryStage, _config.getLoginIcon(), _config.getEnabledSSL(), _config.getShowServer(), _config.getDefaultServer());//KAUST // ds = loginD.showSQL(primaryStage, _config.getLoginIcon(), _config.getEnabledSSL(), _config.getShowServer(), _config.getDefaultServer());//Coffee // while (ds == null) { // Thread.sleep(100); // } // if (ds == null) { // System.exit(0); // } // System.exit(1); // ds = new JEVisDataSourceSQL("192.168.2.55", "3306", "jevis", "jevis", "jevistest", "Sys Admin", "jevis"); // ds.connect("Sys Admin", "jevis"); } catch (Exception ex) { Logger.getLogger(JEConfig.class.getName()).log(Level.SEVERE, null, ex); ExceptionDialog dia = new ExceptionDialog(); dia.show(primaryStage, "Error", "Could not connect to Server", ex, PROGRAMM_INFO); } _mainDS = ds; JEConfig.PROGRAMM_INFO.setJEVisAPI(ds.getInfo()); JEConfig.PROGRAMM_INFO.addLibrary(org.jevis.commons.application.Info.INFO); JEConfig.PROGRAMM_INFO.addLibrary(org.jevis.application.Info.INFO); PluginManager pMan = new PluginManager(ds); GlobalToolBar toolbar = new GlobalToolBar(pMan); pMan.addPluginsByUserSetting(null); StackPane root = new StackPane(); root.setId("mainpane"); BorderPane border = new BorderPane(); VBox vbox = new VBox(); vbox.getChildren().addAll(new TopMenu(), toolbar.ToolBarFactory()); border.setTop(vbox); border.setCenter(pMan.getView()); Statusbar statusBar = new Statusbar(ds); border.setBottom(statusBar); root.getChildren().addAll(border); Scene scene = new Scene(root, 300, 250); scene.getStylesheets().add("/styles/Styles.css"); primaryStage.getIcons().add(getImage("1393354629_Config-Tools.png")); primaryStage.setTitle("JEConfig"); primaryStage.setScene(scene); maximize(primaryStage); primaryStage.show(); try { // WelcomePage welcome = new WelcomePage(primaryStage, new URI("http://coffee-project.eu/")); // WelcomePage welcome = new WelcomePage(primaryStage, new URI("http://openjevis.org/projects/openjevis/wiki/JEConfig3#JEConfig-Version-3")); WelcomePage welcome = new WelcomePage(primaryStage, _config.getWelcomeURL()); } catch (URISyntaxException ex) { Logger.getLogger(JEConfig.class.getName()).log(Level.SEVERE, null, ex); } catch (MalformedURLException ex) { Logger.getLogger(JEConfig.class.getName()).log(Level.SEVERE, null, ex); } //Disable GUI is StatusBar note an disconnect root.disableProperty().bind(statusBar.connectedProperty.not()); primaryStage.onCloseRequestProperty().addListener(new ChangeListener<EventHandler<WindowEvent>>() { @Override public void changed(ObservableValue<? extends EventHandler<WindowEvent>> ov, EventHandler<WindowEvent> t, EventHandler<WindowEvent> t1) { try { System.out.println("Disconnect"); ds.disconnect(); } catch (JEVisException ex) { Logger.getLogger(JEConfig.class.getName()).log(Level.SEVERE, null, ex); } } }); }
From source file:be.makercafe.apps.makerbench.Main.java
@Override public void start(Stage primaryStage) { setupWorkspace();//from w ww .j ava 2s. c o m rootContextMenu = createViewerContextMenu(); viewer = createViewer(); this.stage = primaryStage; BorderPane p = new BorderPane(); p.setTop(createMenuBar()); // p.setLeft(viewer); tabFolder = new TabPane(); BorderPane bodyPane = new BorderPane(); TextArea taConsole = new TextArea(); taConsole.setPrefSize(Double.MAX_VALUE, 200.0); taConsole.setEditable(false); Console console = new Console(taConsole); PrintStream ps = new PrintStream(console, true); System.setOut(ps); System.setErr(ps); bodyPane.setBottom(taConsole); bodyPane.setCenter(tabFolder); SplitPane splitpane = new SplitPane(); splitpane.getItems().addAll(viewer, bodyPane); splitpane.setDividerPositions(0.0f, 1.0f); p.setCenter(splitpane); Scene scene = new Scene(p, 1024, 800); //scene.getStylesheets().add(this.getClass().getResource("/styles/java-keywords.css").toExternalForm()); primaryStage.setResizable(true); primaryStage.setTitle("Makerbench"); primaryStage.setScene(scene); //primaryStage.getIcons().add(new Image("/path/to/stackoverflow.jpg")); primaryStage.show(); }
From source file:org.pdfsam.ui.news.NewsStage.java
@Inject public NewsStage(Collection<Image> logos, StylesConfig styles, @Named("newsDisplayPolicy") PreferenceComboBox<KeyStringValueItem<String>> newsDisplayPolicy) { BorderPane containerPane = new BorderPane(); browser.setId("newsBrowser"); containerPane.getStyleClass().addAll(Style.CONTAINER.css()); containerPane.getStyleClass().add("-pdfsam-news-pane"); containerPane.setCenter(browser);//w ww . j ava2 s . co m HBox bottom = new HBox(); ClosePane closePane = new ClosePane(); HBox.setHgrow(closePane, Priority.ALWAYS); HBox comboPanel = new HBox(new Label(DefaultI18nContext.getInstance().i18n("Show this:")), newsDisplayPolicy); comboPanel.getStyleClass().addAll(Style.CONTAINER.css()); comboPanel.getStyleClass().add("-pdfsam-news-pane-bottom"); bottom.getChildren().addAll(comboPanel, closePane); containerPane.setBottom(bottom); Scene scene = new Scene(containerPane); scene.getStylesheets().addAll(styles.styles()); scene.setOnKeyReleased(new HideOnEscapeHandler(this)); setScene(scene); setTitle(DefaultI18nContext.getInstance().i18n("What's new")); getIcons().addAll(logos); setMaximized(false); }
From source file:qupath.lib.gui.panels.classify.RandomTrainingRegionSelector.java
private void createDialog() { dialog = new Stage(); dialog.initOwner(qupath.getStage()); dialog.setTitle("Training sample selector"); pointCreator = new RandomPointCreator(); for (PathClass pathClass : pathClassListModel) { if (pathClass != null && pathClass.getName() != null) pointCreator.addPathClass(pathClass, KeyCode.getKeyCode(pathClass.getName().toUpperCase().substring(0, 1))); // pointCreator.addPathClass(pathClass, KeyStroke.getKeyStroke(new pathClass.getName().toLowerCase().charAt(0), 0).getKeyCode()); }/* w ww . ja va 2s.com*/ // PathClass tumourClass = PathClassFactory.getDefaultPathClass(PathClasses.TUMOR); // PathClass stromaClass = PathClassFactory.getDefaultPathClass(PathClasses.STROMA); // pointCreator.addPathClass(tumourClass, KeyCode.T); // pointCreator.addPathClass(stromaClass, KeyCode.S); QuPathViewer viewer = qupath.getViewer(); pointCreator.registerViewer(viewer); // Adapt to changing active viewers ImageDataChangeListener<BufferedImage> listener = new ImageDataChangeListener<BufferedImage>() { @Override public void imageDataChanged(ImageDataWrapper<BufferedImage> source, ImageData<BufferedImage> imageDataOld, ImageData<BufferedImage> imageDataNew) { if (pointCreator != null) { QuPathViewer viewer = qupath.getViewer(); pointCreator.registerViewer(viewer); updateObjectCache(viewer); } refreshList(); updateLabel(); } }; qupath.addImageDataChangeListener(listener); // Remove listeners for cleanup dialog.setOnCloseRequest(e -> { pointCreator.deregisterViewer(); qupath.removeImageDataChangeListener(listener); dialog.setOnCloseRequest(null); dialog = null; // Re-enable mode switching qupath.setModeSwitchingEnabled(true); }); ParameterPanelFX paramPanel = new ParameterPanelFX(params); paramPanel.getPane().setPadding(new Insets(2, 5, 5, 5)); list = new ListView<PathClass>(pathClassListModel); list.setPrefSize(400, 200); // TODO: ADD A SENSIBLE RENDERER! // For now, this is simply duplicated from PathAnnotationPanel list.setCellFactory(new Callback<ListView<PathClass>, ListCell<PathClass>>() { @Override public ListCell<PathClass> call(ListView<PathClass> p) { ListCell<PathClass> cell = new ListCell<PathClass>() { @Override protected void updateItem(PathClass value, boolean bln) { super.updateItem(value, bln); int size = 10; if (value == null) { setText(null); setGraphic(null); } else if (value.getName() == null) { setText("None"); setGraphic(new Rectangle(size, size, ColorToolsFX.getCachedColor(0, 0, 0, 0))); } else { setText(value.getName()); setGraphic(new Rectangle(size, size, ColorToolsFX.getPathClassColor(value))); } } }; return cell; } }); // list.setCellRenderer(new PathClassListCellRendererPoints()); list.setTooltip(new Tooltip("Available classes")); labelCount = new Label(); labelCount.setTextAlignment(TextAlignment.CENTER); labelCount.setPadding(new Insets(5, 0, 5, 0)); BorderPane panelTop = new BorderPane(); panelTop.setTop(paramPanel.getPane()); panelTop.setCenter(list); panelTop.setBottom(labelCount); labelCount.prefWidthProperty().bind(panelTop.widthProperty()); updateLabel(); // panelButtons.add(new JButton(new UndoAction("Undo"))); Action actionAdd = new Action("Add to class", e -> { if (list == null || pointCreator == null) return; PathClass pathClass = list.getSelectionModel().getSelectedItem(); pointCreator.addPoint(pathClass); }); Action actionSkip = new Action("Skip", e -> { if (pointCreator != null) pointCreator.addPoint(null); }); GridPane panelButtons = PanelToolsFX.createColumnGridControls(ActionUtils.createButton(actionAdd), ActionUtils.createButton(actionSkip)); BorderPane pane = new BorderPane(); pane.setCenter(panelTop); pane.setBottom(panelButtons); pane.setPadding(new Insets(10, 10, 10, 10)); Scene scene = new Scene(pane); dialog.setScene(scene); }
From source file:org.jevis.jeconfig.JEConfig.java
/** * Build an new JEConfig Login and main frame/stage * * @param primaryStage/*from w w w . ja va2 s .co m*/ */ //AITBilal - Login private void initGUI(Stage primaryStage) { Scene scene; LoginGlass login = new LoginGlass(primaryStage); AnchorPane jeconfigRoot = new AnchorPane(); AnchorPane.setTopAnchor(jeconfigRoot, 0.0); AnchorPane.setRightAnchor(jeconfigRoot, 0.0); AnchorPane.setLeftAnchor(jeconfigRoot, 0.0); AnchorPane.setBottomAnchor(jeconfigRoot, 0.0); // jeconfigRoot.setStyle("-fx-background-color: white;"); // jeconfigRoot.getChildren().setAll(new Label("sodfhsdhdsofhdshdsfdshfjf")); Screen screen = Screen.getPrimary(); Rectangle2D bounds = screen.getVisualBounds(); // @AITBilal - Main frame elemente wird aufgerufen nachdem man sich eingeloggt hat. login.getLoginStatus().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) { if (newValue) { System.out.println("after request"); _mainDS = login.getDataSource(); ds = _mainDS; Platform.runLater(new Runnable() { @Override public void run() { FadeTransition ft = new FadeTransition(Duration.millis(1500), login); ft.setFromValue(1.0); ft.setToValue(0); ft.setCycleCount(1); ft.play(); } }); JEConfig.PROGRAMM_INFO.setJEVisAPI(ds.getInfo()); JEConfig.PROGRAMM_INFO.addLibrary(org.jevis.commons.application.Info.INFO); JEConfig.PROGRAMM_INFO.addLibrary(org.jevis.application.Info.INFO); preLodedClasses = login.getAllClasses(); preLodedRootObjects = login.getRootObjects(); PluginManager pMan = new PluginManager(ds); //@AITBilal - Toolbar fr save, newB, delete, sep1, form GlobalToolBar toolbar = new GlobalToolBar(pMan); pMan.addPluginsByUserSetting(null); // StackPane root = new StackPane(); // root.setId("mainpane"); BorderPane border = new BorderPane(); VBox vbox = new VBox(); vbox.getChildren().addAll(new TopMenu(), toolbar.ToolBarFactory()); border.setTop(vbox); //@AITBilal - Alle Plugins Inhalt fr JEConfig (Resources... | System | Attribute) border.setCenter(pMan.getView()); Statusbar statusBar = new Statusbar(ds); border.setBottom(statusBar); System.out.println("show welcome"); //Disable GUI is StatusBar note an disconnect border.disableProperty().bind(statusBar.connectedProperty.not()); Platform.runLater(new Runnable() { @Override public void run() { AnchorPane.setTopAnchor(border, 0.0); AnchorPane.setRightAnchor(border, 0.0); AnchorPane.setLeftAnchor(border, 0.0); AnchorPane.setBottomAnchor(border, 0.0); jeconfigRoot.getChildren().setAll(border); // try { // WelcomePage welcome = new WelcomePage(primaryStage, new URI("http://coffee-project.eu/")); // WelcomePage welcome = new WelcomePage(primaryStage, new URI("http://openjevis.org/projects/openjevis/wiki/JEConfig3#JEConfig-Version-3")); // Task<Void> showWelcome = new Task<Void>() { // @Override // protected Void call() throws Exception { try { WelcomePage welcome = new WelcomePage(primaryStage, _config.getWelcomeURL()); } catch (URISyntaxException ex) { Logger.getLogger(JEConfig.class.getName()).log(Level.SEVERE, null, ex); } catch (MalformedURLException ex) { Logger.getLogger(JEConfig.class.getName()).log(Level.SEVERE, null, ex); } // return null; // } // }; // new Thread(showWelcome).start(); // WelcomePage welcome = new WelcomePage(primaryStage, _config.getWelcomeURL()); // } catch (URISyntaxException ex) { // Logger.getLogger(JEConfig.class.getName()).log(Level.SEVERE, null, ex); // } catch (MalformedURLException ex) { // Logger.getLogger(JEConfig.class.getName()).log(Level.SEVERE, null, ex); // } } }); } } }); AnchorPane.setTopAnchor(login, 0.0); AnchorPane.setRightAnchor(login, 0.0); AnchorPane.setLeftAnchor(login, 0.0); AnchorPane.setBottomAnchor(login, 0.0); //@AITBilal - Login Dialog scene = new Scene(jeconfigRoot, bounds.getWidth(), bounds.getHeight()); scene.getStylesheets().add("/styles/Styles.css"); primaryStage.getIcons().add(getImage("1393354629_Config-Tools.png")); primaryStage.setTitle("JEConfig"); primaryStage.setScene(scene); maximize(primaryStage); primaryStage.show(); // Platform.runLater(new Runnable() { // @Override // public void run() { //@AITBilal - Inhalt bzw. die Elemente von LoginDialog jeconfigRoot.getChildren().setAll(login); // } // }); primaryStage.onCloseRequestProperty().addListener(new ChangeListener<EventHandler<WindowEvent>>() { @Override public void changed(ObservableValue<? extends EventHandler<WindowEvent>> ov, EventHandler<WindowEvent> t, EventHandler<WindowEvent> t1) { try { System.out.println("Disconnect"); ds.disconnect(); } catch (JEVisException ex) { Logger.getLogger(JEConfig.class.getName()).log(Level.SEVERE, null, ex); } } }); }