org.apache.pivot.wtk.skin.terra
Class TerraSliderSkin

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

public class TerraSliderSkin
extends SliderSkin

Terra slider skin.


Nested Class Summary
protected  class TerraSliderSkin.Thumb
          Slider thumb component.
protected  class TerraSliderSkin.ThumbSkin
          Slider thumb skin.
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.SliderListener
SliderListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerListener
ContainerListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerMouseListener
ContainerMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter
 
Field Summary
static int DEFAULT_WIDTH
           
(package private)  Point dragOffset
           
static int MINIMUM_THUMB_HEIGHT
           
static int MINIMUM_THUMB_WIDTH
           
 
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()
           
 int getTickSpacing()
           
 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.
 boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count)
          Called when a mouse button is clicked over a component.
 void orientationChanged(Slider slider)
          Called when a sliders's orientation has changed.
 void paint(Graphics2D graphics)
          Paints the visual.
 void rangeChanged(Slider slider, int previousStart, int previousEnd)
          Called when a slider's range has changed.
 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 setTickSpacing(int tickSpacing)
           
 void setTickSpacing(Number tickSpacing)
           
 void setTrackColor(Color trackColor)
           
 void setTrackColor(String trackColor)
           
 void setTrackWidth(int trackWidth)
           
 void setTrackWidth(Number trackWidth)
           
 void valueChanged(Slider slider, int previousValue)
          Called when a slider's value has changed.
 
Methods inherited from class org.apache.pivot.wtk.skin.ContainerSkin
componentInserted, componentMoved, componentsRemoved, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, isOpaque, mouseDown, mouseMove, mouseUp, mouseWheel, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint, setBackgroundPaint
 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, enabledChanged, focusedChanged, getBaseline, getBaseline, getComponent, getHeight, getWidth, heightLimitsChanged, invalidateComponent, keyPressed, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dragOffset

Point dragOffset

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.

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)

getTickSpacing

public int getTickSpacing()

setTickSpacing

public void setTickSpacing(int tickSpacing)

setTickSpacing

public void setTickSpacing(Number tickSpacing)

mouseClick

public boolean mouseClick(Component component,
                          Mouse.Button button,
                          int x,
                          int y,
                          int count)
Description copied from interface: ComponentMouseButtonListener
Called when a mouse button is clicked over a component.

Specified by:
mouseClick in interface ComponentMouseButtonListener
Overrides:
mouseClick in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

rangeChanged

public void rangeChanged(Slider slider,
                         int previousStart,
                         int previousEnd)
Description copied from interface: SliderListener
Called when a slider's range has changed.


orientationChanged

public void orientationChanged(Slider slider)
Description copied from interface: SliderListener
Called when a sliders's orientation has changed.

Parameters:
slider - The source of the event.

valueChanged

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