Package javafx.scene.control

Examples of javafx.scene.control.Label


   * @param promptText the prompt text
   */
  public TextFieldMenu(final String labelText, final String promptText) {
    super(5d);
    if (labelText != null && !labelText.isEmpty()) {
      label = new Label(labelText);
      getChildren().add(label);
    } else {
      label = null;
    }
    textField.setPromptText(promptText);
View Full Code Here


    helpTextPane = new ScrollPane();
    helpTextPane.getStyleClass().add("text-area-help");
    //helpTextPane.setPrefHeight(40d);
    helpTextPane.setPrefWidth(300d);
    helpTextPane.setEffect(helpTextEffect);
    helpText = new Label(RS.rbLabel(UGateUtil.HELP_TEXT_DEFAULT_KEY));
    helpText.setWrapText(true);
    helpText.setPrefWidth(helpTextPane.getPrefWidth() - 35d);
    helpText.textProperty().addListener(new ChangeListener<String>() {
      @Override
      public void changed(ObservableValue<? extends String> observable, String oldValue,
View Full Code Here

     *
     * @param text the initial text of the label
     * @return the created label
     */
    protected Label createLabel(final String text) {
      final Label txt = new Label();
      txt.textProperty().addListener(new ChangeListener<String>() {
      @Override
      public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
        txt.setPrefWidth(imageView.getBoundsInLocal().getWidth() / 3);
      }
    });
      txt.setText(text);
      return txt;
    }
View Full Code Here

   * @param choices
   *            the choices
   */
  public UGateComboBox(final String labelText, final ObservableList<T> choices) {
    super();
    label = new Label();
    label.setText(labelText);
    comboBox = new ComboBox<T>(choices);
    // choice.setTooltip(new Tooltip(label.getText()));
    comboBox.setPromptText(RS.rbLabel(KEY.SELECT));
    comboBox.autosize();
View Full Code Here

  protected void addThresholdChildren(final int columnIndex, final int rowIndex) {
    int ci = columnIndex;
    int ri = rowIndex;

    final String feet = RS.rbLabel(KEY.FEET);
    final Label sonarThresholdLabel = createLabel(KEY.SONAR_THRESHOLD, feet);
    final UGateGaugeBox<RemoteNode> sonarTripGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.SONAR_DISTANCE_THRES_FEET,
        RemoteNodeType.SONAR_DISTANCE_THRES_INCHES,
        IndicatorType.NEEDLE, THRESHOLD_SIZE_SCALE, 1d,
        RemoteNodeType.SONAR_DISTANCE_THRES_FEET.getMin().intValue(), 0d, 180d,
        RemoteNodeType.SONAR_DISTANCE_THRES_FEET.getMax().intValue() - 1,
        3, FORMAT_SONAR, RS.IMG_RULER, GuiUtil.COLOR_SONAR);
    //sonarTripGauge.gauge.tickMarkLabelFillProperty.set(Color.WHITE);
    controlBar.addHelpTextTrigger(sonarTripGauge, RS.rbLabel(KEY.SONAR_THRESHOLD_DESC, feet));
    sonarTripGauge.gauge.setIntensity(80d, 15d, 5d);
    sonarTripGauge.setMaxWidth(200d);
    final Parent sonarCell = createCell(sonarThresholdLabel, sonarTripGauge);
   
    add(sonarCell, ci, ri);

    final Label mwThreshold = createLabel(KEY.MW_THRESHOLD, feet);
    final UGateGaugeBox<RemoteNode> mwTripGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.MW_SPEED_THRES_CYCLES_PER_SEC, null,
        IndicatorType.NEEDLE, THRESHOLD_SIZE_SCALE, 1d,
        RemoteNodeType.MW_SPEED_THRES_CYCLES_PER_SEC.getMin().intValue(), 0d, 180d,
        RemoteNodeType.MW_SPEED_THRES_CYCLES_PER_SEC.getMax().intValue() - 1,
        0, FORMAT_MW, RS.IMG_SPEEDOMETER, GuiUtil.COLOR_MW);
    controlBar.addHelpTextTrigger(mwTripGauge, RS.rbLabel(KEY.MW_THRESHOLD_DESC, feet));
    final Parent mwCell = createCell(mwThreshold, mwTripGauge);
    add(mwCell, ++ci, ri);

    final Label laserThreshold = createLabel(KEY.LASER_THRESHOLD, RS.rbLabel(KEY.FEET), feet);
    final UGateGaugeBox<RemoteNode> laserTripGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.LASER_DISTANCE_THRES_FEET,
        RemoteNodeType.LASER_DISTANCE_THRES_INCHES,
        IndicatorType.NEEDLE, THRESHOLD_SIZE_SCALE, 4d,
View Full Code Here

    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,
View Full Code Here

   * @param key the {@linkplain KEY} resource key
   * @param keyArgs the {@link KEY} arguments (if any)
   * @return the {@link Label}
   */
  protected Label createLabel(final KEY key, final Object... keyArgs) {
    final Label label = new Label(RS.rbLabel(key, keyArgs));
    label.setWrapText(true);
    label.setPrefWidth(LABEL_WIDTH);
    label.getStyleClass().add("gauge-header");
    return label;
  }
View Full Code Here

  protected void addColumn1() {
    final GridPane grid = new GridPane();
    grid.setHgap(0d);
    grid.setVgap(0d);
    // cam pan
    final Label panHeader = createLabel(KEY.CAM_PAN);
    grid.add(panHeader, 0, 0);
    final UGateGaugeBox<RemoteNode> camPanGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(), RemoteNodeType.CAM_ANGLE_PAN,
        null, IndicatorType.KNOB, KNOB_SIZE_SCALE, 10d, 0, 0d, 180d,
        19, 0, FORMAT_ANGLE, RS.IMG_PAN, GuiUtil.COLOR_CAM);
    controlBar.addHelpTextTrigger(camPanGauge, RS.rbLabel(KEY.CAM_PAN_DESC));
    grid.add(camPanGauge, 0, 1);
    // cam tilt
    final Label tiltHeader = createLabel(KEY.CAM_TILT);
    grid.add(tiltHeader, 1, 0);
    final ImageView tiltImgView = RS.imgView(camPanGauge.imageView.getImage(), false);
    tiltImgView.setRotate(90d);
    final UGateGaugeBox<RemoteNode> camTiltGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(), RemoteNodeType.CAM_ANGLE_TILT,
        null, IndicatorType.KNOB, KNOB_SIZE_SCALE, 10d, 0, 0, 180d, 19,
        0, FORMAT_ANGLE, tiltImgView, GuiUtil.COLOR_CAM);
    controlBar.addHelpTextTrigger(camTiltGauge, RS.rbLabel(KEY.CAM_TILT));
    grid.add(camTiltGauge, 1, 1);
    // sonar/pir pan
    final Label sonarPirPanHeader = createLabel(KEY.SONAR_PIR_PAN);
    grid.add(sonarPirPanHeader, 0, 2);
    final UGateGaugeBox<RemoteNode> sonarPirPanGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.SONAR_PIR_ANGLE_PAN, null, IndicatorType.KNOB,
        KNOB_SIZE_SCALE, 10d, 0, 0, 180d, 19, 0, FORMAT_ANGLE,
        RS.IMG_PAN, GuiUtil.COLOR_MULTI);
    controlBar.addHelpTextTrigger(sonarPirPanGauge, RS.rbLabel(KEY.SONAR_PIR_PAN_DESC));
    grid.add(sonarPirPanGauge, 0, 3);
    // sonar/pir tilt
    final Label sonarPirTiltHeader = createLabel(KEY.SONAR_PIR_TILT);
    grid.add(sonarPirTiltHeader, 1, 2);
    final ImageView sonarPirTiltImgView = RS.imgView(sonarPirPanGauge.imageView.getImage(), false);
    sonarPirTiltImgView.setRotate(90d);
    final UGateGaugeBox<RemoteNode> sonarPirTiltGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.SONAR_PIR_ANGLE_TILT, null, IndicatorType.KNOB,
        KNOB_SIZE_SCALE, 10d, 0, 0, 180d, 19, 0, FORMAT_ANGLE,
        sonarPirTiltImgView, GuiUtil.COLOR_MULTI);
    controlBar.addHelpTextTrigger(sonarPirTiltGauge, RS.rbLabel(KEY.SONAR_PIR_TILT_DESC));
    grid.add(sonarPirTiltGauge, 1, 3);
    // microwave pan
    final Label headerMW = createLabel(KEY.MW_PAN);
    grid.add(headerMW, 0, 4);
    final UGateGaugeBox<RemoteNode> mwPanGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(), RemoteNodeType.MW_ANGLE_PAN,
        null, IndicatorType.KNOB, KNOB_SIZE_SCALE, 10d, 0, 0, 180d, 19,
        0, FORMAT_ANGLE, RS.IMG_PAN, GuiUtil.COLOR_MW);
    controlBar.addHelpTextTrigger(mwPanGauge, RS.rbLabel(KEY.MW_PAN_DESC));
    grid.add(mwPanGauge, 0, 5);
    // laser calibration
    final Label headerLaser = createLabel(KEY.LASER_CALIBRATION);
    grid.add(headerLaser, 1, 4);
      final Button laserCalibrate = new Button(); //new Button(RS.rbLabel("laser.calibration"));
      laserCalibrate.setGraphic(RS.imgView(RS.IMG_LASER_CALIBRATE));
      laserCalibrate.setMaxWidth(125d);
      laserCalibrate.setWrapText(true);
