Class ColorSliderUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.SliderUI
javax.swing.plaf.basic.BasicSliderUI
org.pushingpixels.radiance.theming.internal.ui.RadianceSliderUI
org.pushingpixels.radiance.theming.internal.contrib.randelshofer.quaqua.colorchooser.ColorSliderUI
- All Implemented Interfaces:
TransitionAwareUI
A UI delegate for color sliders. The track of the slider visualizes how
changing the value of the slider affects the color.
- Version:
- 1.0.3 2005-09-11 Tweaked layout and drawing code.
1.0.2 2005-08-28 Color track must always be regenerated if the snapToTicks property changes.
1.0.1 2005-04-18 Fixed an undesired shift of the track on the x-axis.
1.0 29 March 2005 Created.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
class
Track mouse movements.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
FieldsModifier and TypeFieldDescriptionprotected ColorSliderModel
protected Integer
private static final Dimension
private static final Dimension
private static final Dimension
private static final Dimension
private PropertyChangeListener
Listener on property change events.private RolloverControlListener
Listener for transition animations.protected StateTransitionTracker
Listener for transition animations.private ButtonModel
Surrogate button model for tracking the thumb transitions.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
protected void
protected PropertyChangeListener
createPropertyChangeListener
(JSlider slider) protected BasicSliderUI.TrackListener
createTrackListener
(JSlider slider) static ComponentUI
protected int
Gets the height of the tick area for horizontal sliders and the width of the tick area for vertical sliders.Returns the model for tracking the transitions.protected void
installDefaults
(JSlider slider) protected void
installListeners
(JSlider slider) boolean
isInside
(MouseEvent me) Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.private void
paintColorTrack
(Graphics g, int x, int y, int width, int height, int buffer) void
void
void
protected void
uninstallListeners
(JSlider slider) Methods inherited from class org.pushingpixels.radiance.theming.internal.ui.RadianceSliderUI
calculateLabelRect, getIcon, getPreferredSize, getThumbSize, getTrackWidth, paint, paintThumb, setThumbLocation
Methods inherited from class javax.swing.plaf.basic.BasicSliderUI
calculateContentRect, calculateFocusRect, calculateGeometry, calculateThumbSize, calculateTrackBuffer, createChangeListener, createComponentListener, createFocusListener, createScrollListener, drawInverted, getBaseline, getBaselineResizeBehavior, getFocusColor, getHeightOfHighValueLabel, getHeightOfLowValueLabel, getHeightOfTallestLabel, getHighestValue, getHighestValueLabel, getHighlightColor, getLowestValue, getLowestValueLabel, getMaximumSize, getMinimumSize, getShadowColor, getWidthOfHighValueLabel, getWidthOfLowValueLabel, getWidthOfWidestLabel, installKeyboardActions, installUI, isDragging, labelsHaveSameBaselines, paintHorizontalLabel, paintLabels, paintMajorTickForHorizSlider, paintMajorTickForVertSlider, paintMinorTickForHorizSlider, paintMinorTickForVertSlider, paintVerticalLabel, recalculateIfInsetsChanged, recalculateIfOrientationChanged, scrollByBlock, scrollByUnit, scrollDueToClickInTrack, uninstallDefaults, uninstallKeyboardActions, uninstallUI, valueForXPosition, valueForYPosition, xPositionForValue, yPositionForValue, yPositionForValue
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
-
Field Details
-
componentIndex
-
colorSliderModel
-
thumbModel
Surrogate button model for tracking the thumb transitions. -
radianceRolloverListener
Listener for transition animations. -
radiancePropertyChangeListener
Listener on property change events. -
stateTransitionTracker
Listener for transition animations. -
PREFERRED_HORIZONTAL_SIZE
-
PREFERRED_VERTICAL_SIZE
-
MINIMUM_HORIZONTAL_SIZE
-
MINIMUM_VERTICAL_SIZE
-
-
Constructor Details
-
ColorSliderUI
Creates a new instance.
-
-
Method Details
-
createUI
-
installDefaults
- Overrides:
installDefaults
in classRadianceSliderUI
-
installListeners
- Overrides:
installListeners
in classRadianceSliderUI
-
uninstallListeners
- Overrides:
uninstallListeners
in classRadianceSliderUI
-
getPreferredHorizontalSize
- Overrides:
getPreferredHorizontalSize
in classRadianceSliderUI
-
getPreferredVerticalSize
- Overrides:
getPreferredVerticalSize
in classRadianceSliderUI
-
getMinimumHorizontalSize
- Overrides:
getMinimumHorizontalSize
in classBasicSliderUI
-
getMinimumVerticalSize
- Overrides:
getMinimumVerticalSize
in classBasicSliderUI
-
calculateThumbLocation
protected void calculateThumbLocation()- Overrides:
calculateThumbLocation
in classRadianceSliderUI
-
paintTrack
- Overrides:
paintTrack
in classRadianceSliderUI
-
paintTicks
- Overrides:
paintTicks
in classRadianceSliderUI
-
paintFocus
- Overrides:
paintFocus
in classRadianceSliderUI
-
paintColorTrack
-
calculateTrackRect
protected void calculateTrackRect()- Overrides:
calculateTrackRect
in classRadianceSliderUI
-
calculateTickRect
protected void calculateTickRect()- Overrides:
calculateTickRect
in classRadianceSliderUI
-
getTickLength
protected 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. If you want to give your ticks some room, make this larger than you need and paint your ticks away from the sides in paintTicks().- Overrides:
getTickLength
in classRadianceSliderUI
-
createPropertyChangeListener
- Overrides:
createPropertyChangeListener
in classBasicSliderUI
-
createTrackListener
- Overrides:
createTrackListener
in classBasicSliderUI
-
getTransitionTracker
Description copied from interface:TransitionAwareUI
Returns the model for tracking the transitions.- Specified by:
getTransitionTracker
in interfaceTransitionAwareUI
- Overrides:
getTransitionTracker
in classRadianceSliderUI
- Returns:
- Model for tracking the transitions.
-
isInside
Description copied from interface:TransitionAwareUI
Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.- Specified by:
isInside
in interfaceTransitionAwareUI
- Overrides:
isInside
in classRadianceSliderUI
- Parameters:
me
- Mouse event.- Returns:
true
if the mouse position of the specified event lies inside the area of the component designated for transition effects,false
otherwise.
-