pivot.wtk.skin.terra
Class TerraSliderSkin

java.lang.Object
  extended by pivot.wtk.skin.ComponentSkin
      extended by pivot.wtk.skin.ContainerSkin
          extended by pivot.wtk.skin.SliderSkin
              extended by pivot.wtk.skin.terra.TerraSliderSkin
All Implemented Interfaces:
ComponentKeyListener, ComponentLayoutListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ConstrainedVisual, ContainerListener, Skin, SliderListener, SliderValueListener, Visual

public class TerraSliderSkin
extends SliderSkin

Terra slider skin.

Author:
gbrown

Nested Class Summary
protected  class TerraSliderSkin.Thumb
          Slider thumb component.
protected  class TerraSliderSkin.ThumbSkin
          Slider thumb skin.
 
Nested classes/interfaces inherited from class pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentListener
ComponentListener.Adapter
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter
 
Field Summary
static int DEFAULT_WIDTH
           
static int MINIMUM_THUMB_HEIGHT
           
static int MINIMUM_THUMB_WIDTH
           
 
Fields inherited from class pivot.wtk.skin.ComponentSkin
SHOW_TOOLTIP_TIMEOUT
 
Constructor Summary
TerraSliderSkin()
           
 
Method Summary
 Color getButtonBackgroundColor()
           
 Color getButtonBorderColor()
           
 int getPreferredHeight(int width)
          Returns the visual's preferred height given the provided width constraint.
 Dimensions getPreferredSize()
          Returns the visual's unconstrained preferred size.
 int getPreferredWidth(int height)
          Returns the visual's preferred width given the provided height constraint.
 int getThumbHeight()
           
 int getThumbWidth()
           
 Color getTrackColor()
           
 int getTrackWidth()
           
 void install(Component component)
          Associates a skin with a component.
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 void paint(Graphics2D graphics)
          Paints the visual.
 void setButtonBackgroundColor(Color buttonBackgroundColor)
           
 void setButtonBackgroundColor(String buttonBackgroundColor)
           
 void setButtonBorderColor(Color buttonBorderColor)
           
 void setButtonBorderColor(String buttonBorderColor)
           
 void setThumbHeight(int thumbHeight)
           
 void setThumbHeight(Number thumbHeight)
           
 void setThumbWidth(int thumbWidth)
           
 void setThumbWidth(Number thumbWidth)
           
 void setTrackColor(Color trackColor)
           
 void setTrackColor(String trackColor)
           
 void setTrackWidth(int trackWidth)
           
 void setTrackWidth(Number trackWidth)
           
 void uninstall()
          Dissociates a skin from a component.
 void valueChanged(Slider slider, int previousValue)
          Called when a slider's value has changed.
 
Methods inherited from class pivot.wtk.skin.SliderSkin
boundsChanged
 
Methods inherited from class pivot.wtk.skin.ContainerSkin
componentInserted, componentsRemoved, contextKeyChanged, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, isOpaque, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint
 
Methods inherited from class pivot.wtk.skin.ComponentSkin
cursorChanged, displayableChanged, enabledChanged, focusedChanged, getComponent, getHeight, getWidth, invalidateComponent, keyPressed, keyReleased, keyTyped, locationChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, styleUpdated, tooltipTextChanged, visibleChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WIDTH

public static final int DEFAULT_WIDTH
See Also:
Constant Field Values

MINIMUM_THUMB_WIDTH

public static final int MINIMUM_THUMB_WIDTH
See Also:
Constant Field Values

MINIMUM_THUMB_HEIGHT

public static final int MINIMUM_THUMB_HEIGHT
See Also:
Constant Field Values
Constructor Detail

TerraSliderSkin

public TerraSliderSkin()
Method Detail

install

public void install(Component component)
Description copied from interface: Skin
Associates a skin with a component.

Specified by:
install in interface Skin
Overrides:
install in class SliderSkin
Parameters:
component - The component to which the skin is being attached.

uninstall

public void uninstall()
Description copied from interface: Skin
Dissociates a skin from a component.

Specified by:
uninstall in interface Skin
Overrides:
uninstall in class SliderSkin

getPreferredWidth

public int getPreferredWidth(int height)
Description copied from interface: ConstrainedVisual
Returns the visual's preferred width given the provided height constraint.

Specified by:
getPreferredWidth in interface ConstrainedVisual
Overrides:
getPreferredWidth in class ContainerSkin
Parameters:
height - The height by which to constrain the preferred width, or -1 for no constraint.

getPreferredHeight

public int getPreferredHeight(int width)
Description copied from interface: ConstrainedVisual
Returns the visual's preferred height given the provided width constraint.

Specified by:
getPreferredHeight in interface ConstrainedVisual
Overrides:
getPreferredHeight in class ContainerSkin
Parameters:
width - The width by which to constrain the preferred height, or -1 for no constraint.

getPreferredSize

public Dimensions getPreferredSize()
Description copied from interface: ConstrainedVisual
Returns the visual's unconstrained preferred size.

Specified by:
getPreferredSize in interface ConstrainedVisual
Overrides:
getPreferredSize in class ComponentSkin

layout

public void layout()
Description copied from interface: Skin
If the component on which the skin is installed is a container, lays out the container's children.


paint

public void paint(Graphics2D graphics)
Description copied from interface: Visual
Paints the visual.

Specified by:
paint in interface Visual
Overrides:
paint in class ContainerSkin
Parameters:
graphics - The graphics context in which to paint the visual.

getTrackColor

public Color getTrackColor()

setTrackColor

public void setTrackColor(Color trackColor)

setTrackColor

public final void setTrackColor(String trackColor)

getTrackWidth

public int getTrackWidth()

setTrackWidth

public void setTrackWidth(int trackWidth)

setTrackWidth

public void setTrackWidth(Number trackWidth)

getButtonBackgroundColor

public Color getButtonBackgroundColor()

setButtonBackgroundColor

public void setButtonBackgroundColor(Color buttonBackgroundColor)

setButtonBackgroundColor

public final void setButtonBackgroundColor(String buttonBackgroundColor)

getButtonBorderColor

public Color getButtonBorderColor()

setButtonBorderColor

public void setButtonBorderColor(Color buttonBorderColor)

setButtonBorderColor

public final void setButtonBorderColor(String buttonBorderColor)

getThumbWidth

public int getThumbWidth()

setThumbWidth

public void setThumbWidth(int thumbWidth)

setThumbWidth

public void setThumbWidth(Number thumbWidth)

getThumbHeight

public int getThumbHeight()

setThumbHeight

public void setThumbHeight(int thumbHeight)

setThumbHeight

public void setThumbHeight(Number thumbHeight)

valueChanged

public void valueChanged(Slider slider,
                         int previousValue)
Description copied from interface: SliderValueListener
Called when a slider's value has changed.

Specified by:
valueChanged in interface SliderValueListener
Overrides:
valueChanged in class SliderSkin