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 javax.swing.plaf.basic.BasicSliderUI
BasicSliderUI.ActionScroller, BasicSliderUI.ChangeHandler, BasicSliderUI.ComponentHandler, BasicSliderUI.FocusHandler, BasicSliderUI.PropertyChangeHandler, BasicSliderUI.ScrollListener, BasicSliderUI.TrackListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Icon
Icon for horizontal sliders.private BladeColorScheme
private BladeColorScheme
private PropertyChangeListener
Listener on property change events.private RolloverControlListener
Listener for transition animations.private Icon
Icon for sliders without labels and ticks.private StateTransitionTracker
private ButtonModel
Surrogate button model for tracking the thumb transitions.private Icon
Icon for vertical 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
protected void
protected void
static ComponentUI
createUI
(JComponent comp) protected Icon
getIcon()
Returns the thumb icon for the associated slider.private Rectangle
Returns the rectangle of track for painting.protected Dimension
protected int
protected int
Returns the shorter dimension of the track.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.void
paint
(Graphics g, JComponent c) void
private void
paintSliderTrack1X
(Graphics2D graphics1X, RadianceColorScheme fillColorScheme, RadianceColorScheme borderScheme, int width, int height, double scaleFactor) private void
paintSliderTrackSelected1X
(Graphics2D graphics1X, boolean drawInverted, Rectangle paintRect, RadianceColorScheme fillScheme, RadianceColorScheme borderScheme, int width, int height, double scaleFactor) Paints the selected part of the slider track.void
void
void
void
setThumbLocation
(int x, int y) protected void
uninstallListeners
(JSlider slider) Methods inherited from class javax.swing.plaf.basic.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, yPositionForValue
Methods inherited from class javax.swing.plaf.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. -
mutableFillColorScheme
-
mutableBorderColorScheme
-
-
Constructor Details
-
RadianceSliderUI
Simple constructor.- Parameters:
slider
- Slider.
-
-
Method Details
-
createUI
-
calculateTrackRect
protected void calculateTrackRect()- Overrides:
calculateTrackRect
in classBasicSliderUI
-
getPaintTrackRect
Returns the rectangle of track for painting.- Returns:
- The rectangle of track for painting.
-
paintTrack
- Overrides:
paintTrack
in classBasicSliderUI
-
paintSliderTrack1X
private void paintSliderTrack1X(Graphics2D graphics1X, RadianceColorScheme fillColorScheme, RadianceColorScheme borderScheme, int width, int height, double scaleFactor) -
paintSliderTrackSelected1X
private void paintSliderTrackSelected1X(Graphics2D graphics1X, boolean drawInverted, Rectangle paintRect, RadianceColorScheme fillScheme, RadianceColorScheme borderScheme, int width, int height, double scaleFactor) 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.fillScheme
- Fill color scheme.borderScheme
- Border color scheme.width
- Track width.height
- Track height.
-
getThumbSize
- Overrides:
getThumbSize
in classBasicSliderUI
-
getIcon
Returns the thumb icon for the associated slider.- Returns:
- The thumb icon for the associated slider.
-
paintThumb
- Overrides:
paintThumb
in classBasicSliderUI
-
paint
- Overrides:
paint
in classBasicSliderUI
-
getTransitionTracker
Description copied from interface:TransitionAwareUI
Returns the model for tracking the transitions.- Specified by:
getTransitionTracker
in interfaceTransitionAwareUI
- 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
- 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.
-
installDefaults
- Overrides:
installDefaults
in classBasicSliderUI
-
installListeners
- Overrides:
installListeners
in classBasicSliderUI
-
uninstallListeners
- Overrides:
uninstallListeners
in classBasicSliderUI
-
paintFocus
- Overrides:
paintFocus
in classBasicSliderUI
-
getTrackWidth
protected int getTrackWidth()Returns the shorter dimension of the track.- Returns:
- Shorter dimension of the track.
-
getTickLength
protected int getTickLength()- Overrides:
getTickLength
in classBasicSliderUI
-
paintTicks
- Overrides:
paintTicks
in classBasicSliderUI
-
calculateTickRect
protected void calculateTickRect()- Overrides:
calculateTickRect
in classBasicSliderUI
-
calculateLabelRect
protected void calculateLabelRect()- Overrides:
calculateLabelRect
in classBasicSliderUI
-
calculateThumbLocation
protected void calculateThumbLocation()- Overrides:
calculateThumbLocation
in classBasicSliderUI
-
getPreferredSize
- Overrides:
getPreferredSize
in classBasicSliderUI
-
setThumbLocation
public void setThumbLocation(int x, int y) - Overrides:
setThumbLocation
in classBasicSliderUI
-
getPreferredHorizontalSize
- Overrides:
getPreferredHorizontalSize
in classBasicSliderUI
-
getPreferredVerticalSize
- Overrides:
getPreferredVerticalSize
in classBasicSliderUI
-