Spec-Zone .ru
спецификации, руководства, описания, API
001/*
002 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation.  Oracle designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Oracle in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
022 * or visit www.oracle.com if you need additional information or have any
023 * questions.
024 */
025
026package javafx.scene.control;
027
028import java.util.ArrayList;
029import java.util.Collections;
030import java.util.List;
031
032import javafx.beans.property.BooleanProperty;
033import javafx.beans.property.DoubleProperty;
034import javafx.beans.property.DoublePropertyBase;
035import javafx.beans.property.IntegerProperty;
036import javafx.beans.property.ObjectProperty;
037import javafx.beans.property.SimpleBooleanProperty;
038import javafx.beans.property.SimpleObjectProperty;
039
040import javafx.geometry.Orientation;
041import javafx.util.StringConverter;
042
043import com.sun.javafx.Utils;
044import javafx.css.CssMetaData;
045import javafx.css.StyleOrigin;
046import javafx.css.PseudoClass;
047import javafx.css.StyleableBooleanProperty;
048import javafx.css.StyleableDoubleProperty;
049import javafx.css.StyleableIntegerProperty;
050import javafx.css.StyleableObjectProperty;
051import com.sun.javafx.css.converters.BooleanConverter;
052import com.sun.javafx.css.converters.EnumConverter;
053import com.sun.javafx.css.converters.SizeConverter;
054
055import com.sun.javafx.scene.control.accessible.AccessibleSlider;
056import com.sun.javafx.accessible.providers.AccessibleProvider;
057import com.sun.javafx.scene.control.skin.SliderSkin;
058import javafx.css.Styleable;
059import javafx.css.StyleableProperty;
060import javafx.scene.Node;
061
062/**
063 * The Slider Control is used to display a continuous or discrete range of
064 * valid numeric choices and allows the user to interact with the control. It is
065 * typically represented visually as having a "track" and a "knob" or "thumb"
066 * which is dragged within the track. The Slider can optionally show tick marks
067 * and labels indicating the different slider position values.
068 * <p>
069 * The three fundamental variables of the slider are <code>min</code>,
070 * <code>max</code>, and <code>value</code>. The <code>value</code> should always
071 * be a number within the range defined by <code>min</code> and
072 * <code>max</code>. <code>min</code> should always be less than or equal to
073 * <code>max</code> (although a slider who's <code>min</code> and
074 * <code>max</code> are equal is a degenerate case that makes no sense).
075 * <code>min</code> defaults to 0, whereas <code>max</code> defaults to 100.
076 * <p>
077 * This first example creates a slider who's range, or span, goes from 0 to 1,
078 * and who's value defaults to .5:
079 *
080 * <pre>
081 * import javafx.scene.control.Slider;
082 * 
083 * Slider slider = new Slider(0, 1, 0.5);
084 * </pre>
085 * 
086 * <p>
087 * This next example shows a slider with customized tick marks and tick mark
088 * labels, which also spans from 0 to 1:
089 *
090 * <pre>
091 * import javafx.scene.control.Slider;
092 * 
093 * Slider slider = new Slider(0, 1, 0.5);
094 * slider.setShowTickMarks(true);
095 * slider.setShowTickLabels(true);
096 * slider.setMajorTickUnit(0.25f);
097 * slider.setBlockIncrement(0.1f);
098 * </pre>
099 */
100public class Slider extends Control {
101
102    public Slider() {
103        initialize();
104    }
105
106    /**
107     * Constructs a Slider control with the specified slider min, max and current value values.
108     * @param min Slider minimum value
109     * @param max Slider maximum value
110     * @param value Slider current value
111     */
112    public Slider(double min, double max, double value) {
113        setMax(max);
114        setMin(min);
115        setValue(value);
116        adjustValues();
117        initialize();
118    }
119
120    private void initialize() {
121        //Initialize the style class to be 'slider'.
122        getStyleClass().setAll(DEFAULT_STYLE_CLASS);
123    }
124    /**
125     * The maximum value represented by this Slider. This must be a
126     * value greater than {@link #minProperty() min}.
127     */
128    private DoubleProperty max;
129    public final void setMax(double value) {
130        maxProperty().set(value);
131    }
132
133    public final double getMax() {
134        return max == null ? 100 : max.get();
135    }
136
137    public final DoubleProperty maxProperty() {
138        if (max == null) {
139            max = new DoublePropertyBase(100) {
140                @Override protected void invalidated() {
141                    if (get() < getMin()) {
142                        setMin(get());
143                    }
144                    adjustValues();
145                }
146
147                @Override
148                public Object getBean() {
149                    return Slider.this;
150                }
151
152                @Override
153                public String getName() {
154                    return "max";
155                }
156            };
157        }
158        return max;
159    }
160    /**
161     * The minimum value represented by this Slider. This must be a
162     * value less than {@link #maxProperty() max}.
163     */
164    private DoubleProperty min;
165    public final void setMin(double value) {
166        minProperty().set(value);
167    }
168
169    public final double getMin() {
170        return min == null ? 0 : min.get();
171    }
172
173    public final DoubleProperty minProperty() {
174        if (min == null) {
175            min = new DoublePropertyBase(0) {
176                @Override protected void invalidated() {
177                    if (get() > getMax()) {
178                        setMax(get());
179                    }
180                    adjustValues();
181                }
182
183                @Override
184                public Object getBean() {
185                    return Slider.this;
186                }
187
188                @Override
189                public String getName() {
190                    return "min";
191                }
192            };
193        }
194        return min;
195    }
196    /**
197     * The current value represented by this Slider. This value must
198     * always be between {@link #minProperty() min} and {@link #maxProperty() max},
199     * inclusive. If it is ever out of bounds either due to {@code min} or
200     * {@code max} changing or due to itself being changed, then it will
201     * be clamped to always remain valid.
202     */
203    private DoubleProperty value;
204    public final void setValue(double value) {
205        if (!valueProperty().isBound()) valueProperty().set(value);
206    }
207
208    public final double getValue() {
209        return value == null ? 0 : value.get();
210    }
211
212    public final DoubleProperty valueProperty() {
213        if (value == null) {
214            value = new DoublePropertyBase(0) {
215                @Override protected void invalidated() {
216                    adjustValues();
217                }
218
219                @Override
220                public Object getBean() {
221                    return Slider.this;
222                }
223
224                @Override
225                public String getName() {
226                    return "value";
227                }
228            };
229        }
230        return value;
231    }
232    /**
233     * When true, indicates the current value of this Slider is changing.
234     * It provides notification that the value is changing. Once the value is
235     * computed, it is reset back to false.
236     */
237    private BooleanProperty valueChanging;
238
239    public final void setValueChanging(boolean value) {
240        valueChangingProperty().set(value);
241    }
242
243    public final boolean isValueChanging() {
244        return valueChanging == null ? false : valueChanging.get();
245    }
246
247    public final BooleanProperty valueChangingProperty() {
248        if (valueChanging == null) {
249            valueChanging = new SimpleBooleanProperty(this, "valueChanging", false);
250        }
251        return valueChanging;
252    }
253//    /**
254//     * The {@code span} is the distance, or quantity, between min and max value.
255//     * This will be strictly non-negative, since both {@code min} and
256//     * {@code max} are forced to maintain a proper relationship.
257//     */
258//    //    public def span = bind max - min;
259    
260    /**
261     * The orientation of the {@code Slider} can either be horizontal
262     * or vertical.
263     */
264    private ObjectProperty<Orientation> orientation;
265    public final void setOrientation(Orientation value) {
266        orientationProperty().set(value);
267    }
268
269    public final Orientation getOrientation() {
270        return orientation == null ? Orientation.HORIZONTAL : orientation.get();
271    }
272
273    public final ObjectProperty<Orientation> orientationProperty() {
274        if (orientation == null) {
275            orientation = new StyleableObjectProperty<Orientation>(Orientation.HORIZONTAL) {
276                @Override protected void invalidated() {
277                    final boolean vertical = (get() == Orientation.VERTICAL);
278                    pseudoClassStateChanged(VERTICAL_PSEUDOCLASS_STATE,    vertical);
279                    pseudoClassStateChanged(HORIZONTAL_PSEUDOCLASS_STATE, !vertical);
280                }
281                
282                @Override 
283                public CssMetaData<Slider,Orientation> getCssMetaData() {
284                    return StyleableProperties.ORIENTATION;
285                }
286
287                @Override
288                public Object getBean() {
289                    return Slider.this;
290                }
291
292                @Override
293                public String getName() {
294                    return "orientation";
295                }
296            };
297        }
298        return orientation;
299    }
300    
301    
302    /**
303     * Indicates that the labels for tick marks should be shown. Typically a
304     * {@link Skin} implementation will only show labels if
305     * {@link #showTickMarksProperty() showTickMarks} is also true.
306     */
307    private BooleanProperty showTickLabels;
308    public final void setShowTickLabels(boolean value) {
309        showTickLabelsProperty().set(value);
310    }
311
312    public final boolean isShowTickLabels() {
313        return showTickLabels == null ? false : showTickLabels.get();
314    }
315
316    public final BooleanProperty showTickLabelsProperty() {
317        if (showTickLabels == null) {
318            showTickLabels = new StyleableBooleanProperty(false) {
319
320                
321                @Override 
322                public CssMetaData<Slider,Boolean> getCssMetaData() {
323                    return StyleableProperties.SHOW_TICK_LABELS;
324                }
325
326                @Override
327                public Object getBean() {
328                    return Slider.this;
329                }
330
331                @Override
332                public String getName() {
333                    return "showTickLabels";
334                }
335            };
336        }
337        return showTickLabels;
338    }
339    /**
340     * Specifies whether the {@link Skin} implementation should show tick marks.
341     */
342    private BooleanProperty showTickMarks;
343    public final void setShowTickMarks(boolean value) {
344        showTickMarksProperty().set(value);
345    }
346
347    public final boolean isShowTickMarks() {
348        return showTickMarks == null ? false : showTickMarks.get();
349    }
350
351    public final BooleanProperty showTickMarksProperty() {
352        if (showTickMarks == null) {
353            showTickMarks = new StyleableBooleanProperty(false) {
354
355                
356                @Override 
357                public CssMetaData<Slider,Boolean> getCssMetaData() {
358                    return StyleableProperties.SHOW_TICK_MARKS;
359                }
360
361                @Override
362                public Object getBean() {
363                    return Slider.this;
364                }
365
366                @Override
367                public String getName() {
368                    return "showTickMarks";
369                }
370            };
371        }
372        return showTickMarks;
373    }
374    /**
375     * The unit distance between major tick marks. For example, if
376     * the {@link #minProperty() min} is 0 and the {@link #maxProperty() max} is 100 and the
377     * {@link #majorTickUnitProperty() majorTickUnit} is 25, then there would be 5 tick marks: one at
378     * position 0, one at position 25, one at position 50, one at position
379     * 75, and a final one at position 100.
380     * <p>
381     * This value should be positive and should be a value less than the
382     * span. Out of range values are essentially the same as disabling
383     * tick marks.
384     */
385    private DoubleProperty majorTickUnit;
386    public final void setMajorTickUnit(double value) {
387        if (value <= 0) {
388            throw new IllegalArgumentException("MajorTickUnit cannot be less than or equal to 0.");
389        }
390        majorTickUnitProperty().set(value);
391    }
392
393    public final double getMajorTickUnit() {
394        return majorTickUnit == null ? 25 : majorTickUnit.get();
395    }
396
397    public final DoubleProperty majorTickUnitProperty() {
398        if (majorTickUnit == null) {
399            majorTickUnit = new StyleableDoubleProperty(25) {
400                @Override
401                public void invalidated() {
402                    if (get() <= 0) {
403                        throw new IllegalArgumentException("MajorTickUnit cannot be less than or equal to 0.");
404                    }
405                }
406                
407                @Override 
408                public CssMetaData<Slider,Number> getCssMetaData() {
409                    return StyleableProperties.MAJOR_TICK_UNIT;
410                }
411
412                @Override
413                public Object getBean() {
414                    return Slider.this;
415                }
416
417                @Override
418                public String getName() {
419                    return "majorTickUnit";
420                }
421            };
422        }
423        return majorTickUnit;
424    }
425    /**
426     * The number of minor ticks to place between any two major ticks. This
427     * number should be positive or zero. Out of range values will disable
428     * disable minor ticks, as will a value of zero.
429     */
430    private IntegerProperty minorTickCount;
431    public final void setMinorTickCount(int value) {
432        minorTickCountProperty().set(value);
433    }
434
435    public final int getMinorTickCount() {
436        return minorTickCount == null ? 3 : minorTickCount.get();
437    }
438
439    public final IntegerProperty minorTickCountProperty() {
440        if (minorTickCount == null) {
441            minorTickCount = new StyleableIntegerProperty(3) {
442
443                
444                @Override 
445                public CssMetaData<Slider,Number> getCssMetaData() {
446                    return StyleableProperties.MINOR_TICK_COUNT;
447                }
448
449                @Override
450                public Object getBean() {
451                    return Slider.this;
452                }
453
454                @Override
455                public String getName() {
456                    return "minorTickCount";
457                }
458            };
459        }
460        return minorTickCount;
461    }
462    /**
463     * Indicates whether the {@link #valueProperty() value} of the {@code Slider} should always
464     * be aligned with the tick marks. This is honored even if the tick marks
465     * are not shown.
466     */
467    private BooleanProperty snapToTicks;
468    public final void setSnapToTicks(boolean value) {
469        snapToTicksProperty().set(value);
470    }
471
472    public final boolean isSnapToTicks() {
473        return snapToTicks == null ? false : snapToTicks.get();
474    }
475
476    public final BooleanProperty snapToTicksProperty() {
477        if (snapToTicks == null) {
478            snapToTicks = new StyleableBooleanProperty(false) {
479                
480                @Override 
481                public CssMetaData<Slider,Boolean> getCssMetaData() {
482                    return StyleableProperties.SNAP_TO_TICKS;
483                }
484
485                @Override
486                public Object getBean() {
487                    return Slider.this;
488                }
489
490                @Override
491                public String getName() {
492                    return "snapToTicks";
493                }
494            };
495        }
496        return snapToTicks;
497    }
498    /**
499     * A function for formatting the label for a major tick. The number
500     * representing the major tick will be passed to the function. If this
501     * function is not specified, then a default function will be used by
502     * the {@link Skin} implementation.
503     */
504    private ObjectProperty<StringConverter<Double>> labelFormatter;
505
506    public final void setLabelFormatter(StringConverter<Double> value) {
507        labelFormatterProperty().set(value);
508    }
509
510    public final StringConverter<Double> getLabelFormatter() {
511        return labelFormatter == null ? null : labelFormatter.get();
512    }
513
514    public final ObjectProperty<StringConverter<Double>> labelFormatterProperty() {
515        if (labelFormatter == null) {
516            labelFormatter = new SimpleObjectProperty<StringConverter<Double>>(this, "labelFormatter");
517        }
518        return labelFormatter;
519    }
520    /**
521     * The amount by which to adjust the slider if the track of the slider is
522     * clicked. This is used when manipulating the slider position using keys. If
523     * {@link #snapToTicksProperty() snapToTicks} is true then the nearest tick mark to the adjusted
524     * value will be used.
525     */
526    private DoubleProperty blockIncrement;
527    public final void setBlockIncrement(double value) {
528        blockIncrementProperty().set(value);
529    }
530
531    public final double getBlockIncrement() {
532        return blockIncrement == null ? 10 : blockIncrement.get();
533    }
534
535    public final DoubleProperty blockIncrementProperty() {
536        if (blockIncrement == null) {
537            blockIncrement = new StyleableDoubleProperty(10) {
538
539                @Override 
540                public CssMetaData<Slider,Number> getCssMetaData() {
541                    return StyleableProperties.BLOCK_INCREMENT;
542                }
543
544                @Override
545                public Object getBean() {
546                    return Slider.this;
547                }
548
549                @Override
550                public String getName() {
551                    return "blockIncrement";
552                }
553            };
554        }
555        return blockIncrement;
556    }
557
558    /**
559     * Adjusts {@link #valueProperty() value} to match <code>newValue</code>. The 
560     * <code>value</code>is the actual amount between the 
561     * {@link #minProperty() min} and {@link #maxProperty() max}. This function
562     * also takes into account {@link #snapToTicksProperty() snapToTicks}, which
563     * is the main difference between adjustValue and setValue. It also ensures 
564     * that the value is some valid number between min and max.
565     *
566     * @expert This function is intended to be used by experts, primarily
567     *         by those implementing new Skins or Behaviors. It is not common
568     *         for developers or designers to access this function directly.
569     */
570    public void adjustValue(double newValue) {
571        // figure out the "value" associated with the specified position
572        final double _min = getMin();
573        final double _max = getMax();
574        if (_max <= _min) return;
575        newValue = newValue < _min ? _min : newValue;
576        newValue = newValue > _max ? _max : newValue;
577
578        setValue(snapValueToTicks(newValue));
579    }
580
581    /**
582     * Increments the value by {@link #blockIncrementProperty() blockIncrement}, bounded by max. If the
583     * max is less than or equal to the min, then this method does nothing.
584     */
585    public void increment() {
586        adjustValue(getValue() + getBlockIncrement());
587    }
588    
589    /**
590     * Decrements the value by {@link #blockIncrementProperty() blockIncrement}, bounded by max. If the
591     * max is less than or equal to the min, then this method does nothing.
592     */
593    public void decrement() {
594        adjustValue(getValue() - getBlockIncrement());
595    }
596    
597    /**
598     * Ensures that min is always < max, that value is always
599     * somewhere between the two, and that if snapToTicks is set then the
600     * value will always be set to align with a tick mark.
601     */
602    private void adjustValues() {
603        if ((getValue() < getMin() || getValue() > getMax()) /* &&  !isReadOnly(value)*/)
604             setValue(Utils.clamp(getMin(), getValue(), getMax()));
605    }
606
607     /**
608     * Utility function which, given the specified value, will position it
609     * either aligned with a tick, or simply clamp between min & max value,
610     * depending on whether snapToTicks is set.
611     *
612     * @expert This function is intended to be used by experts, primarily
613     *         by those implementing new Skins or Behaviors. It is not common
614     *         for developers or designers to access this function directly.
615     */
616    private double snapValueToTicks(double val) {
617        double v = val;
618        if (isSnapToTicks()) {
619            double tickSpacing = 0;
620            // compute the nearest tick to this value
621            if (getMinorTickCount() != 0) {
622                tickSpacing = getMajorTickUnit() / (Math.max(getMinorTickCount(),0)+1);
623            } else {
624                tickSpacing = getMajorTickUnit();
625            }
626            int prevTick = (int)((v - getMin())/ tickSpacing);
627            double prevTickValue = (prevTick) * tickSpacing + getMin();
628            double nextTickValue = (prevTick + 1) * tickSpacing + getMin();
629            v = Utils.nearest(prevTickValue, v, nextTickValue);
630        }
631        return Utils.clamp(getMin(), v, getMax());
632    }
633
634    /** {@inheritDoc} */
635    @Override protected Skin<?> createDefaultSkin() {
636        return new SliderSkin(this);
637    }
638
639    /***************************************************************************
640     *                                                                         *
641     *                         Stylesheet Handling                             *
642     *                                                                         *
643     **************************************************************************/
644
645    private static final String DEFAULT_STYLE_CLASS = "slider";
646    private static final String PSEUDO_CLASS_VERTICAL = "vertical";
647    private static final String PSEUDO_CLASS_HORIZONTAL = "horizontal";
648
649    private static class StyleableProperties {
650        private static final CssMetaData<Slider,Number> BLOCK_INCREMENT =
651            new CssMetaData<Slider,Number>("-fx-block-increment",
652                SizeConverter.getInstance(), 10.0) {
653
654            @Override
655            public boolean isSettable(Slider n) {
656                return n.blockIncrement == null || !n.blockIncrement.isBound();
657            }
658
659            @Override
660            public StyleableProperty<Number> getStyleableProperty(Slider n) {
661                return (StyleableProperty<Number>)n.blockIncrementProperty();
662            }
663        };
664        
665        private static final CssMetaData<Slider,Boolean> SHOW_TICK_LABELS =
666            new CssMetaData<Slider,Boolean>("-fx-show-tick-labels",
667                BooleanConverter.getInstance(), Boolean.FALSE) {
668
669            @Override
670            public boolean isSettable(Slider n) {
671                return n.showTickLabels == null || !n.showTickLabels.isBound();
672            }
673
674            @Override
675            public StyleableProperty<Boolean> getStyleableProperty(Slider n) {
676                return (StyleableProperty<Boolean>)n.showTickLabelsProperty();
677            }
678        };
679                    
680        private static final CssMetaData<Slider,Boolean> SHOW_TICK_MARKS =
681            new CssMetaData<Slider,Boolean>("-fx-show-tick-marks",
682                BooleanConverter.getInstance(), Boolean.FALSE) {
683
684            @Override
685            public boolean isSettable(Slider n) {
686                return n.showTickMarks == null || !n.showTickMarks.isBound();
687            }
688
689            @Override
690            public StyleableProperty<Boolean> getStyleableProperty(Slider n) {
691                return (StyleableProperty<Boolean>)n.showTickMarksProperty();
692            }
693        };
694            
695        private static final CssMetaData<Slider,Boolean> SNAP_TO_TICKS =
696            new CssMetaData<Slider,Boolean>("-fx-snap-to-ticks",
697                BooleanConverter.getInstance(), Boolean.FALSE) {
698
699            @Override
700            public boolean isSettable(Slider n) {
701                return n.snapToTicks == null || !n.snapToTicks.isBound();
702            }
703
704            @Override
705            public StyleableProperty<Boolean> getStyleableProperty(Slider n) {
706                return (StyleableProperty<Boolean>)n.snapToTicksProperty();
707            }
708        };
709        
710        private static final CssMetaData<Slider,Number> MAJOR_TICK_UNIT =
711            new CssMetaData<Slider,Number>("-fx-major-tick-unit",
712                SizeConverter.getInstance(), 25.0) {
713
714            @Override
715            public boolean isSettable(Slider n) {
716                return n.majorTickUnit == null || !n.majorTickUnit.isBound();
717            }
718
719            @Override
720            public StyleableProperty<Number> getStyleableProperty(Slider n) {
721                return (StyleableProperty<Number>)n.majorTickUnitProperty();
722            }
723        };
724        
725        private static final CssMetaData<Slider,Number> MINOR_TICK_COUNT =
726            new CssMetaData<Slider,Number>("-fx-minor-tick-count",
727                SizeConverter.getInstance(), 3.0) {
728
729            @Override
730            public boolean isSettable(Slider n) {
731                return n.minorTickCount == null || !n.minorTickCount.isBound();
732            }
733
734            @Override
735            public StyleableProperty<Number> getStyleableProperty(Slider n) {
736                return (StyleableProperty<Number>)n.minorTickCountProperty();
737            }
738        };
739        
740        private static final CssMetaData<Slider,Orientation> ORIENTATION =
741            new CssMetaData<Slider,Orientation>("-fx-orientation",
742                new EnumConverter<Orientation>(Orientation.class), 
743                Orientation.HORIZONTAL) {
744
745            @Override
746            public Orientation getInitialValue(Slider node) {
747                // A vertical Slider should remain vertical 
748                return node.getOrientation();
749            }
750
751            @Override
752            public boolean isSettable(Slider n) {
753                return n.orientation == null || !n.orientation.isBound();
754            }
755
756            @Override
757            public StyleableProperty<Orientation> getStyleableProperty(Slider n) {
758                return (StyleableProperty<Orientation>)n.orientationProperty();
759            }
760        };
761
762        private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES;
763        static {
764            final List<CssMetaData<? extends Styleable, ?>> styleables = 
765                new ArrayList<CssMetaData<? extends Styleable, ?>>(Control.getClassCssMetaData());
766            styleables.add(BLOCK_INCREMENT);
767            styleables.add(SHOW_TICK_LABELS);
768            styleables.add(SHOW_TICK_MARKS);
769            styleables.add(SNAP_TO_TICKS);
770            styleables.add(MAJOR_TICK_UNIT);
771            styleables.add(MINOR_TICK_COUNT);
772            styleables.add(ORIENTATION);
773            
774            STYLEABLES = Collections.unmodifiableList(styleables);
775        }
776    }
777
778    /**
779     * @return The CssMetaData associated with this class, which may include the
780     * CssMetaData of its super classes.
781     */
782    public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData() {
783        return StyleableProperties.STYLEABLES;
784    }
785
786    /**
787     * RT-19263
788     * @treatAsPrivate implementation detail
789     * @deprecated This is an experimental API that is not intended for general use and is subject to change in future versions
790     */
791    @Deprecated
792    @Override protected List<CssMetaData<? extends Styleable, ?>> getControlCssMetaData() {
793        return getClassCssMetaData();
794    }
795
796    private static final PseudoClass VERTICAL_PSEUDOCLASS_STATE =
797            PseudoClass.getPseudoClass("vertical");
798    private static final PseudoClass HORIZONTAL_PSEUDOCLASS_STATE =
799            PseudoClass.getPseudoClass("horizontal");
800
801    private AccessibleSlider accSlider ;
802    /**
803     * @treatAsPrivate implementation detail
804     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
805     */
806    @Deprecated @Override public AccessibleProvider impl_getAccessible() {
807        if( accSlider == null)
808            accSlider = new AccessibleSlider(this);
809        return (AccessibleProvider)accSlider ;
810    }
811
812}