Package javafx.scene.layout

Examples of javafx.scene.layout.HBox


    UISession.getMediaView().setFitWidth(1);
    UISession.getMediaView().setFitHeight(1);
    UISession.getMediaView().setPreserveRatio(false);

    final VBox vbox = new VBox();
    final HBox hbox = new HBox(2);
    final int bands = UISession.getMediaPlayer().getAudioSpectrumNumBands() - 20;
    final Rectangle[] rects = new Rectangle[bands];
    for (int i = 0; i < rects.length; i++) {
      rects[i] = new Rectangle();
      rects[i].getTransforms().add(new Rotate(180, 0, 0)); //
      rects[i].setFill(Color.GRAY);
      rects[i].setArcHeight(screenHeight);
      hbox.getChildren().add(rects[i]);

    }

    final Text durationLabel = new Text(25, 25, MediaUtils.activeInfo);
    durationLabel.setFill(Color.WHITESMOKE);
    durationLabel.setFont(Font.font(java.awt.Font.SANS_SERIF, 25));
    final DropShadow ds = new DropShadow();
    ds.setOffsetY(3.0f);
    ds.setColor(Color.BLACK);

    durationLabel.setEffect(ds);

    vbox.getChildren().add(hbox);
    root.getChildren().add(UISession.getMediaView());
    root.getChildren().add(vbox);

    root.getChildren().add(durationLabel);
    durationLabel.setTranslateX(-25);
    vbox.setMaxWidth(screenWidth);

    hbox.setTranslateY(translatLocation);
    final Scene scene = new Scene(root, screenWidth, screenHeight,
        Color.rgb(35, 35, 35));
    hbox.setMinWidth(screenWidth);
    final int bandWidth = screenWidth / rects.length;
    int recheight = 2;
    for (final Rectangle r : rects) {
      recheight++;
      r.setWidth(bandWidth);
View Full Code Here


    GridPane.setVgrow(menuNewItemButton, Priority.ALWAYS);
    GridPane.setVgrow(menuRemoveItemButton, Priority.NEVER);
    final StackPane textStack = new StackPane();
    textStack.setAlignment(Pos.BOTTOM_RIGHT);
    textStack.getChildren().addAll(textField, menuButton);
    final HBox textBox = new HBox(2d);
    textBox.getChildren().addAll(textStack, editMenu);
      getChildren().addAll(textBox);
  }
View Full Code Here

    final Gauge gaugeRegion3 = createRegionKnob(Color.RED,
        gauge.intensityIndicatorRegionsProperty.getValue().getColor3SpanPercentage());
    addIntensityChangeListener(gauge, gaugeRegion1, gaugeRegion2, gaugeRegion3, 0);
    addIntensityChangeListener(gauge, gaugeRegion2, gaugeRegion1, gaugeRegion3, 1);
    addIntensityChangeListener(gauge, gaugeRegion3, gaugeRegion1, gaugeRegion2, 2);
    final HBox gaugeIntensitySliders = new HBox(5d);
    gaugeIntensitySliders.getChildren().addAll(gaugeRegion1, gaugeRegion2, gaugeRegion3);
    final VBox col1 = new VBox();
    col1.getChildren().addAll(gauge, gaugeIntensitySliders);
   
    final Gauge gauge2 = new Gauge(IndicatorType.NEEDLE, 0.5d, 1d, null, -2, 45d, 90d, 5, 0);
    gauge2.setTickValue(0);
    final Gauge gauge4 = new Gauge(IndicatorType.NEEDLE, 0.5d, 1d, "%03d", 2, 135d, 90d, 9, 4);
    final VBox col2 = new VBox();
    col2.getChildren().addAll(gauge2, gauge4);

    final Gauge gauge5 = new Gauge(IndicatorType.KNOB, 1d, 1d, "%04.2f", 0, 0d, 360d, 20, 0);
    gauge5.setTickValue(11.5d);
    final VBox col3 = new VBox();
    col3.getChildren().addAll(gauge5);
   
    final HBox row1 = new HBox();
    row1.getChildren().addAll(col1, col2, col3);
   
    final HBox row2 = new HBox();
    final Gauge gauge3 = new Gauge(IndicatorType.NEEDLE, 0.5d, 0.5d, "%04.2f", 0, 0d, 360d, 20, 1);
    final Gauge gauge6 = new Gauge(IndicatorType.NEEDLE, 0.5d, 1d, "%04.2f", 0, 250d, 310d, 10, 0);
    row2.getChildren().addAll(gauge3, gauge6);
   
    root.getItems().addAll(row1, row2);
    primaryStage.setScene(new Scene(root));
    primaryStage.show();
  }
