private void updateProgress() {
      intProgress = (int) Math.round(control.getProgress() * 100.0);
      // text.setText((control.getProgress() >= 1) ? (DONE) : ("" + intProgress + "%"));

      degProgress = (int) (360 * control.getProgress());
      arcShape.setLength(-degProgress);
      indicator.setOpacity(control.getProgress() == 0 ? 0 : 1);
      requestLayout();
    }
    public DeterminateIndicator(
        ConfidenceProgressIndicator control,
        ConfidenceProgressIndicatorSkin s,
        Paint fillOverride) {
      this.control = control;

      getStyleClass().add("determinate-indicator");

      intProgress = (int) Math.round(control.getProgress() * 100.0);
      degProgress = (int) (360 * control.getProgress());

      InvalidationListener progressListener = valueModel -> updateProgress();
      control.progressProperty().addListener(progressListener);

      getChildren().clear();

      // The circular background for the progress pie piece
      indicator = new StackPane();
      indicator.setScaleShape(false);
      indicator.setCenterShape(false);
      indicator.getStyleClass().setAll("indicator");
      indicatorCircle = new Circle();
      indicator.setShape(indicatorCircle);

      // The shape for our progress pie piece
      arcShape = new Arc();
      arcShape.setType(ArcType.ROUND);
      arcShape.setStartAngle(90.0F);

      // Our progress pie piece
      progress = new StackPane();
      progress.getStyleClass().setAll("progress");
      progress.setScaleShape(false);
      progress.setCenterShape(false);
      progress.setShape(arcShape);
      progress.getChildren().clear();
      setFillOverride(fillOverride);

      // The check mark that's drawn at 100%
      tick = new StackPane();
      tick.getStyleClass().setAll("tick");

      getChildren().setAll(indicator, progress, /*text,*/ tick);
      updateProgress();
    }
    @Override
    protected void layoutChildren() {
      // Position and size the circular background
      // double doneTextHeight = doneText.getLayoutBounds().getHeight();
      final Insets controlInsets = control.getInsets();
      final double left = snapSize(controlInsets.getLeft());
      final double right = snapSize(controlInsets.getRight());
      final double top = snapSize(controlInsets.getTop());
      final double bottom = snapSize(controlInsets.getBottom());

      /*
       ** use the min of width, or height, keep it a circle
       */
      final double areaW = control.getWidth() - left - right;
      final double areaH = control.getHeight() - top - bottom /*- textGap - doneTextHeight*/;
      final double radiusW = areaW / 2;
      final double radiusH = areaH / 2;
      final double radius = Math.round(Math.min(radiusW, radiusH)); // use round instead of floor
      final double centerX = snapPosition(left + radiusW);
      final double centerY = snapPosition(top + radius);

      // find radius that fits inside radius - insetsPadding
      final Insets indicatorInsets = indicator.getInsets();
      final double iLeft = snapSize(indicatorInsets.getLeft());
      final double iRight = snapSize(indicatorInsets.getRight());
      final double iTop = snapSize(indicatorInsets.getTop());
      final double iBottom = snapSize(indicatorInsets.getBottom());
      final double progressRadius =
          snapSize(
              Math.min(
                  Math.min(radius - iLeft, radius - iRight),
                  Math.min(radius - iTop, radius - iBottom)));

      indicatorCircle.setRadius(radius);
      indicator.setLayoutX(centerX);
      indicator.setLayoutY(centerY);

      arcShape.setRadiusX(progressRadius);
      arcShape.setRadiusY(progressRadius);
      progress.setLayoutX(centerX);
      progress.setLayoutY(centerY);

      // find radius that fits inside progressRadius - progressInsets
      final Insets progressInsets = progress.getInsets();
      final double pLeft = snapSize(progressInsets.getLeft());
      final double pRight = snapSize(progressInsets.getRight());
      final double pTop = snapSize(progressInsets.getTop());
      final double pBottom = snapSize(progressInsets.getBottom());
      final double indicatorRadius =
          snapSize(
              Math.min(
                  Math.min(progressRadius - pLeft, progressRadius - pRight),
                  Math.min(progressRadius - pTop, progressRadius - pBottom)));

      // find size of spare box that fits inside indicator radius
      double squareBoxHalfWidth = Math.ceil(Math.sqrt((indicatorRadius * indicatorRadius) / 2));
      // double squareBoxHalfWidth2 = indicatorRadius * (Math.sqrt(2) / 2);

      tick.setLayoutX(centerX - squareBoxHalfWidth);
      tick.setLayoutY(centerY - squareBoxHalfWidth);
      tick.resize(squareBoxHalfWidth + squareBoxHalfWidth, squareBoxHalfWidth + squareBoxHalfWidth);
      tick.setVisible(control.getProgress() >= 1);
    }