java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.SliderUI
javax.swing.plaf.basic.BasicSliderUI
javax.swing.plaf.metal.MetalSliderUI
A Java L&F implementation of SliderUI.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans
package.
Please see XMLEncoder
.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
PropertyListener
forJSlider.isFilled
.Nested classes/interfaces declared in class javax.swing.plaf.basic.BasicSliderUI
BasicSliderUI.ActionScroller, BasicSliderUI.ChangeHandler, BasicSliderUI.ComponentHandler, BasicSliderUI.FocusHandler, BasicSliderUI.PropertyChangeHandler, BasicSliderUI.ScrollListener, BasicSliderUI.TrackListener
-
Field Summary
Modifier and TypeFieldDescriptionprotected static Color
The color of dark shadow.protected boolean
The value of the propertyJSlider.isFilled
.protected static Color
The color of highlighting.protected static Icon
A default horizontal thumbIcon
.protected final String
Property forJSlider.isFilled
.protected static Color
The color of a thumbprotected final int
The buffer of a tick.protected static int
The length of a tick.protected static int
The width of a track.protected static Icon
A default vertical thumbIcon
.Fields declared in class javax.swing.plaf.basic.BasicSliderUI
changeListener, componentListener, contentRect, focusInsets, focusListener, focusRect, insetCache, labelRect, leftToRightCache, MAX_SCROLL, MIN_SCROLL, NEGATIVE_SCROLL, POSITIVE_SCROLL, propertyChangeListener, scrollListener, scrollTimer, slider, thumbRect, tickRect, trackBuffer, trackListener, trackRect
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected PropertyChangeListener
createPropertyChangeListener
(JSlider slider) ConstructsMetalPropertyListener
.static ComponentUI
Constructs aMetalSliderUI
instance.protected int
Returns the amount that the thumb goes past the slide bar.int
Gets the height of the tick area for horizontal sliders and the width of the tick area for vertical sliders.protected int
Returns the longer dimension of the slide bar.protected int
Returns the shorter dimension of the track.Methods declared in class javax.swing.plaf.basic.BasicSliderUI
calculateContentRect, calculateFocusRect, calculateGeometry, calculateLabelRect, calculateThumbLocation, calculateThumbSize, calculateTickRect, calculateTrackBuffer, calculateTrackRect, createChangeListener, createComponentListener, createFocusListener, createScrollListener, createTrackListener, drawInverted, getBaseline, getBaselineResizeBehavior, getFocusColor, getHeightOfHighValueLabel, getHeightOfLowValueLabel, getHeightOfTallestLabel, getHighestValue, getHighestValueLabel, getHighlightColor, getLowestValue, getLowestValueLabel, getMaximumSize, getMinimumHorizontalSize, getMinimumSize, getMinimumVerticalSize, getPreferredHorizontalSize, getPreferredSize, getPreferredVerticalSize, getShadowColor, getThumbSize, getWidthOfHighValueLabel, getWidthOfLowValueLabel, getWidthOfWidestLabel, installDefaults, installKeyboardActions, installListeners, installUI, isDragging, labelsHaveSameBaselines, paintFocus, paintHorizontalLabel, paintLabels, paintMajorTickForHorizSlider, paintMajorTickForVertSlider, paintMinorTickForHorizSlider, paintMinorTickForVertSlider, paintThumb, paintTicks, paintTrack, paintVerticalLabel, recalculateIfInsetsChanged, recalculateIfOrientationChanged, scrollByBlock, scrollByUnit, scrollDueToClickInTrack, setThumbLocation, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI, valueForXPosition, valueForYPosition, xPositionForValue, yPositionForValue, yPositionForValue
Methods declared in class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, paint, update
-
Field Details
-
TICK_BUFFER
protected final int TICK_BUFFERThe buffer of a tick.- See Also:
-
filledSlider
protected boolean filledSliderThe value of the propertyJSlider.isFilled
. By default,false
if the property is not set,true
for Ocean theme. -
thumbColor
The color of a thumb -
highlightColor
The color of highlighting. -
darkShadowColor
The color of dark shadow. -
trackWidth
protected static int trackWidthThe width of a track. -
tickLength
protected static int tickLengthThe length of a tick. -
horizThumbIcon
A default horizontal thumbIcon
. This field might not be used. To change theIcon
used by this delegate directly set it using theSlider.horizontalThumbIcon
UIManager property. -
vertThumbIcon
A default vertical thumbIcon
. This field might not be used. To change theIcon
used by this delegate directly set it using theSlider.verticalThumbIcon
UIManager property. -
SLIDER_FILL
-
-
Constructor Details
-
MetalSliderUI
public MetalSliderUI()Constructs aMetalSliderUI
instance.
-
-
Method Details
-
createUI
Constructs aMetalSliderUI
instance.- Parameters:
c
- a component- Returns:
- a
MetalSliderUI
instance
-
createPropertyChangeListener
ConstructsMetalPropertyListener
.- Overrides:
createPropertyChangeListener
in classBasicSliderUI
- Parameters:
slider
- aJSlider
- Returns:
- the
MetalPropertyListener
-
getTickLength
public int getTickLength()Gets the height of the tick area for horizontal sliders and the width of the tick area for vertical sliders. BasicSliderUI uses the returned value to determine the tick area rectangle.- Overrides:
getTickLength
in classBasicSliderUI
- Returns:
- an integer representing the height of the tick area for horizontal sliders, and the width of the tick area for the vertical sliders
-
getTrackWidth
protected int getTrackWidth()Returns the shorter dimension of the track.- Returns:
- the shorter dimension of the track
-
getTrackLength
protected int getTrackLength()Returns the longer dimension of the slide bar. (The slide bar is only the part that runs directly under the thumb)- Returns:
- the longer dimension of the slide bar
-
getThumbOverhang
protected int getThumbOverhang()Returns the amount that the thumb goes past the slide bar.- Returns:
- the amount that the thumb goes past the slide bar
-