jcontrol.ui.vole.meter
Class LCDMeter

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

public class LCDMeter
extends Component

This class LCDMeter.class provides a seven-segment-based lcd-style counter with a variable number of digits. The digits of the LCDMeter are freely scalable.

(C) DOMOLOGIC Home Automation GmbH 2003

Version:
1.1
Author:
Marcus Timmermann, Wolfgang Klingauf

Field Summary
 
Fields inherited from class jcontrol.ui.vole.Component
focusOwner, font, g, height, listener, parent, visible, width, x, y
 
Constructor Summary
LCDMeter(int x, int y, int width, int height, int digits)
          Creates a new LCDMeter.
LCDMeter(int x, int y, int width, int height, int digits, boolean border)
          Constructs a bordered LCDMeter.
 
Method Summary
 void paint()
          Repaints the LCDMeter.
 void setBounds(int x, int y, int width, int height)
          Sets a new position and size for the LCDMeter.
 void setGraphics(jcontrol.io.Graphics g)
          This method is called to set the main Display context for this component
 void setLocation(int x, int y)
          Moves this LCDMeter to a new location.
 void setValue(int value)
          Sets the value to display on the LCDMeter.
 boolean transferFocus()
          LCDMeter never gains the input focus.
 
Methods inherited from class jcontrol.ui.vole.Component
getBounds, getParent, isVisible, onActionEvent, onKeyEvent, remove, removeFocus, requestFocus, setFont, setParent, setVisible, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, notifyAll, wait
 

Constructor Detail

LCDMeter

public LCDMeter(int x,
                int y,
                int width,
                int height,
                int digits)
Creates a new LCDMeter.

NOTE: The size of the seven-segment digits will depent on the number of desired digits and the size of the bounding box.

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.
width - the width of the bounding box.
height - the height of the bounding box.
digits - the number of digits.

LCDMeter

public LCDMeter(int x,
                int y,
                int width,
                int height,
                int digits,
                boolean border)
Constructs a bordered LCDMeter.

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.
width - the width of the bounding box.
height - the height of the bounding box.
digits - the number of digits.
border - if true a border is painted around the LCDMeter (default is off).
Method Detail

paint

public void paint()
Repaints the LCDMeter.

Overrides:
paint in class Component

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Sets a new position and size for the LCDMeter. The component is repainted.

Overrides:
setBounds in class Component
Parameters:
x - the new x coordinate
y - the new y coordinate
width - the new width
height - the new height

setGraphics

public void setGraphics(jcontrol.io.Graphics g)
This method is called to set the main Display context for this component. * Normally, this is done only for the top-level container, then, all child components are set automatically.

Overrides:
setGraphics in class Component
Parameters:
g - the Display

setLocation

public void setLocation(int x,
                        int y)
Moves this LCDMeter to a new location.

Overrides:
setLocation in class Component
Parameters:
x - the x-coordinate of the new location's top-left corner.
y - the y-coordinate of the new location's top-left corner.

setValue

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

Parameters:
value - the value to show.

transferFocus

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

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