private void rebuild() { // update indeterminate indicator final int segments = skin.indeterminateSegmentCount.get(); opacities.clear(); pathsG.getChildren().clear(); final double step = 0.8 / (segments - 1); for (int i = 0; i < segments; i++) { Region region = new Region(); region.setScaleShape(false); region.setCenterShape(false); region.getStyleClass().addAll("segment", "segment" + i); if (fillOverride instanceof Color) { Color c = (Color) fillOverride; region.setStyle( "-fx-background-color: rgba(" + ((int) (255 * c.getRed())) + "," + "" + ((int) (255 * c.getGreen())) + "," + ((int) (255 * c.getBlue())) + "," + "" + c.getOpacity() + ");"); } else { region.setStyle(null); } double opacity = Math.min(1, i * step); opacities.add(opacity); region.setOpacity(opacity); pathsG.getChildren().add(region); } }
private EndButton(String styleClass, String arrowStyleClass) { getStyleClass().setAll(styleClass); arrow = new Region(); arrow.getStyleClass().setAll(arrowStyleClass); getChildren().setAll(arrow); requestLayout(); }
private void updateStyleClasses() { getStyleClass().setAll("candlestick-candle", seriesStyleClass, dataStyleClass); highLowLine .getStyleClass() .setAll( "candlestick-line", seriesStyleClass, dataStyleClass, openAboveClose ? "open-above-close" : "close-above-open"); bar.getStyleClass() .setAll( "candlestick-bar", seriesStyleClass, dataStyleClass, openAboveClose ? "open-above-close" : "close-above-open"); }