Package javafx.scene.layout

Examples of javafx.scene.layout.VBox


public class App extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {

        VBox root = new VBox();
        root.setSpacing(10.0);

        Label githubLabel = AwesomeDude.createIconLabel(AwesomeIcon.GITHUB);
        Label ambulanceLabel = AwesomeDude.createIconLabel(AwesomeIcon.PLUS_SQUARE_ALT, "60.0");
        Button starButton = AwesomeDude.createIconButton(AwesomeIcon.STAR, "Nice!", "48.0", "20.0", ContentDisplay.TOP);
        Button cloudButton = AwesomeDude.createIconButton(AwesomeIcon.CLOUD, "Download");
        ToggleButton toggleButton = AwesomeDude.createIconToggleButton(AwesomeIcon.LOCK, "Lock", "60.0", ContentDisplay.TOP);

        Region stackedIcon1 = AwesomeIconsStack.create().add(Icon.create());

        Region stackedIcon2 = AwesomeIconsStack.create()
                .add(Icon.create()
                        .icon(AwesomeIcon.SQUARE)
                        .size("3em")
                        .styleClass("stack-base"))
                .add(Icon.create()
                        .icon(AwesomeIcon.STAR)
                        .size("2em")
                        .styleClass("stack-top")
                );

        Region stackedIcon3 = AwesomeIconsStack.create()
                .add(Icon.create()
                        .icon(AwesomeIcon.SQUARE)
                        .style("-fx-font-size: 4em; -fx-text-fill: yellowgreen;"))
                .add(Icon.create()
                        .icon(AwesomeIcon.APPLE)
                        .style("-fx-font-size: 3em; -fx-text-fill: white;")
                );

        Region stackedIcon4 = AwesomeIconsStack.create()
                .add(Icon.create()
                        .icon(AwesomeIcon.SQUARE)
                        .style("-fx-font-size: 4em; -fx-text-fill: yellowgreen;"))
                .add(Icon.create()
                        .icon(AwesomeIcon.APPLE)
                        .style("-fx-font-size: 3em; -fx-text-fill: black;")
                );

        Region stackedIcon5 = AwesomeIconsStack.create()
                .add(Icon.create()
                        .icon(AwesomeIcon.BUG)
                        .style("-fx-font-size: 2em; -fx-text-fill: black;"))
                .add(Icon.create()
                        .icon(AwesomeIcon.BAN)
                        .style("-fx-font-size: 4em; -fx-text-fill: red; -fx-opacity: 0.5;")
                );

        Region stackedIcon6 = AwesomeIconsStack.create()
                .add(Icon.create()
                        .icon(AwesomeIcon.CIRCLE)
                        .style("-fx-font-size: 8em; -fx-text-fill: linear-gradient(#70b4e5 0%, #247cbc 70%, #2c85c1 85%);"))
                .add(Icon.create()
                        .icon(AwesomeIcon.TWITTER)
                        .style("-fx-font-size: 4em; -fx-text-fill: white;")
                );

        Region stackedIcon7 = AwesomeIconsStack.create()
                .add(Icon.create()
                        .icon(AwesomeIcon.CIRCLE)
                        .style("-fx-font-size: 12em; -fx-text-fill: linear-gradient(#70b4e5 0%, #247cbc 70%, #2c85c1 85%);"))
                .add(Icon.create()
                        .icon(AwesomeIcon.BITBUCKET)
                        .style("-fx-font-size: 6em; "
                                + "-fx-text-fill: linear-gradient(#ffffff, #d2d2d2); "
                                + "-fx-effect: dropshadow( one-pass-box , rgba(0,0,0,0.8) , 4 , 0.0 , 1 , 1 );")
                );

        HBox stackIconBox = new HBox();
        stackIconBox.setSpacing(5.0);
        stackIconBox.setPadding(new Insets(10.0));
        stackIconBox.getChildren().addAll(stackedIcon1, stackedIcon2, stackedIcon3, stackedIcon4, stackedIcon5, stackedIcon6, stackedIcon7);

        Region iconStack1 = AwesomeIconsStack.create()
                .add(Icon.create()
                        .icon(AwesomeIcon.CIRCLE)
                        .style("-fx-font-size: 12em; -fx-text-fill: linear-gradient(#70b4e5 0%, #247cbc 70%, #2c85c1 85%);"))
                .add(Icon.create()
                        .icon(AwesomeIcon.BITBUCKET)
                        .style("-fx-font-size: 6em; "
                                + "-fx-text-fill: linear-gradient(#ffffff 0%, #d2d2d2); "
                                + "-fx-effect: dropshadow( one-pass-box , rgba(0,0,0,0.8) , 4 , 0.0 , 1 , 1 );"))
                .add(new Icon(AwesomeIcon.BAN, null, "-fx-font-size: 12em; -fx-text-fill: red; -fx-opacity: 0.5;", null));

