final double iy = centerY - (indicatorHeight / 2);
// indicator shape
final Rotate indicatorRotate = new Rotate(this.angleProperty.get(), centerX, centerY);
Bindings.bindBidirectional(indicatorRotate.angleProperty(), this.angleProperty);
Shape indicatorShape;
if (indicatorType == IndicatorType.KNOB) {
indicatorShape = createIndicatorShape(indicatorType, ix, iy, indicatorWidth - pointDistance,
indicatorHeight - pointDistance, pointDistance,
centerX, centerY, fillProperty);
final double knobSurfaceRadius = indicatorWidth - pointDistance * 2d;
final Group knobSurface = createKnobSurface(0, centerX, centerY,
knobSurfaceRadius, knobSurfaceRadius, DEFAULT_KNOB_SURFACE_COLORS);
final Group indicatorShapeGroup = createKnob(indicatorShape, knobSurface);
indicatorShapeGroup.getTransforms().addAll(indicatorRotate);
indicatorBase.getChildren().add(indicatorShapeGroup);
} else {
indicatorShape = createIndicatorShape(indicatorType, ix, iy, indicatorWidth,
indicatorHeight, pointDistance, centerX, centerY, fillProperty);
indicatorShape.getTransforms().addAll(indicatorRotate);
indicatorBase.getChildren().add(indicatorShape);
}
final Lighting lighting = createLighting();
if (indicatorType == IndicatorType.KNOB) {
lighting.setSpecularConstant(0.4d);
lighting.setSpecularExponent(40d);
lighting.setDiffuseConstant(1.7d);
}
indicatorBase.setEffect(lighting);
indicator.getChildren().add(indicatorBase);
// create/add the bolt that holds the indicator in place
if (indicatorType != IndicatorType.KNOB) {
final Shape indicatorBolt = createIndicatorBolt();
indicator.getChildren().add(indicatorBolt);
indicatorBolt.setEffect(lighting);
}
return indicator;
}