View Full Code Here

  /**
   * @return the menu bar items related to the {@linkplain ControlBar}
   */
  public Region createTitleBarItems() {
    final HBox menu = new HBox(10d);
    menu.getStyleClass().add("title-bar-menu");
    menu.setAlignment(Pos.CENTER);
    menu.setPadding(new Insets(0, 50d, 0, 50d));
    final ImageView helpButton = RS.imgView(RS.IMG_HELP);
    final DropShadow effect = DropShadowBuilder.create().color(GuiUtil.COLOR_SELECTED).build();
    helpButton.setCursor(Cursor.HAND);
    helpButton.setEffect(effect);
    helpButton.addEventHandler(MouseEvent.ANY, new EventHandler<MouseEvent>() {
      @Override
      public void handle(final MouseEvent event) {
        if (event.getEventType() == MouseEvent.MOUSE_ENTERED) {
          effect.setColor(GuiUtil.COLOR_SELECTING);
        } else if (event.getEventType() == MouseEvent.MOUSE_EXITED) {
          effect.setColor(GuiUtil.COLOR_SELECTED);
        } else if (event.getEventType() == MouseEvent.MOUSE_CLICKED) {
          setHelpText(null);
        }
      }
    });
    menu.getChildren().addAll(helpButton, helpTextPane, cnctStatusWireless,
        cnctStatusWeb, cnctStatusEmail, defaultUserImg);
      return menu;
  }
