Class SubstanceSliderUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.SliderUI
-
- javax.swing.plaf.basic.BasicSliderUI
-
- org.pushingpixels.substance.internal.ui.SubstanceSliderUI
-
- All Implemented Interfaces:
TransitionAwareUI
public class SubstanceSliderUI extends BasicSliderUI implements TransitionAwareUI
UI for sliders in Substance 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
Fields Modifier and Type Field Description protected IconhorizontalIconIcon for horizontal sliders.protected IconroundIconIcon for sliders without labels and ticks.protected StateTransitionTrackerstateTransitionTrackerprotected static LazyResettableHashMap<BufferedImage>trackCacheCache of track images.protected IconverticalIconIcon 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 Constructor Description SubstanceSliderUI(JSlider slider)Simple constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcalculateLabelRect()protected voidcalculateThumbLocation()protected voidcalculateTickRect()protected voidcalculateTrackRect()static ComponentUIcreateUI(JComponent comp)protected IcongetIcon()Returns the thumb icon for the associated slider.DimensiongetPreferredHorizontalSize()DimensiongetPreferredSize(JComponent c)DimensiongetPreferredVerticalSize()protected intgetThumbOverhang()Returns the amount that the thumb goes past the slide bar.protected DimensiongetThumbSize()protected intgetTickLength()protected intgetTrackWidth()Returns the shorter dimension of the track.StateTransitionTrackergetTransitionTracker()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)voidpaintFocus(Graphics g)voidpaintThumb(Graphics g)voidpaintTicks(Graphics g)voidpaintTrack(Graphics g)voidsetThumbLocation(int x, int y)protected voiduninstallListeners(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 Detail
-
stateTransitionTracker
protected StateTransitionTracker stateTransitionTracker
-
horizontalIcon
protected Icon horizontalIcon
Icon for horizontal sliders.
-
roundIcon
protected Icon roundIcon
Icon for sliders without labels and ticks.
-
verticalIcon
protected Icon verticalIcon
Icon for vertical sliders.
-
trackCache
protected static final LazyResettableHashMap<BufferedImage> trackCache
Cache of track images.
-
-
Constructor Detail
-
SubstanceSliderUI
public SubstanceSliderUI(JSlider slider)
Simple constructor.- Parameters:
slider- Slider.
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent comp)
-
calculateTrackRect
protected void calculateTrackRect()
- Overrides:
calculateTrackRectin classBasicSliderUI
-
paintTrack
public void paintTrack(Graphics g)
- Overrides:
paintTrackin classBasicSliderUI
-
getThumbSize
protected Dimension getThumbSize()
- Overrides:
getThumbSizein classBasicSliderUI
-
getIcon
protected Icon getIcon()
Returns the thumb icon for the associated slider.- Returns:
- The thumb icon for the associated slider.
-
paintThumb
public void paintThumb(Graphics g)
- Overrides:
paintThumbin classBasicSliderUI
-
paint
public void paint(Graphics g, JComponent c)
- Overrides:
paintin classBasicSliderUI
-
getTransitionTracker
public StateTransitionTracker getTransitionTracker()
Description copied from interface:TransitionAwareUIReturns the model for tracking the transitions.- Specified by:
getTransitionTrackerin interfaceTransitionAwareUI- Returns:
- Model for tracking the transitions.
-
isInside
public boolean isInside(MouseEvent me)
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
protected void installDefaults(JSlider slider)
- Overrides:
installDefaultsin classBasicSliderUI
-
installListeners
protected void installListeners(JSlider slider)
- Overrides:
installListenersin classBasicSliderUI
-
uninstallListeners
protected void uninstallListeners(JSlider slider)
- Overrides:
uninstallListenersin classBasicSliderUI
-
paintFocus
public void paintFocus(Graphics g)
- Overrides:
paintFocusin classBasicSliderUI
-
getThumbOverhang
protected int getThumbOverhang()
Returns the amount that the thumb goes past the slide bar.- Returns:
- Amount that the thumb goes past the slide bar.
-
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
public void paintTicks(Graphics g)
- 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
public Dimension getPreferredSize(JComponent c)
- Overrides:
getPreferredSizein classBasicSliderUI
-
setThumbLocation
public void setThumbLocation(int x, int y)- Overrides:
setThumbLocationin classBasicSliderUI
-
getPreferredHorizontalSize
public Dimension getPreferredHorizontalSize()
- Overrides:
getPreferredHorizontalSizein classBasicSliderUI
-
getPreferredVerticalSize
public Dimension getPreferredVerticalSize()
- Overrides:
getPreferredVerticalSizein classBasicSliderUI
-
-