Ejemplo n.º 1
0
 // ******************** Methods *******************************************
 protected void handleEvents(final String EVENT_TYPE) {
   if ("REDRAW".equals(EVENT_TYPE)) {
     pane.setEffect(getSkinnable().isShadowsEnabled() ? mainInnerShadow1 : null);
     shadowGroup.setEffect(getSkinnable().isShadowsEnabled() ? FOREGROUND_SHADOW : null);
     updateLcdDesign(height);
     redraw();
   } else if ("RESIZE".equals(EVENT_TYPE)) {
     aspectRatio = getSkinnable().getPrefHeight() / getSkinnable().getPrefWidth();
     resize();
     redraw();
   } else if ("LCD".equals(EVENT_TYPE)) {
     updateLcdDesign(height);
   } else if ("VISIBILITY".equals(EVENT_TYPE)) {
     crystalOverlay.setManaged(getSkinnable().isLcdCrystalEnabled());
     crystalOverlay.setVisible(getSkinnable().isLcdCrystalEnabled());
     unitText.setManaged(!getSkinnable().getUnit().isEmpty());
     unitText.setVisible(!getSkinnable().getUnit().isEmpty());
     upperLeftText.setManaged(getSkinnable().isMinMeasuredValueVisible());
     upperLeftText.setVisible(getSkinnable().isMinMeasuredValueVisible());
     upperRightText.setManaged(getSkinnable().isMaxMeasuredValueVisible());
     upperRightText.setVisible(getSkinnable().isMaxMeasuredValueVisible());
     lowerRightText.setManaged(!getSkinnable().getSubTitle().isEmpty());
     lowerRightText.setVisible(!getSkinnable().getSubTitle().isEmpty());
     lowerCenterText.setManaged(getSkinnable().isOldValueVisible());
     lowerCenterText.setVisible(getSkinnable().isOldValueVisible());
     resize();
     redraw();
   } else if ("SECTION".equals(EVENT_TYPE)) {
     sections = getSkinnable().getSections();
     updateSectionColors();
     resize();
     redraw();
   }
 }
Ejemplo n.º 2
0
  private void updateLayout(LibraryListItem listItem) {
    assert listItem != null;

    if (listItem.getLibItem() != null) {
      final ILibraryItem item = listItem.getLibItem();
      // The classname shall be space character free (it is an API name).
      // If there is a space character then it means a qualifier comes
      // right after.
      String classname = getClassName(item.getName());
      iconImageView.setManaged(true);
      classNameLabel.setManaged(true);
      qualifierLabel.setManaged(true);
      sectionLabel.setManaged(false);
      iconImageView.setVisible(true);
      classNameLabel.setVisible(true);
      qualifierLabel.setVisible(true);
      sectionLabel.setVisible(false);
      classNameLabel.setText(classname);
      qualifierLabel.setText(getQualifier(item.getName()));
      // getIconURL can return null, this is deliberate.
      URL iconURL = item.getIconURL();
      // Use missing icon
      if (iconURL == null) {
        iconURL = missingIconURL;
      }
      iconImageView.setImage(new Image(iconURL.toExternalForm()));
    } else if (listItem.getSectionName() != null) {
      iconImageView.setManaged(false);
      classNameLabel.setManaged(false);
      qualifierLabel.setManaged(false);
      sectionLabel.setManaged(true);
      iconImageView.setVisible(false);
      classNameLabel.setVisible(false);
      qualifierLabel.setVisible(false);
      sectionLabel.setVisible(true);
      sectionLabel.setText(listItem.getSectionName());
    }
  }