View Full Code Here

    outerGlow.setColor(Color.ORANGERED);
    outerGlow.setRadius(10d);
        imageView.setEffect(outerGlow);
       
        // add the views
    valueView = new HBox();
    gaugeDigits.getStyleClass().add("gauge");
    gaugeDigits.setMaxHeight(imageView.getFitHeight());
    valueView.setAlignment(Pos.CENTER_LEFT);
        valueView.getChildren().addAll(imageView, gaugeDigits);
    if (orientation == null || orientation == Orientation.VERTICAL) {
View Full Code Here

//        }
//      }
//    });
     
      // title bar
      final HBox titleBar = new HBox();
      //titleBar.setStyle("-fx-background-color: black;");
      titleBar.setPrefHeight(TOP_BORDER_HEIGHT);
      titleBar.setMaxHeight(TOP_BORDER_HEIGHT);
      titleBar.setOnMousePressed(new EventHandler<MouseEvent>() {
            @Override public void handle(MouseEvent event) {
                mouseDragOffsetX = event.getSceneX();
                mouseDragOffsetY = event.getSceneY();
            }
        });
      titleBar.setOnMouseDragged(new EventHandler<MouseEvent>() {
            @Override public void handle(MouseEvent event) {
              if (!(event.getTarget() instanceof ImageView)) {
                    stage.setX(event.getScreenX() - mouseDragOffsetX);
                    stage.setY(event.getScreenY() - mouseDragOffsetY);
              }
            }
        });
        final Region titleBarLeft = new Region();
        titleBarLeft.setId("title-bar-left");
        titleBarLeft.setPrefWidth(TOP_LEFT_WIDTH);
        titleBarLeft.setMaxWidth(TOP_LEFT_WIDTH);
      titleBarCenter = new HBox(0);
      titleBarCenter.setId("title-bar");
      titleBarCenter.setAlignment(Pos.TOP_LEFT);
      updateTitleBarItems(titleBarItems);
        HBox.setHgrow(titleBarCenter, Priority.ALWAYS);
      final HBox titleBarRight = newMinMaxClose(stage);
      titleBarRight.setId("title-bar-right");
      titleBarRight.setPrefWidth(TOP_RIGHT_WIDTH);
        titleBarRight.setMaxWidth(TOP_RIGHT_WIDTH);
      //titleBarRight.getChildren().add(newMinMaxClose(stage, 0, TOP_BORDER_HEIGHT / 2 + TOP_MIN_MAX_CLOSE_Y));
        titleBar.getChildren().addAll(titleBarLeft, titleBarCenter, titleBarRight);
     
      final VBox leftBar = new VBox();
      leftBar.setId("border-left");
      leftBar.setPrefWidth(LEFT_BORDER_WIDTH);
      leftBar.setMaxWidth(LEFT_BORDER_WIDTH);
      leftBar.setTranslateX(1);
      Bindings.bindBidirectional(leftBar.translateYProperty(), content.translateYProperty());
      Bindings.bindBidirectional(leftBar.maxHeightProperty(), content.maxHeightProperty());
     
      final VBox rightBar = new VBox();
      rightBar.setId("border-right");
      rightBar.setPrefWidth(RIGHT_BORDER_WIDTH);
      rightBar.setMaxWidth(RIGHT_BORDER_WIDTH);
      Bindings.bindBidirectional(rightBar.translateYProperty(), content.translateYProperty());
      Bindings.bindBidirectional(rightBar.maxHeightProperty(), content.maxHeightProperty());
     
      final HBox statusBar = new HBox();
      //statusBar.setStyle("-fx-background-color: black;");
      statusBar.setPrefHeight(BOTTOM_BORDER_HEIGHT);
      statusBar.setMaxHeight(BOTTOM_BORDER_HEIGHT);
        final Region statusBarLeft = new Region();
        statusBarLeft.setId("status-bar-left");
        statusBarLeft.setPrefWidth(BOTTOM_LEFT_WIDTH);
        statusBarLeft.setMaxWidth(BOTTOM_LEFT_WIDTH);
      final Region statusBarCenter = new Region();
      statusBarCenter.setId("status-bar");
        HBox.setHgrow(statusBarCenter, Priority.ALWAYS);
      final HBox statusBarRight = new HBox();
      statusBarRight.setAlignment(Pos.BOTTOM_RIGHT);
      statusBarRight.setId("status-bar-right");
      statusBarRight.setPrefWidth(BOTTOM_RIGHT_WIDTH);
      statusBarRight.setMaxWidth(BOTTOM_RIGHT_WIDTH);
      if (isResizable) {
        final WindowReziseButton windowResizeButton = new WindowReziseButton(stage, this.getMinWidth(), this.getMinHeight());
        HBox.setMargin(windowResizeButton, new Insets(BOTTOM_BORDER_HEIGHT - 11, 0, 0, 0));
        statusBarRight.getChildren().addAll(windowResizeButton);
      }
        statusBar.getChildren().addAll(statusBarLeft, statusBarCenter, statusBarRight);
     
      // content adjustment
      stage.widthProperty().addListener(new InvalidationListener() {
View Full Code Here

        titleBarCenter.getChildren().setAll(titleBarItems);
      }
  }

  private HBox newMinMaxClose(final Stage stage) {
    final HBox box = new HBox(4);
    final ImageView minBtn = newTitleBarButton(RS.IMG_SKIN_MIN, 0.9, 0);
    minBtn.setOnMouseClicked(new EventHandler<MouseEvent>() {
      @Override
      public void handle(final MouseEvent event) {
        stage.setIconified(true);
      }
    });
    final ImageView maxBtn = newTitleBarButton(RS.IMG_SKIN_MAX, 0.9, 0);
    final Image maxImage = maxBtn.getImage();
    final Image resImage = RS.img(RS.IMG_SKIN_RESTORE);
    maxBtn.setOnMouseClicked(new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent event) {
                final double stageY = Utils.isMac() ? stage.getY() - 22 : stage.getY(); // TODO Workaround for RT-13980
                final Screen screen = Screen.getScreensForRectangle(stage.getX(), stageY, 1, 1).get(0);
                Rectangle2D bounds = screen.getVisualBounds();
                if (bounds.getMinX() == stage.getX() && bounds.getMinY() == stageY &&
                        bounds.getWidth() == stage.getWidth() && bounds.getHeight() == stage.getHeight()) {
                    if (backupWindowBounds != null) {
                        stage.setX(backupWindowBounds.getMinX());
                        stage.setY(backupWindowBounds.getMinY());
                        stage.setWidth(backupWindowBounds.getWidth());
                        stage.setHeight(backupWindowBounds.getHeight());
                        maxBtn.setImage(maxImage);
                    }
                } else {
                    backupWindowBounds = new Rectangle2D(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight());
                    final double newStageY = Utils.isMac() ? screen.getVisualBounds().getMinY() + 22 : screen.getVisualBounds().getMinY(); // TODO Workaround for RT-13980
                    stage.setX(screen.getVisualBounds().getMinX());
                    stage.setY(newStageY);
                    stage.setWidth(screen.getVisualBounds().getWidth());
                    stage.setHeight(screen.getVisualBounds().getHeight());
                    maxBtn.setImage(resImage);
                }
      }
    });
    final ImageView closeBtn = newTitleBarButton(RS.IMG_SKIN_CLOSE, 0.7, 0);
    closeBtn.setOnMouseClicked(new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent event) {
        Platform.exit();
      }
    });
    box.getChildren().addAll(minBtn, maxBtn, closeBtn);
    return box;
  }
