/* */ protected void layoutChildren() { /* 50 */ super.layoutChildren(); /* */ /* 52 */ if (((ProgressBar) getSkinnable()).isIndeterminate()) { /* 53 */ return; /* */ } /* */ /* 56 */ StackPane track = (StackPane) getChildren().get(0); /* 57 */ StackPane bar = (StackPane) getChildren().get(1); /* */ /* 59 */ if (!bar.getChildren().contains(this.topGradient)) { /* 60 */ bar.getChildren().add(this.topGradient); /* */ } /* */ /* 63 */ if (!bar.getChildren().contains(this.bottomGradient)) { /* 64 */ bar.getChildren().add(this.bottomGradient); /* */ } /* */ /* 67 */ if (!getChildren().contains(this.verticalLines)) { /* 68 */ getChildren().add(this.verticalLines); /* */ } /* */ /* 71 */ Insets insets = getInsets(); /* 72 */ double x = insets.getLeft(); /* 73 */ double y = insets.getTop(); /* 74 */ double w = getWidth() - (insets.getLeft() + insets.getRight()); /* 75 */ double h = getHeight() - (insets.getTop() + insets.getBottom()); /* */ /* 78 */ double scale = Math.floor(w / 14.0D) * 14.0D / w; /* */ /* 80 */ double barWidth = bar.getWidth() * scale; /* 81 */ double barHeight = bar.getHeight(); /* */ /* 83 */ track.resize(track.getWidth() * scale, track.getHeight()); /* 84 */ bar.resize(barWidth, barHeight); /* */ /* 86 */ this.topGradient.setX(x + this.gradientMargin); /* 87 */ this.topGradient.setY(y + 0.5D); /* 88 */ this.topGradient.setWidth(barWidth - 2.0D * this.gradientMargin); /* 89 */ this.topGradient.setHeight( barHeight * 0.3D / this.gradientRadius * this.gradientTweak); /* */ /* 91 */ this.bottomGradient.setX(x + this.gradientMargin); /* 92 */ this.bottomGradient.setWidth(barWidth - 2.0D * this.gradientMargin); /* 93 */ double gh = barHeight * 0.21D / this.gradientRadius * this.gradientTweak; /* 94 */ this.bottomGradient.setY(barHeight - gh - 0.5D); /* 95 */ this.bottomGradient.setHeight(gh); /* */ /* 97 */ this.verticalLines.setX(x); /* 98 */ this.verticalLines.setY(y); /* 99 */ this.verticalLines.setWidth(w * scale); /* 100 */ this.verticalLines.setHeight(h); /* */ }
public void beginInteraction() { assert scalingGroup.getParent().isManaged(); assert scrollPane.getContent() instanceof StackPane; // Makes the user design and enclosing group unmanaged so // that they no longer influence the scroll pane viewport. scalingGroup.getParent().setManaged(false); // Renders the top stack pane fully rigid final StackPane contentPane = (StackPane) scrollPane.getContent(); assert contentPane.getMinWidth() == Region.USE_PREF_SIZE; assert contentPane.getMinHeight() == Region.USE_PREF_SIZE; assert contentPane.getPrefWidth() == Region.USE_COMPUTED_SIZE; assert contentPane.getPrefHeight() == Region.USE_COMPUTED_SIZE; assert contentPane.getMaxWidth() == Double.MAX_VALUE; assert contentPane.getMaxHeight() == Double.MAX_VALUE; contentPane.setPrefWidth(contentPane.getWidth()); contentPane.setPrefHeight(contentPane.getHeight()); contentPane.setMaxWidth(Region.USE_PREF_SIZE); contentPane.setMaxHeight(Region.USE_PREF_SIZE); }