Example usage for javafx.scene.layout StackPane setId

List of usage examples for javafx.scene.layout StackPane setId

Introduction

In this page you can find the example usage for javafx.scene.layout StackPane setId.

Prototype

public final void setId(String value) 

Source Link

Usage

From source file:org.jevis.jeconfig.JEConfig.java

/**
 * Build an new JEConfig Login and main frame/stage
 *
 * @param primaryStage//  w  ww . j a  va 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);
            }
        }
    });

}