DESY ACOP Beans Home

com.cosylab.gui.components.gauger
Class ValueLabel

java.lang.Object
  extended by com.cosylab.gui.components.gauger.ValueLabel

public class ValueLabel
extends java.lang.Object

/** Value label displays value of gauger in textual form.

Version:
$id$
Author:
Ales Pucelj

Constructor Summary
ValueLabel(Gauger gauger)
          Constructor for ValueLabel.
 
Method Summary
 void draw(java.awt.Graphics2D g)
          Renders this component.
 java.awt.Rectangle getBounds()
          Returns bounds of this label.
 java.lang.String getFormat()
          Returns format used by this label.
 java.lang.String getUnits()
          Returns units symbol to append to text.
 boolean isChangeSignificant()
          Returns whether the change is signifficant.
 boolean isUnitsVisible()
          Returns true if units are visible.
 void setFormat(java.lang.String newFormat)
          Sets format for this label.
 void setPosition(int x, int y)
          Sets center position of this component.
 void setUnits(java.lang.String newUnits)
          Sets units to append to text.
 void setUnitsVisible(boolean b)
          Sets the units visibility.
 void setValue(double value)
          Sets new value to display.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueLabel

public ValueLabel(Gauger gauger)
Constructor for ValueLabel.

Parameters:
gauger - Gauger on which this value will display.
Method Detail

getBounds

public java.awt.Rectangle getBounds()
Returns bounds of this label.

Returns:
Bounds of text.

getFormat

public java.lang.String getFormat()
Returns format used by this label.

Returns:
C-Style format.

getUnits

public java.lang.String getUnits()
Returns units symbol to append to text.

Returns:
Units.

setValue

public void setValue(double value)
Sets new value to display. Value will be formatted according to the format specified and will have units symbol appended to it.

Parameters:
value - New value to display.

isChangeSignificant

public boolean isChangeSignificant()
Returns whether the change is signifficant.

Returns:
True if text has changed.

draw

public void draw(java.awt.Graphics2D g)
Renders this component.

Parameters:
g - Context to render to.

setPosition

public void setPosition(int x,
                        int y)
Sets center position of this component.

Parameters:
x - coordinate of label center.
y - coordinate of label center.

setFormat

public void setFormat(java.lang.String newFormat)
Sets format for this label.

Parameters:
newFormat - C-Style format.
See Also:
setValue()

setUnits

public void setUnits(java.lang.String newUnits)
Sets units to append to text.

Parameters:
newUnits - Units symbol.
See Also:
setValue()

setUnitsVisible

public void setUnitsVisible(boolean b)
Sets the units visibility.

Parameters:
b -

isUnitsVisible

public boolean isUnitsVisible()
Returns true if units are visible.

Returns:


Copyright © 2010. All Rights Reserved.