Class RadianceSliderUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.SliderUI
javax.swing.plaf.basic.BasicSliderUI
org.pushingpixels.radiance.theming.internal.ui.RadianceSliderUI
- All Implemented Interfaces:
TransitionAwareUI
- Direct Known Subclasses:
ColorSliderUI
UI for sliders in Radiance look and feel.
-
Nested Class Summary
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 TypeFieldDescriptionprivate IconIcon for horizontal sliders.private BladeContainerColorTokensprivate PropertyChangeListenerListener on property change events.private RolloverControlListenerListener for transition animations.private IconIcon for sliders without labels and ticks.private StateTransitionTrackerprivate ButtonModelSurrogate button model for tracking the thumb transitions.private IconIcon for vertical sliders.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 voidstatic ComponentUIcreateUI(JComponent comp) protected IcongetIcon()Returns the thumb icon for the associated slider.private RectangleReturns the rectangle of track for painting.protected Dimensionprotected intprotected intReturns the shorter dimension of the track.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.voidpaint(Graphics g, JComponent c) voidprivate static voidpaintSliderTrack1X(JSlider slider, Graphics2D graphics1X, ContainerColorTokens colorTokens, int width, int height, double scaleFactor, ComponentState currState) private static voidpaintSliderTrackSelected1X(JSlider slider, Graphics2D graphics1X, boolean drawInverted, Rectangle thumbRect, Rectangle paintRect, ContainerColorTokens colorTokens, int width, int height, double scaleFactor, ComponentState currState) Paints the selected part of the slider track.voidvoidvoidvoidsetThumbLocation(int x, int y) protected voiduninstallListeners(JSlider slider) Methods inherited from class BasicSliderUI
calculateContentRect, calculateFocusRect, calculateGeometry, calculateThumbSize, calculateTrackBuffer, createChangeListener, createComponentListener, createFocusListener, createPropertyChangeListener, createScrollListener, createTrackListener, drawInverted, getBaseline, getBaselineResizeBehavior, getFocusColor, getHeightOfHighValueLabel, getHeightOfLowValueLabel, getHeightOfTallestLabel, getHighestValue, getHighestValueLabel, getHighlightColor, getLowestValue, getLowestValueLabel, getMaximumSize, getMinimumHorizontalSize, getMinimumSize, getMinimumVerticalSize, 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
-
thumbModel
Surrogate button model for tracking the thumb transitions. -
radianceRolloverListener
Listener for transition animations. -
radiancePropertyChangeListener
Listener on property change events. -
stateTransitionTracker
-
horizontalIcon
Icon for horizontal sliders. -
roundIcon
Icon for sliders without labels and ticks. -
verticalIcon
Icon for vertical sliders. -
mutableColorTokens
-
-
Constructor Details
-
RadianceSliderUI
-
-
Method Details
-
createUI
-
calculateTrackRect
protected void calculateTrackRect()- Overrides:
calculateTrackRectin classBasicSliderUI
-
getPaintTrackRect
Returns the rectangle of track for painting.- Returns:
- The rectangle of track for painting.
-
paintTrack
- Overrides:
paintTrackin classBasicSliderUI
-
paintSliderTrack1X
private static void paintSliderTrack1X(JSlider slider, Graphics2D graphics1X, ContainerColorTokens colorTokens, int width, int height, double scaleFactor, ComponentState currState) -
paintSliderTrackSelected1X
private static void paintSliderTrackSelected1X(JSlider slider, Graphics2D graphics1X, boolean drawInverted, Rectangle thumbRect, Rectangle paintRect, ContainerColorTokens colorTokens, int width, int height, double scaleFactor, ComponentState currState) Paints the selected part of the slider track.- Parameters:
graphics1X- Graphics.drawInverted- Indicates whether the value-range shown for the slider is reversed.paintRect- Selected portion.colorTokens- Color tokens.width- Track width.height- Track height.
-
getThumbSize
- Overrides:
getThumbSizein classBasicSliderUI
-
getIcon
Returns the thumb icon for the associated slider.- Returns:
- The thumb icon for the associated slider.
-
paintThumb
- Overrides:
paintThumbin classBasicSliderUI
-
paint
- Overrides:
paintin classBasicSliderUI
-
getTransitionTracker
Description copied from interface:TransitionAwareUIReturns the model for tracking the transitions.- Specified by:
getTransitionTrackerin interfaceTransitionAwareUI- 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- 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.
-
installDefaults
- Overrides:
installDefaultsin classBasicSliderUI
-
installListeners
- Overrides:
installListenersin classBasicSliderUI
-
uninstallListeners
- Overrides:
uninstallListenersin classBasicSliderUI
-
paintFocus
- Overrides:
paintFocusin classBasicSliderUI
-
getTrackWidth
protected int getTrackWidth()Returns the shorter dimension of the track.- Returns:
- Shorter dimension of the track.
-
getTickLength
protected int getTickLength()- Overrides:
getTickLengthin classBasicSliderUI
-
paintTicks
- Overrides:
paintTicksin classBasicSliderUI
-
calculateTickRect
protected void calculateTickRect()- Overrides:
calculateTickRectin classBasicSliderUI
-
calculateLabelRect
protected void calculateLabelRect()- Overrides:
calculateLabelRectin classBasicSliderUI
-
calculateThumbLocation
protected void calculateThumbLocation()- Overrides:
calculateThumbLocationin classBasicSliderUI
-
getPreferredSize
- Overrides:
getPreferredSizein classBasicSliderUI
-
setThumbLocation
public void setThumbLocation(int x, int y) - Overrides:
setThumbLocationin classBasicSliderUI
-
getPreferredHorizontalSize
- Overrides:
getPreferredHorizontalSizein classBasicSliderUI
-
getPreferredVerticalSize
- Overrides:
getPreferredVerticalSizein classBasicSliderUI
-