View Full Code Here

    controlBar.addHelpTextTrigger(sonarAnglePriority, RS.rbLabel(KEY.CAM_TRIP_ANGLE_PRIORITY_DESC,
        RS.rbLabel(KEY.CAM_SONAR_TRIP_ANGLE_PRIORITY)));
    addPriorityValueListener(sonarAnglePriority);
    grid.add(sonarAnglePriority, 0, 0, 2, 1);
    // cam sonar pan
    final Label camSonarPanHeader = createLabel(KEY.CAM_PAN_SONAR);
    grid.add(camSonarPanHeader, 0, 1);
    final UGateGaugeBox<RemoteNode> camSonarPanGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.CAM_SONAR_TRIP_ANGLE_PAN, null,
        IndicatorType.KNOB, KNOB_SIZE_SCALE, 10.7d, 0, 0, 180d, 18, 0,
        FORMAT_ANGLE, RS.IMG_PAN, GuiUtil.COLOR_SONAR);
    controlBar.addHelpTextTrigger(camSonarPanGauge, RS.rbLabel(KEY.CAM_PAN_SONAR_DESC));
    grid.add(camSonarPanGauge, 0, 2);
    // cam sonar tilt
    final ImageView camSonarTiltImgView = RS.imgView(camSonarPanGauge.imageView.getImage(), false);
    camSonarTiltImgView.setRotate(90d);
    final Label camSonarTiltHeader = createLabel(KEY.CAM_TILT_SONAR);
    grid.add(camSonarTiltHeader, 1, 1);
    final UGateGaugeBox<RemoteNode> camSonarTiltGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.CAM_SONAR_TRIP_ANGLE_TILT, null,
        IndicatorType.KNOB, KNOB_SIZE_SCALE, 10.7d, 0, 0, 180d, 18, 0,
        FORMAT_ANGLE, camSonarTiltImgView, GuiUtil.COLOR_SONAR);
    controlBar.addHelpTextTrigger(camSonarTiltGauge, RS.rbLabel(KEY.CAM_TILT_SONAR_DESC));
    grid.add(camSonarTiltGauge, 1, 2);
    //####### PIR #######
    pirAnglePriority = new UGateCtrlBox<>(controlBar.getRemoteNodePA(),
        RemoteNodeType.CAM_PIR_TRIP_ANGLE_PRIORITY, PRIORITY_FORMAT,
        GuiUtil.COLOR_PIR, MIN_SENSOR_INDEX, MAX_SENSOR_INDEX,
        RS.rbLabel(KEY.CAM_PIR_TRIP_ANGLE_PRIORITY), null);
    controlBar.addHelpTextTrigger(pirAnglePriority, RS.rbLabel(KEY.CAM_TRIP_ANGLE_PRIORITY_DESC,
        RS.rbLabel(KEY.CAM_PIR_TRIP_ANGLE_PRIORITY)));
    addPriorityValueListener(pirAnglePriority);
    grid.add(pirAnglePriority, 0, 3, 2, 1);
    // cam PIR pan
    final Label pirPanHeader = createLabel(KEY.CAM_PAN_PIR);
    grid.add(pirPanHeader, 0, 4);
    final UGateGaugeBox<RemoteNode> pirPanGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.CAM_PIR_TRIP_ANGLE_PAN, null,
        IndicatorType.KNOB, KNOB_SIZE_SCALE, 10.7d, 0, 0, 180d, 18, 0,
        FORMAT_ANGLE, RS.IMG_PAN, GuiUtil.COLOR_PIR);
    controlBar.addHelpTextTrigger(pirPanGauge, RS.rbLabel(KEY.CAM_PAN_PIR_DESC));
    grid.add(pirPanGauge, 0, 5);
    // cam PIR tilt
    final Label pirTiltHeader = createLabel(KEY.CAM_TILT_PIR);
    grid.add(pirTiltHeader, 1, 4);
    final UGateGaugeBox<RemoteNode> pirTiltGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.CAM_PIR_TRIP_ANGLE_TILT, null,
        IndicatorType.KNOB, KNOB_SIZE_SCALE, 10.7d, 0, 0, 180d, 18, 0,