        HBox stackIconBox2 = new HBox();
        stackIconBox2.setSpacing(5.0);
        stackIconBox2.setPadding(new Insets(10.0));
        stackIconBox2.getChildren().addAll(iconStack1);

        root.getChildren().addAll(createMenubar(), githubLabel, ambulanceLabel, starButton, cloudButton, toggleButton, stackIconBox, stackIconBox2);

        Scene scene = new Scene(root, 500, 800);
        scene.getStylesheets().addAll(AwesomeStyle.PLAIN.getStylePath());

        primaryStage.setScene(scene);
View Full Code Here


    return this.scrollPane;
  }
 
  private VBox getNodeParent() {
    if (this.vBox == null) {
      this.vBox = new VBox();
      this.vBox.setFillWidth(true);
    }
    return this.vBox;
  }
View Full Code Here

public class App extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {

        VBox root = new VBox();

        Label githubLabel = AwesomeDude.createIconLabel(AwesomeIcon.GITHUB);
        Label ambulanceLabel = AwesomeDude.createIconLabel(AwesomeIcon.AMBULANCE, "60.0");
        Button starButton = AwesomeDude.createIconButton(AwesomeIcon.STAR, "Nice!", "48.0", "20.0", ContentDisplay.TOP);
        Button cloudButton = AwesomeDude.createIconButton(AwesomeIcon.CLOUD, "Download");
        ToggleButton toggleButton = AwesomeDude.createIconToggleButton(AwesomeIcon.LOCK, "Lock", "60.0", ContentDisplay.TOP);

        root.getChildren().addAll(createMenubar(), githubLabel, ambulanceLabel, starButton, cloudButton, toggleButton);

        Scene scene = new Scene(root, 500, 500);
        //scene.getStylesheets().addAll(AwesomeStyle.BLUE.getStylePath());

View Full Code Here

        hbox.setSpacing(10);
        hbox.setStyle(
                "-fx-background-color:\n"
                + "linear-gradient(#e5eaeb 0%, #bac4c9 100%)\n");

        VBox textVBox = new VBox();
        Text welcome = new Text("Luj Komandor");
        welcome.setFont(Font.font("Arial", 24));
        Text info = new Text("Luj Szperacz control application");
        info.setFont(Font.font("Arial", 11));
        textVBox.getChildren().addAll(welcome, info);

        ImageView imageTop = new ImageView(new Image(getClass().getResourceAsStream("/images/koprobo.png")));

        hbox.getChildren().addAll(imageTop, textVBox);
View Full Code Here

        return hbox;
       
    }
   
    private VBox addBottomVBox() {
        VBox vbox = new VBox();
        vbox.setStyle("-fx-background-color: #bac4c9;");
       
        console = new TextArea();
        Text caption = new Text("Console:");
        vbox.getChildren().addAll(caption, console);
       
        return vbox;
    }
