3131import java .util .ArrayList ;
3232import java .util .Collections ;
3333import java .util .List ;
34+ import java .util .concurrent .ThreadLocalRandom ;
3435
3536/// JFXSpinner is the material design implementation of a loading spinner.
3637///
@@ -71,10 +72,10 @@ protected Skin<?> createDefaultSkin() {
7172 /// this control.
7273 private static final String DEFAULT_STYLE_CLASS = "jfx-spinner" ;
7374
74- private static final double DEFAULT_RADIUS = 12 .0 ;
75+ private static final double DEFAULT_RADIUS = 16 .0 ;
7576
7677 /**
77- * specifies the radius of the spinner node, by default it's set to `12 .0`
78+ * specifies the radius of the spinner node, by default it's set to `16 .0`
7879 */
7980 private StyleableDoubleProperty radius ;
8081
@@ -96,25 +97,8 @@ public final void setRadius(final double radius) {
9697 this .radiusProperty ().set (radius );
9798 }
9899
99- /// specifies from which angle the spinner should start spinning
100- private StyleableDoubleProperty startingAngle ;
101-
102- public final StyleableDoubleProperty startingAngleProperty () {
103- if (this .startingAngle == null ) {
104- startingAngle = new SimpleStyleableDoubleProperty (StyleableProperties .STARTING_ANGLE ,
105- JFXSpinner .this ,
106- "startingAngle" ,
107- 0.0 );
108- }
109- return this .startingAngle ;
110- }
111-
112- public final double getStartingAngle () {
113- return startingAngle != null ? startingAngle .get () : 0.0 ;
114- }
115-
116- public final void setStartingAngle (final double startingAngle ) {
117- this .startingAngleProperty ().set (startingAngle );
100+ public double getStartingAngle () {
101+ return 360 - ThreadLocalRandom .current ().nextDouble () * 720 ;
118102 }
119103
120104 private static final class StyleableProperties {
@@ -132,26 +116,12 @@ public StyleableDoubleProperty getStyleableProperty(JFXSpinner control) {
132116 }
133117 };
134118
135- private static final CssMetaData <JFXSpinner , Number > STARTING_ANGLE =
136- new CssMetaData <>("-jfx-starting-angle" ,
137- SizeConverter .getInstance (), 0.0 ) {
138- @ Override
139- public boolean isSettable (JFXSpinner control ) {
140- return control .startingAngle == null || !control .startingAngle .isBound ();
141- }
142-
143- @ Override
144- public StyleableDoubleProperty getStyleableProperty (JFXSpinner control ) {
145- return control .startingAngleProperty ();
146- }
147- };
148-
149119 private static final List <CssMetaData <? extends Styleable , ?>> CHILD_STYLEABLES ;
150120
151121 static {
152122 final List <CssMetaData <? extends Styleable , ?>> styleables =
153123 new ArrayList <>(ProgressIndicator .getClassCssMetaData ());
154- Collections .addAll (styleables , RADIUS , STARTING_ANGLE );
124+ Collections .addAll (styleables , RADIUS );
155125 CHILD_STYLEABLES = List .copyOf (styleables );
156126 }
157127 }
0 commit comments