net.thestump.ghronos.ui.clock
Class ModalClock

java.lang.Object
  extended bywaba.ui.Control
      extended bywaba.ui.Container
          extended bynet.thestump.ghronos.ui.clock.Clock
              extended bynet.thestump.ghronos.ui.clock.DecreaseClock
                  extended bynet.thestump.ghronos.ui.clock.ModalClock
All Implemented Interfaces:
waba.fx.ISurface, superwaba.ext.xplat.io.Storable
Direct Known Subclasses:
ScrabbleClock

public class ModalClock
extends DecreaseClock

A clock that counts up or down depending on the mode it is in.

Author:
Christopher C. Stump

Field Summary
static int COUNT_DOWN
          Count down mode
static int COUNT_UP
          Count up mode
static byte ID
          unique ID for this clock
protected  int mode
           
 
Fields inherited from class net.thestump.ghronos.ui.clock.Clock
digits, HR1, HR2, leftColon, mediator, MIN1, MIN2, myName, paused, rightColon, SEC1, SEC2
 
Fields inherited from class waba.ui.Container
BORDER_LOWERED, BORDER_NONE, BORDER_RAISED, BORDER_SIMPLE, children, lastH, lastW, lastX, lastY, parentWindow, tail
 
Fields inherited from class waba.ui.Control
AFTER, appId, asContainer, asWindow, backColor, backDis, BEFORE, BOTTOM, CENTER, enabled, FILL, FIT, fm, fmH, focusLess, font, foreColor, foreDis, height, LEFT, parent, PREFERRED, RANGE, RIGHT, SAME, TOP, visible, width, x, x2, y, y2
 
Constructor Summary
ModalClock()
          Counts down, has no time limit set, and is not dashed by default.
 
Method Summary
 byte getID()
           
 superwaba.ext.xplat.io.Storable getInstance()
           
 void loadState(superwaba.ext.xplat.io.DataStream ds)
           
 void saveState(superwaba.ext.xplat.io.DataStream ds)
           
 void setMode(int m)
          Sets the way this clock counts
protected  void tick()
          Ticks the clock.
 
Methods inherited from class net.thestump.ghronos.ui.clock.Clock
addTimer, equals, getName, getTime, isOutOfTime, onEvent, onStart, pause, setAdjust, setName, setTime, start, stop
 
Methods inherited from class waba.ui.Container
add, add, add, broadcastEvent, findChild, getChildren, getClientRect, getClientRect, onAdd, onColorsChanged, onPaint, onRemove, paintChildren, remove, setBorderStyle, setEnabled
 
Methods inherited from class waba.ui.Control
contains, createGraphics, getAbsoluteRect, getBackColor, getFont, getFontMetrics, getForeColor, getNext, getParent, getParentWindow, getPos, getPreferredHeight, getPreferredWidth, getRect, getSize, isDisplayed, isEnabled, isVisible, onBoundsChanged, onFontChanged, onWindowPaintFinished, postEvent, removeTimer, repaint, repaintNow, requestFocus, setBackColor, setBackForeColors, setFocusLess, setFont, setForeColor, setRect, setRect, setRect, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final byte ID
unique ID for this clock

See Also:
Constant Field Values

COUNT_UP

public static final int COUNT_UP
Count up mode

See Also:
Constant Field Values

COUNT_DOWN

public static final int COUNT_DOWN
Count down mode

See Also:
Constant Field Values

mode

protected int mode
Constructor Detail

ModalClock

public ModalClock()
Counts down, has no time limit set, and is not dashed by default.

Method Detail

getID

public byte getID()
Specified by:
getID in interface superwaba.ext.xplat.io.Storable
Overrides:
getID in class DecreaseClock

getInstance

public superwaba.ext.xplat.io.Storable getInstance()
Specified by:
getInstance in interface superwaba.ext.xplat.io.Storable
Overrides:
getInstance in class DecreaseClock

setMode

public void setMode(int m)
Sets the way this clock counts

Parameters:
m - COUNT_UP for the clock's time to increase, COUNT_DOWN for the clock's time to decrease.

saveState

public void saveState(superwaba.ext.xplat.io.DataStream ds)
Specified by:
saveState in interface superwaba.ext.xplat.io.Storable
Overrides:
saveState in class Clock

loadState

public void loadState(superwaba.ext.xplat.io.DataStream ds)
Specified by:
loadState in interface superwaba.ext.xplat.io.Storable
Overrides:
loadState in class Clock

tick

protected void tick()
Description copied from class: Clock
Ticks the clock. Does nothing by default. Subclass must override.

Overrides:
tick in class DecreaseClock


Copyright © 2004 Christopher C. Stump. All Rights Reserved.