net.thestump.ghronos.timing
Class TimingStyle

java.lang.Object
  extended bynet.thestump.ghronos.timing.TimingStyle
All Implemented Interfaces:
superwaba.ext.xplat.io.Storable
Direct Known Subclasses:
Boggle, DelayStyle, OvertimeStyle, Standard

public abstract class TimingStyle
extends java.lang.Object
implements superwaba.ext.xplat.io.Storable

Base class for all timing styles

Author:
Christopher C. Stump

Field Summary
protected  boolean appliedToBottomClock
           
protected  boolean appliedToTopClock
           
protected  Clock toStart
           
protected  Clock toStop
           
 
Constructor Summary
TimingStyle()
           
 
Method Summary
 void applyTo(boolean topClock, boolean bottomClock)
          Sets which clocks this timing style is applied to
protected  void evaluate(Clock topClock, Clock bottomClock)
          Helper method used to set members describing current state
abstract  void execute(Clock topClock, Clock bottomClock)
          Applies the timing style to the appropriate clocks on a clock switch
abstract  java.lang.String getDescription()
          Gets a description of this timing style which is used to display information about the timing style in a help dialog
abstract  byte getID()
           
abstract  superwaba.ext.xplat.io.Storable getInstance()
           
 boolean isAppliedTo(char clock)
          Tells if this timing style is applied to the top or bottom clock
 void loadState(superwaba.ext.xplat.io.DataStream ds)
           
 void onRegister(Clock topClock, Clock bottomClock)
          Called when this TimingStyle is registered with the Mediator.
 void onUnRegister(Clock topClock, Clock bottomClock)
          Called when this TimingStyle is unregistered with the Mediator (when another TimingStyle is registered).
 void saveState(superwaba.ext.xplat.io.DataStream ds)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

toStart

protected Clock toStart

toStop

protected Clock toStop

appliedToTopClock

protected boolean appliedToTopClock

appliedToBottomClock

protected boolean appliedToBottomClock
Constructor Detail

TimingStyle

public TimingStyle()
Method Detail

execute

public abstract void execute(Clock topClock,
                             Clock bottomClock)
Applies the timing style to the appropriate clocks on a clock switch

Parameters:
topClock - The application's top clock
bottomClock - The application's bottom clock

getDescription

public abstract java.lang.String getDescription()
Gets a description of this timing style which is used to display information about the timing style in a help dialog

Returns:
A brief description of how the timing style operates.

onRegister

public void onRegister(Clock topClock,
                       Clock bottomClock)
Called when this TimingStyle is registered with the Mediator. Is a place holder to do work before just before the timing style is actually used. Does nothing by default. Note that this method IS NOT called when a timing style is recalled from the database

Parameters:
topClock -
bottomClock -

onUnRegister

public void onUnRegister(Clock topClock,
                         Clock bottomClock)
Called when this TimingStyle is unregistered with the Mediator (when another TimingStyle is registered). Is a place holder to do work before just before the timing style is trashed. Does nothing by default.

Parameters:
topClock -
bottomClock -

applyTo

public void applyTo(boolean topClock,
                    boolean bottomClock)
Sets which clocks this timing style is applied to

Parameters:
topClock - true if the timing style should be applied to the top clock, false otherwise
bottomClock - true if the timing style should be applied to the bottom clock, false otherwise

isAppliedTo

public boolean isAppliedTo(char clock)
Tells if this timing style is applied to the top or bottom clock

Parameters:
clock - 't' if we want to test for the top clock, 'b' if we want to test for the bottom clock
Returns:
true if this timing style is applied to the queried clock, false otherwise
Throws:
BadArgumentException - If clock is not 't' or 'b'

getID

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

getInstance

public abstract superwaba.ext.xplat.io.Storable getInstance()
Specified by:
getInstance 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

loadState

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

evaluate

protected void evaluate(Clock topClock,
                        Clock bottomClock)
Helper method used to set members describing current state

Parameters:
topClock - The application's topmost clock
bottomClock - The application's bottommost clock


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