Package org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.colorchooser

# Class ColorSliderUI

java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.SliderUI
javax.swing.plaf.basic.BasicSliderUI
org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.colorchooser.ColorSliderUI

All Implemented Interfaces:
  `TransitionAwareUI`

public class ColorSliderUI extends BasicSliderUI implements TransitionAwareUI
A UI delegate for color sliders. The track of the slider visualizes how changing the value of the slider affects the color.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`class`
`ColorSliderUI.CSUIPropertyChangeHandler`
`class`
`ColorSliderUI.QuaquaTrackListener`
Track mouse movements.

## 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 ColorSliderModel`
`colorSliderModel`
`protected Integer`
`componentIndex`
`protected StateTransitionTracker`
`stateTransitionTracker`
Listener for transition animations.

### 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
`ColorSliderUI(JSlider b)`
Creates a new instance.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`calculateThumbLocation()`
`protected void`
`calculateTickRect()`
`protected void`
`calculateTrackRect()`
`protected PropertyChangeListener`
`createPropertyChangeListener(JSlider slider)`
`protected BasicSliderUI.TrackListener`
`createTrackListener(JSlider slider)`
`static ComponentUI`
`createUI(JComponent b)`
`Dimension`
`getMinimumHorizontalSize()`
`Dimension`
`getMinimumVerticalSize()`
`Dimension`
`getPreferredHorizontalSize()`
`Dimension`
`getPreferredVerticalSize()`
`protected Icon`
`getThumbIcon()`
`protected Dimension`
`getThumbSize()`
`protected int`
`getTickLength()`
Gets the height of the tick area for horizontal sliders and the width of the tick area for vertical sliders.
`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`
`paintColorTrack(Graphics g, int x, int y, int width, int height, int buffer)`
`void`
`paintFocus(Graphics g)`
`protected void`
`paintMajorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x)`
`protected void`
`paintMajorTickForVertSlider(Graphics g, Rectangle tickBounds, int y)`
`protected void`
`paintMinorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x)`
`protected void`
`paintMinorTickForVertSlider(Graphics g, Rectangle tickBounds, int y)`
`void`
`paintThumb(Graphics g)`
`void`
`paintTicks(Graphics g)`
`void`
`paintTrack(Graphics g)`
`protected void`
`uninstallListeners(JSlider slider)`

### Methods inherited from class javax.swing.plaf.basic.BasicSliderUI

`calculateContentRect, calculateFocusRect, calculateGeometry, calculateLabelRect, calculateThumbSize, calculateTrackBuffer, createChangeListener, createComponentListener, createFocusListener, createScrollListener, drawInverted, getBaseline, getBaselineResizeBehavior, getFocusColor, getHeightOfHighValueLabel, getHeightOfLowValueLabel, getHeightOfTallestLabel, getHighestValue, getHighestValueLabel, getHighlightColor, getLowestValue, getLowestValueLabel, getMaximumSize, getMinimumSize, getPreferredSize, getShadowColor, getWidthOfHighValueLabel, getWidthOfLowValueLabel, getWidthOfWidestLabel, installKeyboardActions, installUI, isDragging, labelsHaveSameBaselines, paint, paintHorizontalLabel, paintLabels, paintVerticalLabel, recalculateIfInsetsChanged, recalculateIfOrientationChanged, scrollByBlock, scrollByUnit, scrollDueToClickInTrack, setThumbLocation, 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

### componentIndex

protected Integer componentIndex

### colorSliderModel

protected ColorSliderModel colorSliderModel

### stateTransitionTracker

protected StateTransitionTracker stateTransitionTracker
Listener for transition animations.

## Constructor Details

### ColorSliderUI

public ColorSliderUI(JSlider b)
Creates a new instance.

## Method Details

### createUI

public static ComponentUI createUI(JComponent b)

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

### getThumbSize

protected Dimension getThumbSize()

Overrides:
  `getThumbSize` in class `BasicSliderUI`

### getPreferredHorizontalSize

public Dimension getPreferredHorizontalSize()

Overrides:
  `getPreferredHorizontalSize` in class `BasicSliderUI`

### getPreferredVerticalSize

public Dimension getPreferredVerticalSize()

Overrides:
  `getPreferredVerticalSize` in class `BasicSliderUI`

### getMinimumHorizontalSize

public Dimension getMinimumHorizontalSize()

Overrides:
  `getMinimumHorizontalSize` in class `BasicSliderUI`

### getMinimumVerticalSize

public Dimension getMinimumVerticalSize()

Overrides:
  `getMinimumVerticalSize` in class `BasicSliderUI`

### calculateThumbLocation

protected void calculateThumbLocation()

Overrides:
  `calculateThumbLocation` in class `BasicSliderUI`

### getThumbIcon

protected Icon getThumbIcon()

### paintThumb

public void paintThumb(Graphics g)

Overrides:
  `paintThumb` in class `BasicSliderUI`

### paintTrack

public void paintTrack(Graphics g)

Overrides:
  `paintTrack` in class `BasicSliderUI`

### paintTicks

public void paintTicks(Graphics g)

Overrides:
  `paintTicks` in class `BasicSliderUI`

### paintMajorTickForHorizSlider

protected void paintMajorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x)

Overrides:
  `paintMajorTickForHorizSlider` in class `BasicSliderUI`

### paintMinorTickForHorizSlider

protected void paintMinorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x)

Overrides:
  `paintMinorTickForHorizSlider` in class `BasicSliderUI`

### paintMinorTickForVertSlider

protected void paintMinorTickForVertSlider(Graphics g, Rectangle tickBounds, int y)

Overrides:
  `paintMinorTickForVertSlider` in class `BasicSliderUI`

### paintMajorTickForVertSlider

protected void paintMajorTickForVertSlider(Graphics g, Rectangle tickBounds, int y)

Overrides:
  `paintMajorTickForVertSlider` in class `BasicSliderUI`

### paintFocus

public void paintFocus(Graphics g)

Overrides:
  `paintFocus` in class `BasicSliderUI`

### paintColorTrack

public void paintColorTrack(Graphics g, int x, int y, int width, int height, int buffer)

### calculateTrackRect

protected void calculateTrackRect()

Overrides:
  `calculateTrackRect` in class `BasicSliderUI`

### calculateTickRect

protected void calculateTickRect()

Overrides:
  `calculateTickRect` in class `BasicSliderUI`

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

### createPropertyChangeListener

protected PropertyChangeListener createPropertyChangeListener(JSlider slider)

Overrides:
  `createPropertyChangeListener` in class `BasicSliderUI`

### createTrackListener

protected BasicSliderUI.TrackListener createTrackListener(JSlider slider)

Overrides:
  `createTrackListener` 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.