Package org.pushingpixels.substance.internal.ui

# 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 Icon`
`horizontalIcon`
Icon for horizontal sliders.
`protected Icon`
`roundIcon`
Icon for sliders without labels and ticks.
`protected StateTransitionTracker`
`stateTransitionTracker`
`protected static final LazyResettableHashMap<BufferedImage>`
`trackCache`
Cache of track images.
`protected Icon`
`verticalIcon`
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
Constructor
Description
`SubstanceSliderUI(JSlider slider)`
Simple constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`calculateLabelRect()`
`protected void`
`calculateThumbLocation()`
`protected void`
`calculateTickRect()`
`protected void`
`calculateTrackRect()`
`static ComponentUI`
`createUI(JComponent comp)`
`protected Icon`
`getIcon()`
Returns the thumb icon for the associated slider.
`Dimension`
`getPreferredHorizontalSize()`
`Dimension`
`getPreferredSize(JComponent c)`
`Dimension`
`getPreferredVerticalSize()`
`protected int`
`getThumbOverhang()`
Returns the amount that the thumb goes past the slide bar.
`protected Dimension`
`getThumbSize()`
`protected int`
`getTickLength()`
`protected int`
`getTrackWidth()`
Returns the shorter dimension of the track.
`StateTransitionTracker`
`getTransitionTracker()`
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`
`paintFocus(Graphics g)`
`void`
`paintThumb(Graphics g)`
`void`
`paintTicks(Graphics g)`
`void`
`paintTrack(Graphics g)`
`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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### 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 Details

### SubstanceSliderUI

public SubstanceSliderUI(JSlider slider)
Simple constructor.

Parameters:
  `slider` - Slider.

## Method Details

### createUI

public static ComponentUI createUI(JComponent comp)

### calculateTrackRect

protected void calculateTrackRect()

Overrides:
  `calculateTrackRect` in class `BasicSliderUI`

### paintTrack

public void paintTrack(Graphics g)

Overrides:
  `paintTrack` in class `BasicSliderUI`

### getThumbSize

protected Dimension getThumbSize()

Overrides:
  `getThumbSize` in class `BasicSliderUI`

### 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:
  `paintThumb` in class `BasicSliderUI`

### paint

public void paint(Graphics g, JComponent c)

Overrides:
  `paint` in class `BasicSliderUI`

### getTransitionTracker

public StateTransitionTracker getTransitionTracker()
Description copied from interface: `TransitionAwareUI`
Returns the model for tracking the transitions.

Specified by:
  `getTransitionTracker` in interface `TransitionAwareUI`
Returns:
  Model for tracking the transitions.

### isInside

public boolean isInside(MouseEvent me)
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 interface `TransitionAwareUI`
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

protected void installDefaults(JSlider slider)

Overrides:
  `installDefaults` in class `BasicSliderUI`

### installListeners

protected void installListeners(JSlider slider)

Overrides:
  `installListeners` in class `BasicSliderUI`

### uninstallListeners

protected void uninstallListeners(JSlider slider)

Overrides:
  `uninstallListeners` in class `BasicSliderUI`

### paintFocus

public void paintFocus(Graphics g)

Overrides:
  `paintFocus` in class `BasicSliderUI`

### 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:
  `getTickLength` in class `BasicSliderUI`

### paintTicks

public void paintTicks(Graphics g)

Overrides:
  `paintTicks` in class `BasicSliderUI`

### calculateTickRect

protected void calculateTickRect()

Overrides:
  `calculateTickRect` in class `BasicSliderUI`

### calculateLabelRect

protected void calculateLabelRect()

Overrides:
  `calculateLabelRect` in class `BasicSliderUI`

### calculateThumbLocation

protected void calculateThumbLocation()

Overrides:
  `calculateThumbLocation` in class `BasicSliderUI`

### getPreferredSize

public Dimension getPreferredSize(JComponent c)

Overrides:
  `getPreferredSize` in class `BasicSliderUI`

### setThumbLocation

public void setThumbLocation(int x, int y)

Overrides:
  `setThumbLocation` in class `BasicSliderUI`

### getPreferredHorizontalSize

public Dimension getPreferredHorizontalSize()

Overrides:
  `getPreferredHorizontalSize` in class `BasicSliderUI`

### getPreferredVerticalSize

public Dimension getPreferredVerticalSize()

Overrides:
  `getPreferredVerticalSize` in class `BasicSliderUI`