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

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

public class TerraMeterSkin
extends ComponentSkin
implements MeterListener

Meter skin.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.MeterListener
MeterListener.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
 
Constructor Summary
TerraMeterSkin()
           
 
Method Summary
 int getBaseline(int width, int height)
          Returns the baseline for a given width and height.
 Color getColor()
           
 Font getFont()
           
 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.
 Color getTextColor()
           
 Color getTextFillColor()
           
 void install(Component component)
          Associates a skin with a component.
 boolean isFocusable()
          By default, skins are focusable.
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 void orientationChanged(Meter meter)
          Listener for meter orientation changes.
 void paint(Graphics2D graphics)
          Paints the visual.
 void percentageChanged(Meter meter, double previousPercentage)
          Listener for meter percentage changes.
 void setColor(Color color)
           
 void setColor(String color)
           
 void setFont(Dictionary<String,?> font)
           
 void setFont(Font font)
           
 void setFont(String font)
           
 void setGridColor(Color gridColor)
           
 void setGridColor(String gridColor)
           
 void setGridFrequency(float gridFrequency)
           
 void setGridFrequency(Number gridFrequency)
           
 void setTextColor(Color color)
           
 void setTextColor(String color)
           
 void setTextFillColor(Color color)
           
 void setTextFillColor(String color)
           
 void textChanged(Meter meter, String previousText)
          Listener for meter text changes.
 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, enabledChanged, focusedChanged, getBaseline, getComponent, getHeight, getWidth, heightLimitsChanged, invalidateComponent, isOpaque, keyPressed, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseClick, 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
 

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.

isFocusable

public boolean isFocusable()
Description copied from class: ComponentSkin
By default, skins 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

getBaseline

public int getBaseline(int width,
                       int height)
Description copied from interface: ConstrainedVisual
Returns the baseline for a given width and height.

Specified by:
getBaseline in interface ConstrainedVisual
Overrides:
getBaseline in class ComponentSkin
Returns:
The baseline relative to the origin of this visual, or -1 if this visual does not have a baseline.

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(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 Color getColor()

setColor

public void setColor(Color color)

setColor

public final void setColor(String color)

getGridColor

public Color getGridColor()

setGridColor

public void setGridColor(Color gridColor)

setGridColor

public final void setGridColor(String gridColor)

getTextColor

public Color getTextColor()

setTextColor

public void setTextColor(Color color)

setTextColor

public final void setTextColor(String color)

getTextFillColor

public Color getTextFillColor()

setTextFillColor

public void setTextFillColor(Color color)

setTextFillColor

public final void setTextFillColor(String color)

getGridFrequency

public float getGridFrequency()

setGridFrequency

public void setGridFrequency(float gridFrequency)

setGridFrequency

public final void setGridFrequency(Number gridFrequency)

getFont

public Font getFont()

setFont

public void setFont(Font font)

setFont

public final void setFont(String font)

setFont

public final void setFont(Dictionary<String,?> font)

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

orientationChanged

public void orientationChanged(Meter meter)
Listener for meter orientation changes.

Specified by:
orientationChanged in interface MeterListener
Parameters:
meter - The source of the event.