getSkinnable().setMaxSize(MAXIMUM_WIDTH, MAXIMUM_HEIGHT);
}
}
private void initGraphics() {
valueBlendBottomShadow = new DropShadow();
valueBlendBottomShadow.setBlurType(BlurType.TWO_PASS_BOX);
valueBlendBottomShadow.setColor(Color.rgb(255, 255, 255, 0.5));
valueBlendBottomShadow.setOffsetX(0);
valueBlendBottomShadow.setOffsetY(0.005 * PREFERRED_WIDTH);
valueBlendBottomShadow.setRadius(0);
valueBlendTopShadow = new InnerShadow();
valueBlendTopShadow.setBlurType(BlurType.TWO_PASS_BOX);
valueBlendTopShadow.setColor(Color.rgb(0, 0, 0, 0.7));
valueBlendTopShadow.setOffsetX(0);
valueBlendTopShadow.setOffsetY(0.005 * PREFERRED_WIDTH);
valueBlendTopShadow.setRadius(0.005 * PREFERRED_WIDTH);
valueBlend = new Blend();
valueBlend.setMode(BlendMode.MULTIPLY);
valueBlend.setBottomInput(valueBlendBottomShadow);
valueBlend.setTopInput(valueBlendTopShadow);
background = new Region();
background.getStyleClass().setAll("background");
ticksAndSectionsCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
ticksAndSections = ticksAndSectionsCanvas.getGraphicsContext2D();
histogram = new Path();
histogram.setFillRule(FillRule.NON_ZERO);
histogram.getStyleClass().add("histogram-fill");
minMeasuredValue = new Region();
minMeasuredValue.getStyleClass().setAll("min-measured-value");
minMeasuredValueRotate = new Rotate(180 - getSkinnable().getStartAngle() - getSkinnable().getMinValue() * angleStep);
minMeasuredValue.getTransforms().setAll(minMeasuredValueRotate);
minMeasuredValue.setOpacity(getSkinnable().isMinMeasuredValueVisible() ? 1 : 0);
minMeasuredValue.setManaged(getSkinnable().isMinMeasuredValueVisible());
maxMeasuredValue = new Region();
maxMeasuredValue.getStyleClass().setAll("max-measured-value");
maxMeasuredValueRotate = new Rotate(180 - getSkinnable().getStartAngle() - getSkinnable().getMinValue() * angleStep);
maxMeasuredValue.getTransforms().setAll(maxMeasuredValueRotate);
maxMeasuredValue.setOpacity(getSkinnable().isMaxMeasuredValueVisible() ? 1 : 0);
maxMeasuredValue.setManaged(getSkinnable().isMaxMeasuredValueVisible());
threshold = new Region();
threshold.getStyleClass().setAll("threshold");
thresholdRotate = new Rotate(180 - getSkinnable().getStartAngle() - getSkinnable().getMinValue() * angleStep);
threshold.getTransforms().setAll(thresholdRotate);
threshold.setOpacity(getSkinnable().isThresholdVisible() ? 1 : 0);
threshold.setManaged(getSkinnable().isThresholdVisible());
thresholdExceeded = false;
needle = new Region();
needle.getStyleClass().setAll(Gauge.STYLE_CLASS_NEEDLE_STANDARD);
needleRotate = new Rotate(180 - getSkinnable().getStartAngle());
needleRotate.setAngle(needleRotate.getAngle() + (getSkinnable().getValue() - oldValue - getSkinnable().getMinValue()) * angleStep);
needle.getTransforms().setAll(needleRotate);
needleHighlight = new Region();
needleHighlight.setMouseTransparent(true);
needleHighlight.getStyleClass().setAll("needle-highlight");
needleHighlight.getTransforms().setAll(needleRotate);
knob = new Region();
knob.setPickOnBounds(false);
knob.getStyleClass().setAll("knob");
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);