View Full Code Here

        hbox.setPadding(new Insets(15, 12, 15, 12));
        hbox.setSpacing(10);
        hbox.setStyle("-fx-background-color: #bac4c9;");
       
        // SETTINGS
        VBox settings = new VBox();     
        settings.setSpacing(5);
       
        Text settingsTitle = new Text("Settings");
        Text settingsGamepad = new Text("Gamepad settings");
        Text settingsConnection = new Text("Connection settings");
        settingsTitle.setFont(Font.font("Arial", 18));
        settingsGamepad.setFont(Font.font("Arial", 13));
        settingsConnection.setFont(Font.font("Arial", 13));
       
        gamepadSelect = new ComboBox();
        connectButton = new Button("Connect");
       
        connectButton.setOnAction(new EventHandler<ActionEvent>() {
            @Override public void handle(ActionEvent e) {
                if(socketThread != null) {
                    if(socketThread.isAlive()) {
                        connectButton.setText("Connect");
                        try {
                            lujSocket.terminate();
                            socketThread.join();
                            console.appendText("Disconnected. Socket thread " + socketThread.toString() + " terminated successfully.\n");
                            socketThread = null;
                        } catch (InterruptedException ex) {
                            Logger.getLogger(LujKomandor.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    }
                    } else {
                        if(lujSocket.connect())
                        {
                            connectButton.setText("Disconnect");
                            socketThread = new Thread(lujSocket);
                            lujSocket.start();
                            socketThread.start();
                            console.appendText("Connected successfully. Socket thread " + socketThread.toString() + " started.\n");
                        } else
                            console.appendText("Cannot connect to Luj Szperacz.\n");

                    }
            }
        });
        // CONTROL
        VBox control = new VBox();
        control.setSpacing(5);
       
        Text controlTitle = new Text("Control");
        controlTitle.setFont(Font.font("Arial", 18));
       
       
       
        // STATUS
        VBox status = new VBox();
        status.setSpacing(5);
       
        Text statusTitle = new Text("Status");
        statusTitle.setFont(Font.font("Arial", 18));
       
        Text statusPadXAxisCaption = new Text("Gamepad X Axis");
        Text statusPadYAxisCaption = new Text("Gamepad Y Axis");
        Text statusPiTempCaption = new Text("RPi CPU Temperature");
        Text statusOutsideTempCaption = new Text("Outside Temperature");
        Text statusBatteryVoltageCaption = new Text("Battery Voltage");
        statusPadXAxisCaption.setFont(Font.font("Arial", 14));
        statusPadYAxisCaption.setFont(Font.font("Arial", 14));
        statusPiTempCaption.setFont(Font.font("Arial", 14));
        statusOutsideTempCaption.setFont(Font.font("Arial", 14));
        statusBatteryVoltageCaption.setFont(Font.font("Arial", 14));
       
        Text statusPadXAxis = new Text("Settings");
        Text statusPadYAxis = new Text("Settings");
        Text statusPiTemp = new Text("Gamepad settings");
        Text statusOutsideTemp = new Text("Connection settings");
        Text statusBatteryVoltage = new Text("Connection settings");
       
        statusIndicators = new LinkedList<Text>();
       
        statusIndicators.add(statusPadXAxis);
        statusIndicators.add(statusPadYAxis);
        statusIndicators.add(statusPiTemp);
        statusIndicators.add(statusOutsideTemp);
        statusIndicators.add(statusBatteryVoltage);
       
        for(Text t : statusIndicators)
            t.setFont(Font.font("Arial", 11));
       
        SensorsUpdater sensorsUpdater = new SensorsUpdater(statusIndicators, lujSocket);
        sensorsUpdaterThread = new Thread(sensorsUpdater);
        sensorsUpdater.start();
        sensorsUpdaterThread.start();
       
       
       
       
        settings.getChildren().addAll(settingsTitle, settingsGamepad, gamepadSelect, settingsConnection, connectButton);
        control.getChildren().addAll(controlTitle);
        status.getChildren().addAll(statusTitle, statusPadXAxisCaption, statusPadXAxis, statusPadYAxisCaption, statusPadYAxis, statusPiTempCaption, statusPiTemp, statusOutsideTempCaption, statusOutsideTemp, statusBatteryVoltageCaption, statusBatteryVoltage);
       
        hbox.getChildren().addAll(settings, control, status);
       
        return hbox;
    }
View Full Code Here

   
    // acquire a reference to jcgp, for convenience
    final JCGP jcgp = gui.getExperiment();
   
    // make the overarching container
    mainContainer = new VBox(8);
    mainContainer.setPadding(new Insets(5, Constants.RESIZE_MARGIN, 0, 2));
   
    setMinWidth(Constants.SETTINGS_MIN_WIDTH);
    setPrefWidth(Constants.SETTINGS_MIN_WIDTH);
   
View Full Code Here

   * Creates the base parameters pane
   *
   * @param jcgp
   */
  private void initialiseBaseParameters(JCGP jcgp) {
    baseParameterPane = new VBox(2);
   
    Text header = new Text("Base Parameters");
    header.setFont(Font.font("Arial", 14));
    header.setUnderline(true);
   
View Full Code Here

    baseParameterPane.getChildren().addAll(parameters);
    mainContainer.getChildren().add(baseParameterPane);
  }

  private void initialiseEAParameters(final JCGP jcgp) {
    eaPane = new VBox(2);
   
    Text header = new Text("Evolutionary Strategy");
    header.setFont(Font.font("Arial", 14));
    header.setUnderline(true);
   
    final ComboBox<EvolutionaryStrategy> esCBox = new ComboBox<EvolutionaryStrategy>();
    esCBox.getItems().addAll(jcgp.getEvolutionaryStrategies());
    esCBox.getSelectionModel().select(jcgp.getEvolutionaryStrategy());
    esCBox.prefWidthProperty().bind(mainContainer.widthProperty());
   
    final VBox eaParameters = new VBox(2);
   
    refreshParameters(jcgp.getEvolutionaryStrategy().getLocalParameters(), eaParameters);
   
    esCBox.setOnAction(new EventHandler<ActionEvent>() {
      @Override
View Full Code Here

    eaPane.getChildren().addAll(header, esCBox, eaParameters)
    mainContainer.getChildren().add(eaPane);
  }

  private void initialiseMutatorParameters(final JCGP jcgp) {
    mutatorPane = new VBox(2);
   
    Text header = new Text("Mutator");
    header.setFont(Font.font("Arial", 14));
    header.setUnderline(true);
   
    final ComboBox<Mutator> mutatorCBox = new ComboBox<Mutator>();
    mutatorCBox.getItems().addAll(jcgp.getMutators());
    mutatorCBox.getSelectionModel().select(jcgp.getMutator());
    mutatorCBox.prefWidthProperty().bind(mainContainer.widthProperty());
   
    final VBox mutatorParameters = new VBox(2);
    refreshParameters(jcgp.getMutator().getLocalParameters(), mutatorParameters);
   
    mutatorCBox.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
View Full Code Here

TOP

Related Classes of javafx.scene.layout.VBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.