|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.SliderUI
javax.swing.plaf.basic.BasicSliderUI
javax.swing.plaf.metal.MetalSliderUI
public class MetalSliderUI
A UI delegate for the JSlider component.
| Nested Class Summary | |
|---|---|
protected class |
MetalSliderUI.MetalPropertyListener
A property change handler that updates the rendered component in response to specific property change events. |
| Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicSliderUI |
|---|
BasicSliderUI.ActionScroller, BasicSliderUI.ChangeHandler, BasicSliderUI.ComponentHandler, BasicSliderUI.FocusHandler, BasicSliderUI.PropertyChangeHandler, BasicSliderUI.ScrollListener, BasicSliderUI.TrackListener |
| Field Summary | |
|---|---|
protected static 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 Color |
highlightColor
The highlight color used for drawing the track rect when the slider is enabled. |
protected static Icon |
horizThumbIcon
The icon used for the thumb control of horizontally oriented sliders. |
protected String |
SLIDER_FILL
A key to look up the filledSlider setting in the UIManager. |
protected static 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 Icon |
vertThumbIcon
The icon used for the thumb control of vertically oriented sliders. |
| Fields inherited from 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 | |
|---|---|
MetalSliderUI()
Constructs a new instance. |
|
| Method Summary | |
|---|---|
protected PropertyChangeListener |
createPropertyChangeListener(JSlider slider)
Creates a property change listener for the slider. |
static ComponentUI |
createUI(JComponent component)
Returns a new instance of MetalSliderUI. |
protected int |
getThumbOverhang()
Returns the thumb overhang. |
protected 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(JComponent c)
Installs the default for this UI delegate in the supplied component. |
void |
paintFocus(Graphics g)
Draws the focus rectangle for the slider. |
protected void |
paintMajorTickForHorizSlider(Graphics g,
Rectangle tickBounds,
int x)
Paints the major ticks for a slider with a horizontal orientation. |
protected void |
paintMajorTickForVertSlider(Graphics g,
Rectangle tickBounds,
int y)
Paints the major ticks for a slider with a vertical orientation. |
protected void |
paintMinorTickForHorizSlider(Graphics g,
Rectangle tickBounds,
int x)
Paints the minor ticks for a slider with a horizontal orientation. |
protected void |
paintMinorTickForVertSlider(Graphics g,
Rectangle tickBounds,
int y)
Paints the minor ticks for a slider with a vertical orientation. |
void |
paintThumb(Graphics g)
Paints the thumb icon for the slider. |
void |
paintTrack(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. |
| Methods inherited from class javax.swing.plaf.ComponentUI |
|---|
contains, getAccessibleChild, getAccessibleChildrenCount, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Color thumbColor
protected static Color highlightColor
protected static Color darkShadowColor
protected static int trackWidth
protected static int tickLength
protected static Icon horizThumbIcon
protected static Icon vertThumbIcon
protected final int TICK_BUFFER
protected final String SLIDER_FILL
UIManager.
protected boolean filledSlider
| Constructor Detail |
|---|
public MetalSliderUI()
| Method Detail |
|---|
public static ComponentUI createUI(JComponent component)
MetalSliderUI.
component - the component (ignored).
MetalSliderUI.public void installUI(JComponent c)
installUI in class BasicSliderUIc - the component.ComponentUI.uninstallUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()protected PropertyChangeListener createPropertyChangeListener(JSlider slider)
createPropertyChangeListener in class BasicSliderUIslider - the slider.
MetalSliderUI.MetalPropertyListener.public void paintThumb(Graphics g)
paintThumb in class BasicSliderUIg - the graphics device.public void paintTrack(Graphics g)
paintTrack in class BasicSliderUIg - the graphics device.public void paintFocus(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 BasicSliderUIg - the graphics device.protected Dimension getThumbSize()
getThumbSize in class BasicSliderUIpublic int getTickLength()
getTickLength in class BasicSliderUIprotected int getTrackWidth()
protected int getTrackLength()
protected int getThumbOverhang()
protected void scrollDueToClickInTrack(int dir)
BasicSliderUI
scrollDueToClickInTrack in class BasicSliderUIdir - The direction to move in.
protected void paintMinorTickForHorizSlider(Graphics g,
Rectangle tickBounds,
int x)
paintMinorTickForHorizSlider in class BasicSliderUIg - the graphics device.tickBounds - the tick bounds.x - the x value for the tick.
protected void paintMajorTickForHorizSlider(Graphics g,
Rectangle tickBounds,
int x)
paintMajorTickForHorizSlider in class BasicSliderUIg - the graphics device.tickBounds - the tick bounds.x - the x value for the tick.
protected void paintMinorTickForVertSlider(Graphics g,
Rectangle tickBounds,
int y)
paintMinorTickForVertSlider in class BasicSliderUIg - the graphics device.tickBounds - the tick bounds.y - the y value for the tick.
protected void paintMajorTickForVertSlider(Graphics g,
Rectangle tickBounds,
int y)
paintMajorTickForVertSlider in class BasicSliderUIg - the graphics device.tickBounds - the tick bounds.y - the y value for the tick.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||