View Full Code Here

        cal.setTime(newDate);
        populateData(chart, cal);
      }
    });

    final HBox dateBox = new HBox();
    dateBox.setAlignment(Pos.BOTTOM_RIGHT);
    dateBox.getChildren().addAll(dateField, simpleCalender);

    setPadding(new Insets(10d));
    setAlignment(Pos.BOTTOM_RIGHT);
    getChildren().addAll(chart, dateBox);
View Full Code Here

        FORMAT_DELAY, RS.IMG_STOPWATCH, GuiUtil.COLOR_LASER);
    controlBar.addHelpTextTrigger(laserTripRateGauge, RS.rbLabel(KEY.LASER_ALARM_DELAY_DESC));
    laserTripRateGauge.gauge.setIntensity(Color.TRANSPARENT, Color.TRANSPARENT, Color.TRANSPARENT);
    lp.getChildren().addAll(laserDelay, laserTripRateGauge);
   
    final HBox p = new HBox(CHILD_PADDING);
    p.setAlignment(Pos.CENTER);
    p.getChildren().addAll(sp, pp, mp, lp);
    final Parent cell = createCell(p);
    add(cell, columnIndex, rowIndex, 3, 1);
  }
View Full Code Here

    controlBar.addHelpTextTrigger(recipientAdd,
        RS.rbLabel(KEY.MAIL_ALARM_NOTIFY_EMAILS_ADD));
    final FunctionButton recipientRem = createRecipientRemovalBtn();
    controlBar.addHelpTextTrigger(recipientRem,
        RS.rbLabel(KEY.MAIL_ALARM_NOTIFY_EMAILS_REMOVE));
    final HBox recipientFuncBox = new HBox(5);
    recipientFuncBox.getChildren().addAll(recipient, recipientAdd,
        recipientRem);
    useSSL = new UGateToggleSwitchBox<>(controlBar.getActorPA(),
        ActorType.MAIL_USE_SSL, null, null,
        RS.rbLabel(KEY.MAIL_USE_SSL_ON),
        RS.rbLabel(KEY.MAIL_USE_SSL_OFF));
    controlBar.addHelpTextTrigger(useSSL,
        RS.rbLabel(KEY.MAIL_USE_SSL_DESC));
    useTLS = new UGateToggleSwitchBox<>(controlBar.getActorPA(),
        ActorType.MAIL_USE_TLS, null, null,
        RS.rbLabel(KEY.MAIL_USE_TLS_ON),
        RS.rbLabel(KEY.MAIL_USE_TLS_OFF));
    controlBar.addHelpTextTrigger(useTLS,
        RS.rbLabel(KEY.MAIL_USE_TLS_DESC));
    final HBox encryptBox = new HBox(5);
    encryptBox.getChildren().addAll(useSSL, useTLS);
    recipients = new UGateCtrlBox<>(controlBar.getActorPA(),
        ActorType.MAIL_RECIPIENTS, MailRecipientType.EMAIL,
        MailRecipient.class, RS.rbLabel(KEY.MAIL_ALARM_NOFITY_EMAILS),
        null, 100d, "", new String[] {}, String.class);
    controlBar.addHelpTextTrigger(recipients,
        RS.rbLabel(KEY.MAIL_ALARM_NOTIFY_EMAILS_DESC));

    listenForAppEvents(emailIcon);

    final HBox emailBtnView = new HBox();
    emailOnAtStartSwitch = new UGateToggleSwitchBox<>(
        controlBar.getActorPA(), ActorType.MAIL_ON_AT_COM_STARTUP,
        null, null, RS.rbLabel(KEY.APP_SERVICE_STARTUP_AUTO),
        RS.rbLabel(KEY.APP_SERVICE_STARTUP_MANUAL));
    controlBar.addHelpTextTrigger(emailOnAtStartSwitch,
        RS.rbLabel(KEY.APP_SERVICE_HOST_STARTUP_DESC));
    emailConnectBtn = new Button(RS.rbLabel(KEY.MAIL_CONNECT));
    cb.addServiceBehavior(emailConnectBtn, null,
        ServiceProvider.Type.EMAIL, KEY.MAIL_CONNECT_DESC);
    emailBtnView.getChildren()
        .addAll(emailConnectBtn, emailOnAtStartSwitch);

    final GridPane grid = new GridPane();
    grid.setHgap(10d);
    grid.setVgap(30d);
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.