jcontrol.ui.vole.meter
Class AnalogClock

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

public class AnalogClock
extends Component

This class provides an analog clock for JControl.

(C) DOMOLOGIC Home Automation GmbH 2003

Version:
1.3
Author:
Marcus Timmermann, Wolfgang Klingauf
See Also:
Time, RTC

Field Summary
static boolean NO
           
protected  int size
           
static boolean YES
           
 
Fields inherited from class jcontrol.ui.vole.Component
focusOwner, font, g, height, listener, parent, visible, width, x, y
 
Constructor Summary
protected AnalogClock()
          Empty constructor for jcontrol.toolkit.Clock
  AnalogClock(int x, int y, int size)
          Creates a clock.
  AnalogClock(int x, int y, int size, boolean second)
          Creates a clock.
 
Method Summary
 void paint()
          Repaints the clock dial.
 void setTime(int hours, int minutes, int seconds)
          Sets a the specified time to the clock.
 boolean transferFocus()
          We never gain the input focus.
 void update()
          Updates the clock with the current time.
 
Methods inherited from class jcontrol.ui.vole.Component
getBounds, getParent, isVisible, onActionEvent, onKeyEvent, remove, removeFocus, requestFocus, setBounds, setFont, setGraphics, setLocation, setParent, setVisible, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, notifyAll, wait
 

Field Detail

NO

public static final boolean NO
See Also:
Constant Field Values

size

protected int size

YES

public static final boolean YES
See Also:
Constant Field Values
Constructor Detail

AnalogClock

protected AnalogClock()
Empty constructor for jcontrol.toolkit.Clock


AnalogClock

public AnalogClock(int x,
                   int y,
                   int size)
Creates a clock.

Parameters:
x - the upper left x coordinate
y - the upper left y coordinate
size - the clock radius

AnalogClock

public AnalogClock(int x,
                   int y,
                   int size,
                   boolean second)
Creates a clock.

Parameters:
x - the upper left x coordinate
y - the upper left y coordinate
size - the clock radius
second - show seconds (YES or NO)
Method Detail

paint

public void paint()
Repaints the clock dial. This will not do a time update!

Overrides:
paint in class Component

setTime

public void setTime(int hours,
                    int minutes,
                    int seconds)
Sets a the specified time to the clock.

Parameters:
hours - hours

transferFocus

public boolean transferFocus()
We never gain the input focus.

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

update

public void update()
Updates the clock with the current time.