List of usage examples for javafx.scene.layout AnchorPane setRightAnchor
public static void setRightAnchor(Node child, Double value)
From source file:org.jevis.jeconfig.JEConfig.java
/** * Build an new JEConfig Login and main frame/stage * * @param primaryStage//from w w w . jav a 2 s . c om */ //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); } } }); }
From source file:org.noroomattheinn.visibletesla.LocationController.java
@Override protected void fxInitialize() { engine = webView.getEngine();/*w w w .j av a 2s. com*/ progressIndicator.setVisible(false); multigauge = new MultiGauge(25, 8, 0, 100, -60, 320); multigauge.useGradient(Side.RIGHT, Color.DARKORANGE, Color.GREEN); multigauge.useGradient(Side.LEFT, Color.BLUE, Color.BLUE); multigauge.setLogScale(Side.RIGHT, true); Node mg = multigauge.getContainer(); AnchorPane.setTopAnchor(mg, 25.0); AnchorPane.setRightAnchor(mg, 10.0); root.getChildren().add(2, mg); multigauge.setVal(Side.LEFT, 20); multigauge.setVal(Side.RIGHT, 40); }
From source file:pl.baczkowicz.mqttspy.ui.controllers.NewPublicationController.java
private void updateVisibility() { if (detailedView) { AnchorPane.setRightAnchor(publicationTopicText, 327.0); AnchorPane.setRightAnchor(publicationData, 326.0); AnchorPane.setTopAnchor(dataLabel, 31.0); } else {/*from www . ja v a2 s . co m*/ AnchorPane.setRightAnchor(publicationTopicText, 128.0); AnchorPane.setRightAnchor(publicationData, 127.0); AnchorPane.setTopAnchor(dataLabel, 37.0); } formatMenu.setVisible(detailedView); publicationQosChoice.setVisible(detailedView); publicationQosLabel.setVisible(detailedView); retainedBox.setVisible(detailedView); retainedLabel.setVisible(detailedView); lengthLabel.setVisible(detailedView); // TODO: basic perspective }
From source file:pl.baczkowicz.mqttspy.ui.NewPublicationController.java
private void updateVisibility() { if (detailedView) { AnchorPane.setRightAnchor(publicationTopicText, 327.0); publicationQosChoice.setVisible(true); publicationQosLabel.setVisible(true); retainedBox.setVisible(true);//from w w w.j a v a 2 s . co m retainedLabel.setVisible(true); } else { AnchorPane.setRightAnchor(publicationTopicText, 128.0); publicationQosChoice.setVisible(false); publicationQosLabel.setVisible(false); retainedBox.setVisible(false); retainedLabel.setVisible(false); } }