Ejemplo n.º 3
0
  private void initGraphics() {
    mainInnerShadow0 = new InnerShadow();
    mainInnerShadow0.setOffsetX(0.0);
    mainInnerShadow0.setOffsetY(0.0);
    mainInnerShadow0.setRadius(0.0625 * PREFERRED_HEIGHT);
    mainInnerShadow0.setColor(Color.rgb(255, 255, 255, 0.5));
    mainInnerShadow0.setBlurType(BlurType.TWO_PASS_BOX);

    mainInnerShadow1 = new InnerShadow();
    mainInnerShadow1.setOffsetX(0.0);
    mainInnerShadow1.setOffsetY(1.0);
    mainInnerShadow1.setRadius(0.04166667 * PREFERRED_HEIGHT);
    mainInnerShadow1.setColor(Color.rgb(0, 0, 0, 0.65));
    mainInnerShadow1.setBlurType(BlurType.TWO_PASS_BOX);
    mainInnerShadow1.setInput(mainInnerShadow0);

    crystalClip = new Rectangle(0, 0, width, height);
    crystalClip.setArcWidth(5);
    crystalClip.setArcHeight(5);

    crystalImage =
        Helper.createNoiseImage(
            PREFERRED_WIDTH, PREFERRED_HEIGHT, DARK_NOISE_COLOR, BRIGHT_NOISE_COLOR, 8);
    crystalOverlay = new ImageView(crystalImage);
    crystalOverlay.setClip(crystalClip);
    boolean crystalEnabled = getSkinnable().isLcdCrystalEnabled();
    crystalOverlay.setManaged(crystalEnabled);
    crystalOverlay.setVisible(crystalEnabled);

    threshold = new Path();
    threshold.setManaged(getSkinnable().isThresholdVisible());
    threshold.setVisible(getSkinnable().isThresholdVisible());
    threshold.setStroke(null);

    backgroundText =
        new Text(String.format(Locale.US, valueFormatString, getSkinnable().getCurrentValue()));
    backgroundText.setFill(getSkinnable().getLcdDesign().lcdBackgroundColor);
    backgroundText.setOpacity(
        (LcdFont.LCD == getSkinnable().getLcdFont()
                || LcdFont.ELEKTRA == getSkinnable().getLcdFont())
            ? 1
            : 0);

    valueText =
        new Text(String.format(Locale.US, valueFormatString, getSkinnable().getCurrentValue()));
    valueText.setFill(getSkinnable().getLcdDesign().lcdForegroundColor);

    unitText = new Text(getSkinnable().getUnit());
    unitText.setFill(getSkinnable().getLcdDesign().lcdForegroundColor);
    unitText.setManaged(!getSkinnable().getUnit().isEmpty());
    unitText.setVisible(!getSkinnable().getUnit().isEmpty());

    title = new Text(getSkinnable().getTitle());
    title.setFill(getSkinnable().getLcdDesign().lcdForegroundColor);
    title.setManaged(!getSkinnable().getTitle().isEmpty());
    title.setVisible(!getSkinnable().getTitle().isEmpty());

    lowerRightText = new Text(getSkinnable().getSubTitle());
    lowerRightText.setFill(getSkinnable().getLcdDesign().lcdForegroundColor);
    lowerRightText.setManaged(!getSkinnable().getSubTitle().isEmpty());
    lowerRightText.setVisible(!getSkinnable().getSubTitle().isEmpty());

    upperLeftText =
        new Text(String.format(Locale.US, otherFormatString, getSkinnable().getMinMeasuredValue()));
    upperLeftText.setFill(getSkinnable().getLcdDesign().lcdForegroundColor);
    upperLeftText.setManaged(getSkinnable().isMinMeasuredValueVisible());
    upperLeftText.setVisible(getSkinnable().isMinMeasuredValueVisible());

    upperRightText =
        new Text(String.format(Locale.US, otherFormatString, getSkinnable().getMaxMeasuredValue()));
    upperRightText.setFill(getSkinnable().getLcdDesign().lcdForegroundColor);
    upperRightText.setManaged(getSkinnable().isMaxMeasuredValueVisible());
    upperRightText.setVisible(getSkinnable().isMaxMeasuredValueVisible());

    lowerCenterText =
        new Text(String.format(Locale.US, otherFormatString, getSkinnable().getOldValue()));
    lowerCenterText.setFill(getSkinnable().getLcdDesign().lcdForegroundColor);
    lowerCenterText.setManaged(getSkinnable().isOldValueVisible());
    lowerCenterText.setVisible(getSkinnable().isOldValueVisible());

    shadowGroup = new Group();
    shadowGroup.setEffect(getSkinnable().isShadowsEnabled() ? FOREGROUND_SHADOW : null);
    shadowGroup
        .getChildren()
        .setAll(
            threshold,
            valueText,
            unitText,
            title,
            lowerRightText,
            upperLeftText,
            upperRightText,
            lowerCenterText);

    pane = new Pane(crystalOverlay, backgroundText, shadowGroup);
    pane.setEffect(getSkinnable().isShadowsEnabled() ? mainInnerShadow1 : null);
    getChildren().setAll(pane);
  }
