net.thestump.ghronos.ui.state
Class StateLabel

java.lang.Object
  extended bywaba.ui.Control
      extended bywaba.ui.Label
          extended bynet.thestump.ghronos.ui.state.StateLabel
All Implemented Interfaces:
waba.fx.ISurface, superwaba.ext.xplat.io.Storable
Direct Known Subclasses:
BoggleStateLabel, CanadianBYStateLabel, JapaneseBYStateLabel

public class StateLabel
extends waba.ui.Label
implements superwaba.ext.xplat.io.Storable

Provides an object to update the text and background of Ghronos' play indicator

Author:
Christopher C. Stump

Field Summary
static byte ID
          Storable/factory id
protected  Mediator mediator
           
protected  java.lang.String msg
           
protected static java.lang.String PREFIX
           
protected static StateLabel stateLabel
           
 
Fields inherited from class waba.ui.Label
align, commonVGap
 
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
StateLabel()
           
 
Method Summary
protected  int calculateMove()
          Calculates current move count
 byte getID()
           
 superwaba.ext.xplat.io.Storable getInstance()
           
static StateLabel instance()
          Singleton accessor for the application's StateLabel
 void loadState(superwaba.ext.xplat.io.DataStream ds)
           
 void saveState(superwaba.ext.xplat.io.DataStream ds)
           
 void setActiveGameState(TimingStyle timingStyle)
          Controls the status of a game in progress
 void setEndGameState(boolean topClockOutOfTime)
          Controls the status of the end of a game
 void setPauseState()
          Controls the status of a paused game
 void setStartGameState()
          Controls the status of the beginning of a game
 
Methods inherited from class waba.ui.Label
canScroll, getPreferredHeight, getPreferredWidth, getText, onBoundsChanged, onColorsChanged, onFontChanged, onPaint, scroll, set3d, setInvert, setText
 
Methods inherited from class waba.ui.Control
addTimer, contains, createGraphics, getAbsoluteRect, getBackColor, getFont, getFontMetrics, getForeColor, getNext, getParent, getParentWindow, getPos, getRect, getSize, isDisplayed, isEnabled, isVisible, onEvent, onWindowPaintFinished, postEvent, removeTimer, repaint, repaintNow, requestFocus, setBackColor, setBackForeColors, setEnabled, 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
Storable/factory id

See Also:
Constant Field Values

PREFIX

protected static final java.lang.String PREFIX

msg

protected java.lang.String msg

mediator

protected Mediator mediator

stateLabel

protected static StateLabel stateLabel
Constructor Detail

StateLabel

public StateLabel()
Method Detail

instance

public static StateLabel instance()
Singleton accessor for the application's StateLabel

Returns:
The MainWindow's StateLabel

setPauseState

public void setPauseState()
Controls the status of a paused game

Throws:
BadArgumentException - If there was an internal method call error

setStartGameState

public void setStartGameState()
Controls the status of the beginning of a game


setEndGameState

public void setEndGameState(boolean topClockOutOfTime)
Controls the status of the end of a game

Parameters:
topClockOutOfTime - true if the top clock is all zeros, false otherwise

setActiveGameState

public void setActiveGameState(TimingStyle timingStyle)
Controls the status of a game in progress

Parameters:
timingStyle - The currently used timing style
Throws:
BadArgumentException - If there was an internal method call error

getID

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

getInstance

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

loadState

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

saveState

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

calculateMove

protected int calculateMove()
Calculates current move count

Returns:
Depending on the move count style that the user currently has selected, the move count


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