Package javafx.scene.layout

Examples of javafx.scene.layout.HBox


                        .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());
View Full Code Here


        Button failButton = new Button("FAIL");
        failButton.setOnAction((ActionEvent t) -> {
            indicator.setPass(Boolean.FALSE);
        });
       
        HBox box = new HBox(passButton, indetermindedButton, failButton);
       
        AnchorPane root = new AnchorPane();
        AnchorPane.setTopAnchor(indicator, 10.0);
        AnchorPane.setTopAnchor(box, 230.0);
       
View Full Code Here

        primaryStage.show();
        console.appendText("Program started.\n");
    }

    private HBox addTopHBox() {
        HBox hbox = new HBox();
        hbox.setPadding(new Insets(15, 12, 15, 12));
        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);

        return hbox;
       
    }
View Full Code Here

       
        return vbox;
    }
   
    private HBox addCenterHBox() {
        HBox hbox = new HBox();
        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

   
    final VBox problemParameters = new VBox(2);
    problemParameters.setPadding(new Insets(0, 0, 4, 0));
    refreshParameters(jcgp.getProblem().getLocalParameters(), problemParameters);
   
    final HBox testCaseControlContainer = new HBox(2);
   
    final Button showTestCaseButton = makeTestCaseButton();
    final Button loadProblemDataButton = makeLoadTestCaseButton();
    HBox.setHgrow(showTestCaseButton, Priority.ALWAYS);
    showTestCaseButton.setMaxWidth(Double.MAX_VALUE);
    HBox.setHgrow(loadProblemDataButton, Priority.ALWAYS);
    loadProblemDataButton.setMaxWidth(Double.MAX_VALUE);
   
    if (jcgp.getProblem() instanceof TestCaseProblem<?>) {
      testCaseControlContainer.getChildren().addAll(showTestCaseButton, loadProblemDataButton);
      remakeTestCaseTable();
    } else {
      testCaseControlContainer.getChildren().add(loadProblemDataButton);
    }
   
    nodeFunctions = new VBox(2);
    nodeFunctions.setPadding(new Insets(0, 0, 4, 0));
    refreshFunctions();
   
    problemCBox.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        jcgp.setProblem(problemCBox.getSelectionModel().getSelectedIndex());
        updateArity();
        refreshParameters(jcgp.getProblem().getLocalParameters(), problemParameters);
        if (testCaseTable != null) {
          testCaseTable.close();
        }
        gui.setEvaluating(false);
        refreshFunctions();
        testCaseControlContainer.getChildren().clear();
        if (jcgp.getProblem() instanceof TestCaseProblem) {
          testCaseControlContainer.getChildren().addAll(showTestCaseButton, loadProblemDataButton);
          remakeTestCaseTable();
        } else {
          testCaseControlContainer.getChildren().add(loadProblemDataButton);
        }
        gui.reset();
      }
    });
   
