public class MetalSliderUI extends javax.swing.plaf.basic.BasicSliderUI
JSlider component.| Modifier and Type | Class and Description |
|---|---|
protected class |
MetalSliderUI.MetalPropertyListener
A property change handler that updates the rendered component in response
to specific property change events.
|
javax.swing.plaf.basic.BasicSliderUI.ActionScroller, javax.swing.plaf.basic.BasicSliderUI.ChangeHandler, javax.swing.plaf.basic.BasicSliderUI.ComponentHandler, javax.swing.plaf.basic.BasicSliderUI.FocusHandler, javax.swing.plaf.basic.BasicSliderUI.PropertyChangeHandler, javax.swing.plaf.basic.BasicSliderUI.ScrollListener, javax.swing.plaf.basic.BasicSliderUI.TrackListener| Modifier and Type | Field and Description |
|---|---|
protected static java.awt.Color |
darkShadowColor
The shadow color used for drawing the track rect when the slider is
enabled.
|
protected boolean |
filledSlider
A flag that controls whether or not the track is filled up to the value
of the slider.
|
protected static java.awt.Color |
highlightColor
The highlight color used for drawing the track rect when the slider is
enabled.
|
protected static javax.swing.Icon |
horizThumbIcon
The icon used for the thumb control of horizontally oriented sliders.
|
protected java.lang.String |
SLIDER_FILL
A key to look up the filledSlider setting in the
UIManager. |
protected static java.awt.Color |
thumbColor
The thumb color (unused, because an icon is used to draw the thumb).
|
protected int |
TICK_BUFFER
The gap between the track and the tick marks.
|
protected static int |
tickLength
The length of the major tick marks.
|
protected static int |
trackWidth
The track width.
|
protected static javax.swing.Icon |
vertThumbIcon
The icon used for the thumb control of vertically oriented sliders.
|
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 and Description |
|---|
MetalSliderUI()
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.beans.PropertyChangeListener |
createPropertyChangeListener(javax.swing.JSlider slider)
Creates a property change listener for the slider.
|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent component)
Returns a new instance of
MetalSliderUI. |
protected int |
getThumbOverhang()
Returns the thumb overhang.
|
protected java.awt.Dimension |
getThumbSize()
Returns the size of the thumb icon.
|
int |
getTickLength()
Returns the length of the major tick marks.
|
protected int |
getTrackLength()
Returns the track length.
|
protected int |
getTrackWidth()
Returns the track width.
|
void |
installUI(javax.swing.JComponent c)
Installs the default for this UI delegate in the supplied component.
|
void |
paintFocus(java.awt.Graphics g)
Draws the focus rectangle for the slider.
|
protected void |
paintMajorTickForHorizSlider(java.awt.Graphics g,
java.awt.Rectangle tickBounds,
int x)
Paints the major ticks for a slider with a horizontal orientation.
|
protected void |
paintMajorTickForVertSlider(java.awt.Graphics g,
java.awt.Rectangle tickBounds,
int y)
Paints the major ticks for a slider with a vertical orientation.
|
protected void |
paintMinorTickForHorizSlider(java.awt.Graphics g,
java.awt.Rectangle tickBounds,
int x)
Paints the minor ticks for a slider with a horizontal orientation.
|
protected void |
paintMinorTickForVertSlider(java.awt.Graphics g,
java.awt.Rectangle tickBounds,
int y)
Paints the minor ticks for a slider with a vertical orientation.
|
void |
paintThumb(java.awt.Graphics g)
Paints the thumb icon for the slider.
|
void |
paintTrack(java.awt.Graphics g)
Paints the track along which the thumb control moves.
|
protected void |
scrollDueToClickInTrack(int dir)
This method is called when there has been a click in the track and the
thumb needs to be scrolled on regular intervals.
|
calculateContentRect, calculateFocusRect, calculateGeometry, calculateLabelRect, calculateThumbLocation, calculateThumbSize, calculateTickRect, calculateTrackBuffer, calculateTrackRect, createChangeListener, createComponentListener, createFocusListener, createScrollListener, createTrackListener, drawInverted, getFocusColor, getHeightOfHighValueLabel, getHeightOfLowValueLabel, getHeightOfTallestLabel, getHighestValueLabel, getHighlightColor, getLowestValueLabel, getMaximumSize, getMinimumHorizontalSize, getMinimumSize, getMinimumVerticalSize, getPreferredHorizontalSize, getPreferredSize, getPreferredVerticalSize, getShadowColor, getWidthOfHighValueLabel, getWidthOfLowValueLabel, getWidthOfWidestLabel, installDefaults, installKeyboardActions, installListeners, isDragging, paint, paintHorizontalLabel, paintLabels, paintTicks, paintVerticalLabel, recalculateIfInsetsChanged, recalculateIfOrientationChanged, scrollByBlock, scrollByUnit, setThumbLocation, uninstallKeyboardActions, uninstallListeners, uninstallUI, valueForXPosition, valueForYPosition, xPositionForValue, yPositionForValueprotected static java.awt.Color thumbColor
protected static java.awt.Color highlightColor
protected static java.awt.Color darkShadowColor
protected static int trackWidth
protected static int tickLength
protected static javax.swing.Icon horizThumbIcon
protected static javax.swing.Icon vertThumbIcon
protected final int TICK_BUFFER
protected final java.lang.String SLIDER_FILL
UIManager.protected boolean filledSlider
public MetalSliderUI()
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent component)
MetalSliderUI.component - the component (ignored).MetalSliderUI.public void installUI(javax.swing.JComponent c)
installUI in class javax.swing.plaf.basic.BasicSliderUIc - the component.ComponentUI.uninstallUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()protected java.beans.PropertyChangeListener createPropertyChangeListener(javax.swing.JSlider slider)
createPropertyChangeListener in class javax.swing.plaf.basic.BasicSliderUIslider - the slider.MetalSliderUI.MetalPropertyListener.public void paintThumb(java.awt.Graphics g)
paintThumb in class javax.swing.plaf.basic.BasicSliderUIg - the graphics device.public void paintTrack(java.awt.Graphics g)
paintTrack in class javax.swing.plaf.basic.BasicSliderUIg - the graphics device.public void paintFocus(java.awt.Graphics g)
JSlider has the focus by changing the color of
the thumb control - this is handled elsewhere and so this method is empty
(it overrides the method in the BasicSliderUI class to prevent
a default focus highlight from being drawn).paintFocus in class javax.swing.plaf.basic.BasicSliderUIg - the graphics device.protected java.awt.Dimension getThumbSize()
getThumbSize in class javax.swing.plaf.basic.BasicSliderUIpublic int getTickLength()
getTickLength in class javax.swing.plaf.basic.BasicSliderUIprotected int getTrackWidth()
protected int getTrackLength()
protected int getThumbOverhang()
protected void scrollDueToClickInTrack(int dir)
javax.swing.plaf.basic.BasicSliderUIscrollDueToClickInTrack in class javax.swing.plaf.basic.BasicSliderUIdir - The direction to move in.protected void paintMinorTickForHorizSlider(java.awt.Graphics g, java.awt.Rectangle tickBounds, int x)
paintMinorTickForHorizSlider in class javax.swing.plaf.basic.BasicSliderUIg - the graphics device.tickBounds - the tick bounds.x - the x value for the tick.protected void paintMajorTickForHorizSlider(java.awt.Graphics g, java.awt.Rectangle tickBounds, int x)
paintMajorTickForHorizSlider in class javax.swing.plaf.basic.BasicSliderUIg - the graphics device.tickBounds - the tick bounds.x - the x value for the tick.protected void paintMinorTickForVertSlider(java.awt.Graphics g, java.awt.Rectangle tickBounds, int y)
paintMinorTickForVertSlider in class javax.swing.plaf.basic.BasicSliderUIg - the graphics device.tickBounds - the tick bounds.y - the y value for the tick.protected void paintMajorTickForVertSlider(java.awt.Graphics g, java.awt.Rectangle tickBounds, int y)
paintMajorTickForVertSlider in class javax.swing.plaf.basic.BasicSliderUIg - the graphics device.tickBounds - the tick bounds.y - the y value for the tick.