jcontrol.ui.vole.meter
Class DigitalMeter

java.lang.Object
  |
  +--jcontrol.ui.vole.Component
        |
        +--jcontrol.ui.vole.meter.DigitalMeter

public class DigitalMeter
extends Component

The class DigitalMeter draws decimal values with a specified font and a specified number of digits. Several display parameters are user controllable.

(C) DOMOLOGIC Home Automation GmbH 2003

Author:
Wolfgang Klingauf

Field Summary
 
Fields inherited from class jcontrol.ui.vole.Component
focusOwner, font, g, height, listener, parent, visible, width, x, y
 
Constructor Summary
DigitalMeter(int x, int y, int digits, boolean border)
          Creates a new DigitalMeter at the specified x- and y-coordinates.
 
Method Summary
 void paint()
          Draws the digital meter.
 void setValue(int value)
          Sets the value to display on the LCDMeter.
 boolean transferFocus()
          DigitalMeter never gains the input focus.
 void validate()
          Calculate the preferred size of this digital meter.
 
Methods inherited from class jcontrol.ui.vole.Component
getBounds, getParent, isVisible, onActionEvent, onKeyEvent, remove, removeFocus, requestFocus, setBounds, setFont, setGraphics, setLocation, setParent, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, notifyAll, wait
 

Constructor Detail

DigitalMeter

public DigitalMeter(int x,
                    int y,
                    int digits,
                    boolean border)
Creates a new DigitalMeter at the specified x- and y-coordinates. The font used for writing the current meter value can be set by using the method setFont. The width and height of the DigitalMeter are calculated automatically and depend on the used font and the number of digits.

Parameters:
x - The x-coordinate for the upper left of the bounding box.
y - The y-coordinate for the upper left of the bounding box.
digits - The number of digits.
border - When true, a border is painted around the DigitalMeter.
Method Detail

paint

public void paint()
Draws the digital meter.

Overrides:
paint in class Component

setValue

public void setValue(int value)
Sets the value to display on the LCDMeter.

Parameters:
value - the value to show.

transferFocus

public boolean transferFocus()
DigitalMeter never gains the input focus.

Overrides:
transferFocus in class Component
Returns:
true, if the focus was transferred successfully.

validate

public void validate()
Calculate the preferred size of this digital meter.

Overrides:
validate in class Component