View Full Code Here

    header.setUnderline(true);
   
    final VBox controls = new VBox(2);
    controls.setFillWidth(true);
   
    final HBox flowButtons = new HBox(2);
    runPause.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {       
        gui.runPause();
      }
    });
   
    step.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        gui.step();
      }
    });
   
    reset.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        gui.reset();
      }
    });
   
    HBox.setHgrow(runPause, Priority.ALWAYS);
    runPause.setMaxWidth(Double.MAX_VALUE);
    HBox.setHgrow(step, Priority.ALWAYS);
    step.setMaxWidth(Double.MAX_VALUE);
    HBox.setHgrow(reset, Priority.ALWAYS);
    reset.setMaxWidth(Double.MAX_VALUE);
   
    flowButtons.getChildren().addAll(runPause, step, reset);
    flowButtons.setPadding(new Insets(0, 0, 10, 0));
   
    loadParameters.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {       
        FileChooser fc = new FileChooser();
View Full Code Here

    RadioButton numberOfPlayers3 = new RadioButton("3");
    numberOfPlayers3.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    numberOfPlayers3.setUserData(3);
    numberOfPlayers3.setToggleGroup(numberOfPlayers);

    HBox numberOfPlayersButtons = new HBox();
    numberOfPlayersButtons.setAlignment(Pos.CENTER);
    numberOfPlayersButtons.getChildren().addAll(numberOfPlayers1,
            numberOfPlayers2, numberOfPlayers3);

    Line horizontalLine1 = new Line();
    horizontalLine1.setEndX(480);
    horizontalLine1.setStroke(Color.GRAY);
    horizontalLine1.setStrokeWidth(2);

    Label worldCreationLabel = new Label("CREATION OF THE WORLD");
    worldCreationLabel.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_16));
    worldCreationLabel.setTextFill(Color.LIGHTGRAY);

    worldCreation = new ToggleGroup();

    RadioButton worldCreation1 = new RadioButton("1");
    worldCreation1.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    worldCreation1.setSelected(true);
    worldCreation1.setUserData(new FlatLandWorldGenerator(0.15));
    worldCreation1.setToggleGroup(worldCreation);
    worldCreation1.setMinWidth(120);
    worldCreation1.setMaxWidth(120);

    RadioButton worldCreation2 = new RadioButton("2");
    worldCreation2.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    worldCreation2.setUserData(new FlatLandWorldGenerator(0.3));
    worldCreation2.setToggleGroup(worldCreation);
    worldCreation2.setMinWidth(120);
    worldCreation2.setMaxWidth(120);

    RadioButton worldCreation3 = new RadioButton("3");
    worldCreation3.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    worldCreation3.setUserData(new FlatLandWorldGenerator(0.45));
    worldCreation3.setToggleGroup(worldCreation);
    worldCreation3.setMinWidth(120);
    worldCreation3.setMaxWidth(120);

    RadioButton worldCreation4 = new RadioButton("4");
    worldCreation4.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    worldCreation4.setUserData(new FlatLandWorldGenerator(0.6));
    worldCreation4.setToggleGroup(worldCreation);
    worldCreation4.setMinWidth(120);
    worldCreation4.setMaxWidth(120);

    RadioButton worldCreation5 = new RadioButton("5");
    worldCreation5.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    worldCreation5.setUserData(new FlatLandWorldGenerator(0.75));
    worldCreation5.setToggleGroup(worldCreation);

    HBox worldCreationButtons = new HBox();
    worldCreationButtons.setAlignment(Pos.CENTER);
    worldCreationButtons.getChildren().addAll(worldCreation1, worldCreation2,
            worldCreation3, worldCreation4, worldCreation5);

    Line horizontalLine2 = new Line();
    horizontalLine2.setEndX(480);
    horizontalLine2.setStroke(Color.GRAY);
    horizontalLine2.setStrokeWidth(2);

    Label gameLevelLabel = new Label("GAME LEVEL");
    gameLevelLabel.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_16));
    gameLevelLabel.setTextFill(Color.LIGHTGRAY);

    gameLevel = new ToggleGroup();

    RadioButton gameLevel1 = new RadioButton("BEGINNER");
    gameLevel1.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    gameLevel1.setUserData(Game.Difficulty.BEGINNER);
    gameLevel1.setToggleGroup(gameLevel);
    gameLevel1.setMinWidth(120);
    gameLevel1.setMaxWidth(120);

    RadioButton gameLevel2 = new RadioButton("NORMAL");
    gameLevel2.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    gameLevel2.setSelected(true);
    gameLevel2.setUserData(Game.Difficulty.NORMAL);
    gameLevel2.setToggleGroup(gameLevel);
    gameLevel2.setMinWidth(120);
    gameLevel2.setMaxWidth(120);

    RadioButton gameLevel3 = new RadioButton("ADVANCED");
    gameLevel3.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_13));
    gameLevel3.setUserData(Game.Difficulty.ADVANCED);
    gameLevel3.setToggleGroup(gameLevel);

    HBox gameLevelButtons = new HBox();
    gameLevelButtons.setAlignment(Pos.CENTER);
    gameLevelButtons.getChildren().addAll(gameLevel1, gameLevel2, gameLevel3);

    Button startNewGame = new Button("NEW GAME");
    VBox.setMargin(startNewGame, new Insets(25, 0, 0, 0));
    startNewGame.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_16));
    startNewGame.setCursor(Cursor.HAND);
View Full Code Here

        Button failButton = new Button("FAIL");
        failButton.setOnAction((ActionEvent t) -> {
            indicator.setPass(Boolean.FALSE);
        });
       
        HBox box = new HBox(passButton, failButton);
       
        AnchorPane root = new AnchorPane();
        AnchorPane.setTopAnchor(indicator, 10.0);
        AnchorPane.setTopAnchor(segmentedButton, 150.0);
        AnchorPane.setTopAnchor(box, 230.0);
View Full Code Here

        progressBar = new ProgressBar(0.0);
        progressBar.setPrefWidth(50.0);
        progressBar.setPrefHeight(15.0);
        progressBar.setMinHeight(15.0);

        HBox updateBox = new HBox(updateStatusLabel, progressBar);
        updateBox.setAlignment(Pos.CENTER_RIGHT);
        updateBox.setSpacing(5.0);
        AnchorPane.setTopAnchor(updateBox, 5.0);
        AnchorPane.setRightAnchor(updateBox, 5.0);

        anchorPane = new AnchorPane();
        anchorPane.getStyleClass().add("app-list-cell");
        anchorPane.setPrefWidth(400.0);
        anchorPane.setPrefHeight(60.0);

        anchorPane.getChildren().addAll(appNameLabel, versionLabel, statusLabel, applicationActionMenuButton,
                statusIndicator, progressIndicator, updateBox);

        progressBar.progressProperty().bind(updateAppService.progressProperty());
        updateStatusLabel.textProperty().bind(updateAppService.messageProperty());
        updateBox.visibleProperty().bind(updateAppService.runningProperty());
        applicationActionMenuButton.visibleProperty().bind(updateAppService.runningProperty().not());
        applicationActionMenuButton.disableProperty().bind(domainDataModel.domainRunningProperty().not());
        statusLabel.visibleProperty().bind(updateAppService.runningProperty().not());
        versionLabel.visibleProperty().bind(updateAppService.runningProperty().not());
    }
View Full Code Here

        final TextField barcodeText = new TextField(user.getBarcode());
        barcodeText.setEditable(false);
        barcodeText.addEventFilter(InputEvent.ANY, event -> user.setBarcode(barcodeText.getText()));

        final HBox hBox = new HBox(
                new Label("Мастер:"),
                userNameText,
                new Label("Код:"),
                barcodeText
        );
        hBox.setSpacing(10);
        hBox.setAlignment(Pos.CENTER_LEFT);
        hBox.setUserData(user);

        final Button deleteButton = new Button("Удалить");
        deleteButton.setOnAction(event -> {
            userRepository.delete(user);
            userList.getItems().remove(hBox);
        });
        hBox.getChildren().add(deleteButton);

        userList.getItems().add(hBox);
    }
View Full Code Here

TOP

Related Classes of javafx.scene.layout.HBox

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.