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 TypeClassDescriptionclassclassTrack mouse movements.Nested classes/interfaces inherited from class BasicSliderUI
BasicSliderUI.ActionScroller, BasicSliderUI.ChangeHandler, BasicSliderUI.ComponentHandler, BasicSliderUI.FocusHandler, BasicSliderUI.PropertyChangeHandler, BasicSliderUI.ScrollListener, BasicSliderUI.TrackListener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ColorSliderModelprotected Integerprivate static final Dimensionprivate static final Dimensionprivate static final Dimensionprivate static final Dimensionprivate PropertyChangeListenerListener on property change events.private RolloverControlListenerListener for transition animations.protected StateTransitionTrackerListener for transition animations.private ButtonModelSurrogate button model for tracking the thumb transitions.Fields inherited from class 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 voidprotected voidprotected voidprotected PropertyChangeListenercreatePropertyChangeListener(JSlider slider) protected BasicSliderUI.TrackListenercreateTrackListener(JSlider slider) static ComponentUIprotected intGets 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 voidinstallDefaults(JSlider slider) protected voidinstallListeners(JSlider slider) booleanisInside(MouseEvent me) Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.private voidpaintColorTrack(Graphics g, int x, int y, int width, int height, int buffer) voidvoidvoidprotected voiduninstallListeners(JSlider slider) Methods inherited from class RadianceSliderUI
calculateLabelRect, getIcon, getPreferredSize, getThumbSize, getTrackWidth, paint, paintThumb, setThumbLocationMethods inherited from class 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, yPositionForValueMethods inherited from class 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:
installDefaultsin classRadianceSliderUI
-
installListeners
- Overrides:
installListenersin classRadianceSliderUI
-
uninstallListeners
- Overrides:
uninstallListenersin classRadianceSliderUI
-
getPreferredHorizontalSize
- Overrides:
getPreferredHorizontalSizein classRadianceSliderUI
-
getPreferredVerticalSize
- Overrides:
getPreferredVerticalSizein classRadianceSliderUI
-
getMinimumHorizontalSize
- Overrides:
getMinimumHorizontalSizein classBasicSliderUI
-
getMinimumVerticalSize
- Overrides:
getMinimumVerticalSizein classBasicSliderUI
-
calculateThumbLocation
protected void calculateThumbLocation()- Overrides:
calculateThumbLocationin classRadianceSliderUI
-
paintTrack
- Overrides:
paintTrackin classRadianceSliderUI
-
paintTicks
- Overrides:
paintTicksin classRadianceSliderUI
-
paintFocus
- Overrides:
paintFocusin classRadianceSliderUI
-
paintColorTrack
-
calculateTrackRect
protected void calculateTrackRect()- Overrides:
calculateTrackRectin classRadianceSliderUI
-
calculateTickRect
protected void calculateTickRect()- Overrides:
calculateTickRectin 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:
getTickLengthin classRadianceSliderUI
-
createPropertyChangeListener
- Overrides:
createPropertyChangeListenerin classBasicSliderUI
-
createTrackListener
- Overrides:
createTrackListenerin classBasicSliderUI
-
getTransitionTracker
Description copied from interface:TransitionAwareUIReturns the model for tracking the transitions.- Specified by:
getTransitionTrackerin interfaceTransitionAwareUI- Overrides:
getTransitionTrackerin classRadianceSliderUI- Returns:
- Model for tracking the transitions.
-
isInside
Description copied from interface:TransitionAwareUIChecks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.- Specified by:
isInsidein interfaceTransitionAwareUI- Overrides:
isInsidein classRadianceSliderUI- Parameters:
me- Mouse event.- Returns:
trueif the mouse position of the specified event lies inside the area of the component designated for transition effects,falseotherwise.
-