pivot.wtk.skin.terra
Class TerraMeterSkin

java.lang.Object
  extended by pivot.wtk.skin.ComponentSkin
      extended by pivot.wtk.skin.terra.TerraMeterSkin
All Implemented Interfaces:
ComponentKeyListener, ComponentLayoutListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ConstrainedVisual, MeterListener, Skin, Visual

public class TerraMeterSkin
extends ComponentSkin
implements MeterListener

Meter skin.

Author:
tvolkert

Field Summary
 
Fields inherited from class pivot.wtk.skin.ComponentSkin
SHOW_TOOLTIP_TIMEOUT
 
Constructor Summary
TerraMeterSkin()
           
 
Method Summary
 java.awt.Color getColor()
           
 java.awt.Color getGridColor()
           
 float getGridFrequency()
           
 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.
 void install(Component component)
          Associates a skin with a component.
 boolean isFocusable()
          By default, components are focusable.
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 void paint(java.awt.Graphics2D graphics)
          Paints the visual.
 void percentageChanged(Meter meter, double previousPercentage)
          Listener for meter percentage changes.
 void setColor(java.awt.Color color)
           
 void setColor(java.lang.String color)
           
 void setGridColor(java.awt.Color gridColor)
           
 void setGridColor(java.lang.String gridColor)
           
 void setGridFrequency(float gridFrequency)
           
 void setGridFrequency(java.lang.Number gridFrequency)
           
 void textChanged(Meter meter, java.lang.String previousText)
          Listener for meter text changes.
 void uninstall()
          Dissociates a skin from a component.
 
Methods inherited from class pivot.wtk.skin.ComponentSkin
cursorChanged, decodeColor, displayableChanged, enabledChanged, focusedChanged, getComponent, getHeight, getWidth, invalidateComponent, keyPressed, keyReleased, keyTyped, locationChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, parentChanged, preferredSizeChanged, 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
 

Constructor Detail

TerraMeterSkin

public TerraMeterSkin()
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 ComponentSkin
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 ComponentSkin

isFocusable

public boolean isFocusable()
Description copied from class: ComponentSkin
By default, components are focusable.

Specified by:
isFocusable in interface Skin
Overrides:
isFocusable in class ComponentSkin
Returns:
true if this skin is focusable; false, otherwise.

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
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
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.

Specified by:
layout in interface Skin

paint

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

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

getColor

public java.awt.Color getColor()

setColor

public void setColor(java.awt.Color color)

setColor

public final void setColor(java.lang.String color)

getGridColor

public java.awt.Color getGridColor()

setGridColor

public void setGridColor(java.awt.Color gridColor)

setGridColor

public final void setGridColor(java.lang.String gridColor)

getGridFrequency

public float getGridFrequency()

setGridFrequency

public void setGridFrequency(float gridFrequency)

setGridFrequency

public final void setGridFrequency(java.lang.Number gridFrequency)

percentageChanged

public void percentageChanged(Meter meter,
                              double previousPercentage)
Listener for meter percentage changes.

Specified by:
percentageChanged in interface MeterListener
Parameters:
meter - The source of the event.
previousPercentage - The previous percentage value.

textChanged

public void textChanged(Meter meter,
                        java.lang.String previousText)
Listener for meter text changes.

Specified by:
textChanged in interface MeterListener
Parameters:
meter - The source of the event.
previousText - The previous text value.