Ejemplo n.º 4
0
  public PlongeeSimpleView() {
    MN90.getLogger().debug(this, "Construction de la vue PlongeeSimple");
    // this.setGridLinesVisible(MN90.AFFICHAGE_GRILLE);
    this.setGridLinesVisible(true);

    ColumnConstraints col = new ColumnConstraints();
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(90);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);
    // col.setPercentWidth(5);
    col.setHgrow(Priority.ALWAYS);
    this.getColumnConstraints().add(col);

    RowConstraints row = new RowConstraints();
    // row.setPercentHeight(90);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    // row.setPercentHeight(90);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);
    row.setVgrow(Priority.ALWAYS);
    this.getRowConstraints().add(row);

    mImgView.setImage(mImgPlongeeFond);
    mImgView.setFitWidth(100);
    mImgView.setManaged(true);
    mImgView.setPreserveRatio(true);
    mImgView.setSmooth(true);
    mImgView.setCache(true);
    this.add(mImgView, 0, 1, 13, 8);

    this.add(mHeureDepartLabel, 0, 0);

    mHeureDepartValue.setPrefWidth(100);
    mHeureDepartValue.setMaxWidth(100);
    mHeureDepartValue.setMinWidth(100);
    this.add(mHeureDepartValue, 1, 0, 2, 1);

    this.add(mProfMaxLabel, 2, 8);

    mProfMaxValue.setPrefWidth(45);
    mProfMaxValue.setMaxWidth(45);
    mProfMaxValue.setMinWidth(45);
    this.add(mProfMaxValue, 3, 8);

    this.add(mHeureSortieLabel, 10, 0);

    mHeureSortieValue.setPrefWidth(100);
    mHeureSortieValue.setMaxWidth(100);
    mHeureSortieValue.setMinWidth(100);
    this.add(mHeureSortieValue, 11, 0, 2, 1);

    this.add(mDureePlongeeLabel, 2, 7);

    mDureePlongeeValue.setPrefWidth(45);
    mDureePlongeeValue.setMaxWidth(45);
    mDureePlongeeValue.setMinWidth(45);
    this.add(mDureePlongeeValue, 3, 7);

    this.add(mPalier3mLabel, 11, 2);

    mDureePalier3mValue.setPrefWidth(50);
    mDureePalier3mValue.setMaxWidth(50);
    mDureePalier3mValue.setMinWidth(50);
    this.add(mDureePalier3mValue, 11, 3);

    this.add(mDTRLabel, 10, 8);

    mDTRValue.setPrefWidth(50);
    mDTRValue.setMaxWidth(50);
    mDTRValue.setMinWidth(50);
    this.add(mDTRValue, 11, 8);

    this.add(mGPSLabel, 10, 7);

    mGPSValue.setPrefWidth(50);
    mGPSValue.setMaxWidth(50);
    mGPSValue.setMinWidth(50);
    this.add(mGPSValue, 11, 7);
  }