Package javafx.scene.layout

Examples of javafx.scene.layout.VBox


    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);

      r.setHeight(recheight);
    }

    vbox.setMinSize(screenWidth, 100);

    vbox.setTranslateY(405 - 100);
    UISession.getMediaPlayer()
        .setAudioSpectrumListener(
            (v, v1, mags, floats1) -> {

              for (int i = 0; i < rects.length; i++) {
View Full Code Here


//        }
//      }
    if (remCnt != 0) {
      getChildren().clear();
    }
    VBox circleBox;
    Digit digit;
    char c;
    int d;
    Circle circle;
    for (int i=0; i<value.length(); i++) {
      c = value.charAt(i);
      if (remCnt != 0) {
        if (c == '.') {
          circleBox = new VBox();
          circleBox.setCache(true);
          circleBox.setCacheHint(CacheHint.SPEED);
          circleBox.setStyle("-fx-alignment: BOTTOM_LEFT;");
          circle = new Circle(0, 0, 6 * getScale(), onColor);
          circle.setCache(true);
          circle.setSmooth(false);
          circleBox.getChildren().add(circle);
          getChildren().add(circleBox);
        } else {
          d = c == '-' ? Digit.NEGATIVE_SIGN_DIGIT : Integer.valueOf(String.valueOf(c));
          digit = new Digit(getScale(), d, onColor, offColor);
          getChildren().add(digit);
View Full Code Here

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

            try {
            image = new Image(new FileInputStream(file));
          } catch (FileNotFoundException e1) {
            throw new RuntimeException(e1);
          }
            final VBox frame = new VBox(10);
            final ImageView imgView = new ImageView(image);
            frame.getStyleClass().add("displayshelfpopup");
            VBox.setMargin(imgView, new Insets(10, 10, 0, 10));
            final VBox info = new VBox();
            VBox.setMargin(info, new Insets(0, 10, 0, 10));
            final Text infoText = new Text(label.getText());
            infoText.setWrappingWidth(imgView.getImage().getWidth());
            info.setPrefHeight(imgView.getImage().getHeight() / 7);
            info.getChildren().add(infoText);
            frame.getChildren().addAll(imgView, info);
            final Popup popup = new Popup();
            popup.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
              @Override
              public void handle(MouseEvent event) {
View Full Code Here

      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() {
      @Override
      public void invalidated(Observable observable) {
        content.setMaxWidth(stage.getWidth() - content.getTranslateX() - RIGHT_BORDER_WIDTH);
        rightBar.setTranslateX(content.getMaxWidth() - RIGHT_BORDER_WIDTH);
      }
    });
      stage.heightProperty().addListener(new InvalidationListener() {
      @Override
      public void invalidated(Observable observable) {
View Full Code Here

    final Parent laserCell = createCell(laserThreshold, laserTripGauge);
    add(laserCell, ++ci, ri);
  }

  protected void addDelayChildren(final int columnIndex, final int rowIndex) {
    final VBox sp = new VBox();
    final Label sonarDelayLabel = createLabel(KEY.SONAR_ALARM_DELAY);
    final UGateGaugeBox<RemoteNode> sonarTripRateGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.SONAR_DELAY_BTWN_TRIPS, null,
        IndicatorType.NEEDLE, DELAY_SIZE_SCALE, 1d,
        RemoteNodeType.SONAR_DELAY_BTWN_TRIPS.getMin().intValue(), 0d, 180d,
        RemoteNodeType.SONAR_DELAY_BTWN_TRIPS.getMax().intValue() + 1, 0,
        FORMAT_DELAY, RS.IMG_STOPWATCH, GuiUtil.COLOR_SONAR);
    controlBar.addHelpTextTrigger(sonarTripRateGauge, RS.rbLabel(KEY.SONAR_ALARM_DELAY_DESC));
    sonarTripRateGauge.gauge.setIntensity(Color.TRANSPARENT, Color.TRANSPARENT, Color.TRANSPARENT);
    sp.getChildren().addAll(sonarDelayLabel, sonarTripRateGauge);

    final VBox pp = new VBox();
    final Label pirDelay = createLabel(KEY.PIR_ALARM_DELAY);
    final UGateGaugeBox<RemoteNode> pirTripRateGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.PIR_DELAY_BTWN_TRIPS, null,
        IndicatorType.NEEDLE, DELAY_SIZE_SCALE, 1d,
        RemoteNodeType.PIR_DELAY_BTWN_TRIPS.getMin().intValue(), 0d, 180d,
        RemoteNodeType.PIR_DELAY_BTWN_TRIPS.getMax().intValue() + 1, 0,
        FORMAT_DELAY, RS.IMG_STOPWATCH, GuiUtil.COLOR_PIR);
    controlBar.addHelpTextTrigger(pirTripRateGauge, RS.rbLabel(KEY.PIR_ALARM_DELAY_DESC));
    pirTripRateGauge.gauge.setIntensity(Color.TRANSPARENT, Color.TRANSPARENT, Color.TRANSPARENT);
    pp.getChildren().addAll(pirDelay, pirTripRateGauge);

    final VBox mp = new VBox();
    final Label mwDelay = createLabel(KEY.MW_ALARM_DELAY);
    final UGateGaugeBox<RemoteNode> mwTripRateGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.MW_DELAY_BTWN_TRIPS, null, IndicatorType.NEEDLE,
        DELAY_SIZE_SCALE, 1d,
        RemoteNodeType.MW_DELAY_BTWN_TRIPS.getMin().intValue(), 0d, 180d,
        RemoteNodeType.MW_DELAY_BTWN_TRIPS.getMax().intValue() + 1, 0, FORMAT_DELAY,
        RS.IMG_STOPWATCH, GuiUtil.COLOR_MW);
    controlBar.addHelpTextTrigger(mwTripRateGauge, RS.rbLabel(KEY.MW_ALARM_DELAY_DESC));
    mwTripRateGauge.gauge.setIntensity(Color.TRANSPARENT, Color.TRANSPARENT, Color.TRANSPARENT);
    mp.getChildren().addAll(mwDelay, mwTripRateGauge);

    final VBox lp = new VBox();
    final Label laserDelay = createLabel(KEY.LASER_ALARM_DELAY);
    final UGateGaugeBox<RemoteNode> laserTripRateGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.LASER_DELAY_BTWN_TRIPS, null,
        IndicatorType.NEEDLE, DELAY_SIZE_SCALE, 1d,
        RemoteNodeType.LASER_DELAY_BTWN_TRIPS.getMin().intValue(), 0d, 180d,
        RemoteNodeType.LASER_DELAY_BTWN_TRIPS.getMax().intValue() + 1, 0,
        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);
View Full Code Here

   *            the nodes to add to the side (when null, the group returned
   *            will be null)
   * @return the {@linkplain Parent}
   */
  public static Parent createCell(final Node... nodes) {
    final VBox view = new VBox();
    VBox.setVgrow(view, Priority.ALWAYS);
    view.getStyleClass().add("section-pane");
    view.getChildren().addAll(nodes);
    return view;
  }
View Full Code Here

    final GridPane grid = new GridPane();
    grid.setHgap(10d);
    grid.setVgap(30d);

    final VBox toggleView = new VBox(10d);
    toggleView.getChildren().addAll(emailIcon);

    final GridPane connectionGrid = new GridPane();
    connectionGrid.setPadding(new Insets(20d, 5, 5, 5));
    connectionGrid.setHgap(15d);
    connectionGrid.setVgap(15d);
View Full Code Here

  /**
   * Constructor of DatePicker class
   */
  public DatePicker(){
    super();
    VBox pickerBox = new VBox();
    setId("DatePicker");
    today = Calendar.getInstance();
    // Check whether Sunday is the first day of the week
    isSundayFirstDay = today.getFirstDayOfWeek() == 1 ? true : false;
    month = today.get(Calendar.MONTH);
    year = today.get(Calendar.YEAR);
    dateProperty = new SimpleObjectProperty<Date>((new GregorianCalendar()).getTime());
   
    // First block of the picker pane, which is constructed to show month and year and to change them by decreasing and increasing.
    HBox monthYearRow = new HBox();
    final Label monthYear = new Label(getMonthYear((new GregorianCalendar()).getTime()));
    monthYear.setMinHeight(CELL_HEIGHT * 1.5);
    monthYear.setMinWidth(CELL_WIDTH * 6.0);
    monthYear.setAlignment(Pos.CENTER);
    monthYearRow.getStyleClass().add(DATEPICKER_MONTHYEAR);
    Path decrementArrow = new Path();
    decrementArrow.setId(DATEPICKER_ARROW);
    decrementArrow.getElements().addAll(new MoveTo(0, ARROW_SIZE), new LineTo(0, -ARROW_SIZE),
        new LineTo(-ARROW_SIZE, 0), new LineTo(0, ARROW_SIZE));
    decrementArrow.setOnMouseClicked(new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent me) {
        month--;
        if(month < 0) {
          month = Calendar.DECEMBER;
          year--;
        }
        monthYear.setText(getMonthYear((new GregorianCalendar(year, month, 1)).getTime()));
        setDayCells();
        me.consume();
      }
    });
    Path inreamentArrow = new Path();
    inreamentArrow.setId(DATEPICKER_ARROW);
    inreamentArrow.getElements().addAll(new MoveTo(0, ARROW_SIZE), new LineTo(0, -ARROW_SIZE),
        new LineTo(ARROW_SIZE, 0), new LineTo(0, ARROW_SIZE));
    inreamentArrow.setOnMouseClicked(new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent me) {
        month++;
        if(month > Calendar.DECEMBER) {
          month = Calendar.JANUARY;
          year++;
        }
        monthYear.setText(getMonthYear((new GregorianCalendar(year, month, 1)).getTime()));
        setDayCells();
        me.consume();
      }
    });
    monthYearRow.getChildren().addAll(decrementArrow, monthYear, inreamentArrow);
    monthYearRow.setAlignment(Pos.CENTER);
   
    // Second block of the picker pane, which is constructed to show the first letter of names of days in the week.   
    HBox firstLetterOfDayRow = new HBox();
    firstLetterOfDayRow.getStyleClass().add(DATEPICKER_WEEKDAY);
    String[] weekDays = getFirstLettersOfDays();
    for (int i = 0; i < weekDays.length; i++) {
      Label cell = new Label(weekDays[i]);
      cell.setMinHeight(CELL_HEIGHT);
      cell.setMinWidth(CELL_WIDTH);
      cell.setAlignment(Pos.CENTER);
      firstLetterOfDayRow.getChildren().add(cell);
    }
    pickerBox.getChildren().addAll(monthYearRow, firstLetterOfDayRow);
   
    // Third block of the picker pane, which is constructed to show the days in a ROW_NUMBER by COLUMN_NUMBER matrix.
    // The matrix constitutes of DayCell class which extends Label class and holds date information.
    dayCells = new DayCell[COLUMN_NUMBER * ROW_NUMBER];
    int index = 0;
    for (int i = 0; i < ROW_NUMBER; i++) {
      HBox row = new HBox();
      for (int j = 0; j < COLUMN_NUMBER; j++) {
        DayCell cell = createCell(0, 0, 0);
        row.getChildren().add(cell);
        cell.setId(DATEPICKER_DAYCELL);
        dayCells[index++] = cell;
      }
      pickerBox.getChildren().add(row);
    }
   
    Button todayButton = new Button(RS.rbLabel(KEY.TODAY));
    todayButton.setId(DATEPICKER_TODAYBUTTON);
    todayButton.setOnAction(new EventHandler<ActionEvent>() {
     
      @Override
      public void handle(ActionEvent ae) {
        dateProperty.setValue((new GregorianCalendar(0, 0, 0)).getTime());
        dateProperty.setValue(
            (new GregorianCalendar(
                today.get(Calendar.YEAR),
                today.get(Calendar.MONTH),
                today.get(Calendar.DAY_OF_MONTH))).getTime());
       
      }
    });
   
    HBox todayButtonBox = new HBox();
    todayButtonBox.setId(DATEPICKER_TODAYBUTTONBOX);
    todayButtonBox.setAlignment(Pos.CENTER);
    todayButtonBox.getChildren().add(todayButton);
   
    pickerBox.getChildren().add(todayButtonBox);
   
    getChildren().add(pickerBox);
   
    // Setter of the day cells
    setDayCells();
View Full Code Here

      label.getStyleClass().add("gauge-header");
      // create/add numeric stepper
      numericStepperDigits = new Digits(String.format(
          this.numericStepperFormat, 0), 0.15f, numericStepperColor,
          null);
      final VBox stepperBar = new VBox(NUMERIC_STEPPER_QUARTER_HEIGHT);
      stepperBar.getChildren().addAll(createArrowButton(true),
          createArrowButton(false));

      final Region digitsDisplay = GuiUtil.createBackgroundDisplay(
          new Insets(NUMERIC_STEPPER_EIGHTH_HEIGHT,
              NUMERIC_STEPPER_QUARTER_HEIGHT,
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.