View Full Code Here

    controlBar.addHelpTextTrigger(mwAnglePriority, RS.rbLabel(KEY.CAM_TRIP_ANGLE_PRIORITY_DESC,
        RS.rbLabel(KEY.CAM_MW_TRIP_ANGLE_PRIORITY)));
    addPriorityValueListener(mwAnglePriority);
    grid.add(mwAnglePriority, 0, 0, 2, 1);
    // cam microwave pan
    final Label mwPanHeader = createLabel(KEY.CAM_PAN_MW);
    grid.add(mwPanHeader, 0, 1);
    final UGateGaugeBox<RemoteNode> mwPanGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.CAM_MW_TRIP_ANGLE_PAN, null, IndicatorType.KNOB,
        KNOB_SIZE_SCALE, 10.7d, 0, 0, 180d, 18, 0, FORMAT_ANGLE,
        RS.IMG_PAN, GuiUtil.COLOR_MW);
    controlBar.addHelpTextTrigger(mwPanGauge, RS.rbLabel(KEY.CAM_PAN_MW_DESC));
    grid.add(mwPanGauge, 0, 2);
    // cam microwave tilt
    final Label mwTiltHeader = createLabel(KEY.CAM_TILT_MW);
    grid.add(mwTiltHeader, 1, 1);
    final UGateGaugeBox<RemoteNode> mwTiltGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.CAM_MW_TRIP_ANGLE_TILT, null,
        IndicatorType.KNOB, KNOB_SIZE_SCALE, 10.7d, 0, 0, 180d, 18, 0,
        FORMAT_ANGLE, RS.IMG_PAN, GuiUtil.COLOR_MW);
    controlBar.addHelpTextTrigger(mwTiltGauge, RS.rbLabel(KEY.CAM_TILT_MW_DESC));
    grid.add(mwTiltGauge, 1, 2);
    //####### Laser #######
    laserAnglePriority = new UGateCtrlBox<>(controlBar.getRemoteNodePA(),
        RemoteNodeType.CAM_LASER_TRIP_ANGLE_PRIORITY, PRIORITY_FORMAT,
        GuiUtil.COLOR_LASER, MIN_SENSOR_INDEX, MAX_SENSOR_INDEX,
        RS.rbLabel(KEY.CAM_LASER_TRIP_ANGLE_PRIORITY), null);
    controlBar.addHelpTextTrigger(laserAnglePriority, RS.rbLabel(KEY.CAM_TRIP_ANGLE_PRIORITY_DESC,
        RS.rbLabel(KEY.CAM_LASER_TRIP_ANGLE_PRIORITY)));
    addPriorityValueListener(laserAnglePriority);
    grid.add(laserAnglePriority, 0, 3, 2, 1);
    // cam laser pan
    final Label laserPanHeader = createLabel(KEY.CAM_PAN_LASER);
    grid.add(laserPanHeader, 0, 4);
    final UGateGaugeBox<RemoteNode> laserPanGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.CAM_LASER_TRIP_ANGLE_PAN, null,
        IndicatorType.KNOB, KNOB_SIZE_SCALE, 10.7d, 0, 0, 180d, 18, 0,
        FORMAT_ANGLE, RS.IMG_PAN, GuiUtil.COLOR_LASER);
    controlBar.addHelpTextTrigger(laserPanGauge, RS.rbLabel(KEY.CAM_PAN_LASER_DESC));
    grid.add(laserPanGauge, 0, 5);
    // cam laser tilt
    final Label laserTiltHeader = createLabel(KEY.CAM_TILT_LASER);
    grid.add(laserTiltHeader, 1, 4);
    final UGateGaugeBox<RemoteNode> laserTiltGauge = new UGateGaugeBox<>(
        controlBar.getRemoteNodePA(),
        RemoteNodeType.CAM_LASER_TRIP_ANGLE_TILT, null,
        IndicatorType.KNOB, KNOB_SIZE_SCALE, 10.7d, 0, 0, 180d, 18, 0,
View Full Code Here

TOP

Related Classes of javafx.scene.control.Label

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.