- java.lang.Object
- 
- javax.swing.plaf.ComponentUI
- 
- javax.swing.plaf.SliderUI
- 
- javax.swing.plaf.basic.BasicSliderUI
- 
- javax.swing.plaf.metal.MetalSliderUI
 
 
 
 
- 
 public class MetalSliderUI extends BasicSliderUI 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.beanspackage. Please seeXMLEncoder.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classMetalSliderUI.MetalPropertyListenerPropertyListenerforJSlider.isFilled.- 
Nested classes/interfaces declared in class javax.swing.plaf.basic.BasicSliderUIBasicSliderUI.ActionScroller, BasicSliderUI.ChangeHandler, BasicSliderUI.ComponentHandler, BasicSliderUI.FocusHandler, BasicSliderUI.PropertyChangeHandler, BasicSliderUI.ScrollListener, BasicSliderUI.TrackListener
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected static ColordarkShadowColorThe color of dark shadow.protected booleanfilledSliderThe value of the propertyJSlider.isFilled.protected static ColorhighlightColorThe color of highlighting.protected static IconhorizThumbIconA default horizontal thumbIcon.protected StringSLIDER_FILLProperty forJSlider.isFilled.protected static ColorthumbColorThe color of a thumbprotected intTICK_BUFFERThe buffer of a tick.protected static inttickLengthThe length of a tick.protected static inttrackWidthThe width of a track.protected static IconvertThumbIconA default vertical thumbIcon.- 
Fields declared in class javax.swing.plaf.basic.BasicSliderUIchangeListener, 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 SummaryConstructors Constructor Description MetalSliderUI()Constructs aMetalSliderUIinstance.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PropertyChangeListenercreatePropertyChangeListener(JSlider slider)ConstructsMetalPropertyListener.static ComponentUIcreateUI(JComponent c)Constructs aMetalSliderUIinstance.protected intgetThumbOverhang()Returns the amount that the thumb goes past the slide bar.intgetTickLength()Gets the height of the tick area for horizontal sliders and the width of the tick area for vertical sliders.protected intgetTrackLength()Returns the longer dimension of the slide bar.protected intgetTrackWidth()Returns the shorter dimension of the track.- 
Methods declared in class javax.swing.plaf.basic.BasicSliderUIcalculateContentRect, 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.ComponentUIcontains, getAccessibleChild, getAccessibleChildrenCount, paint, update
 
- 
 
- 
- 
- 
Field Detail- 
TICK_BUFFERprotected final int TICK_BUFFER The buffer of a tick.- See Also:
- Constant Field Values
 
 - 
filledSliderprotected boolean filledSlider The value of the propertyJSlider.isFilled. By default,falseif the property is not set,truefor Ocean theme.
 - 
thumbColorprotected static Color thumbColor The color of a thumb
 - 
highlightColorprotected static Color highlightColor The color of highlighting.
 - 
darkShadowColorprotected static Color darkShadowColor The color of dark shadow.
 - 
trackWidthprotected static int trackWidth The width of a track.
 - 
tickLengthprotected static int tickLength The length of a tick.
 - 
horizThumbIconprotected static Icon horizThumbIcon A default horizontal thumbIcon. This field might not be used. To change theIconused by this delegate directly set it using theSlider.horizontalThumbIconUIManager property.
 - 
vertThumbIconprotected static Icon vertThumbIcon A default vertical thumbIcon. This field might not be used. To change theIconused by this delegate directly set it using theSlider.verticalThumbIconUIManager property.
 - 
SLIDER_FILLprotected final String SLIDER_FILL Property forJSlider.isFilled.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
createUIpublic static ComponentUI createUI(JComponent c) Constructs aMetalSliderUIinstance.- Parameters:
- c- a component
- Returns:
- a MetalSliderUIinstance
 
 - 
createPropertyChangeListenerprotected PropertyChangeListener createPropertyChangeListener(JSlider slider) ConstructsMetalPropertyListener.- Overrides:
- createPropertyChangeListenerin class- BasicSliderUI
- Parameters:
- slider- a- JSlider
- Returns:
- the MetalPropertyListener
 
 - 
getTickLengthpublic 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:
- getTickLengthin class- BasicSliderUI
- Returns:
- an integer representing the height of the tick area for horizontal sliders, and the width of the tick area for the vertical sliders
 
 - 
getTrackWidthprotected int getTrackWidth() Returns the shorter dimension of the track.- Returns:
- the shorter dimension of the track
 
 - 
getTrackLengthprotected 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
 
 - 
getThumbOverhangprotected int getThumbOverhang() Returns the amount that the thumb goes past the slide bar.- Returns:
- the amount that the thumb goes past the slide bar
 
 
- 
 
-