dasher
Class CStartHandler

java.lang.Object
  extended by dasher.CDasherComponent
      extended by dasher.CStartHandler
Direct Known Subclasses:
CCircleStartHandler

public abstract class CStartHandler
extends CDasherComponent

A start handler is a helper to an input filter which serves the purpose of starting and stopping Dasher.

At present they are only supported by CDefaultFilter.

Its Timer event will be called during its parent filter's Timer event; similarly it will be given a chance to draw itself in the DecorateView phase within its parent's DecorateView call.


Field Summary
protected  CDasherInterfaceBase m_Interface
          Interface which this Start Handler should control
 
Fields inherited from class dasher.CDasherComponent
m_EventHandler, m_SettingsStore
 
Constructor Summary
CStartHandler(CEventHandler EventHandler, CSettingsStore SettingsStore, CDasherInterfaceBase Interface)
          Creates a new start handler which controls a given Interface
 
Method Summary
abstract  boolean DecorateView(CDasherView View)
          Similar to its companion method in CInputFilter, this gives the start handler an opportunity to draw itself and other relevant decorations during the production of a new frame.
abstract  void HandleEvent(CEvent Event)
          Event handler
abstract  void Timer(long iTime, CDasherView m_DasherView, CDasherModel m_DasherModel)
          Fired during the start handler's parent input filter's Timer event.
 
Methods inherited from class dasher.CDasherComponent
GetBoolParameter, GetLongParameter, GetParameterName, GetParameterType, GetStringParameter, InsertEvent, SetBoolParameter, SetLongParameter, SetStringParameter, UnregisterComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Interface

protected CDasherInterfaceBase m_Interface
Interface which this Start Handler should control

Constructor Detail

CStartHandler

public CStartHandler(CEventHandler EventHandler,
                     CSettingsStore SettingsStore,
                     CDasherInterfaceBase Interface)
Creates a new start handler which controls a given Interface

Parameters:
EventHandler - Event handler with which to register ourselves
SettingsStore - Settings repository to use
Interface - Interface this Start Handler should control
Method Detail

DecorateView

public abstract boolean DecorateView(CDasherView View)
Similar to its companion method in CInputFilter, this gives the start handler an opportunity to draw itself and other relevant decorations during the production of a new frame.

Start handlers should ensure that this method can reliably terminate quickly, or performance will be greatly degraded.

Parameters:
View - View to which we should draw decorations
Returns:
True if any decorating was done, false otherwise

Timer

public abstract void Timer(long iTime,
                           CDasherView m_DasherView,
                           CDasherModel m_DasherModel)
Fired during the start handler's parent input filter's Timer event. This is when the start handler should interact with the Model if necessary. Despite the availability of a View, no drawing should be done at this stage; if this event makes drawing necessary it should be stored in the class' state for now and drawn at the next call to DecorateView.

Parameters:
iTime - Current system time as a unix timestamp
m_DasherView - View which we may use for co-ordinate transforms and to get input co-ordinates
m_DasherModel - Model which may be modified if we wish

HandleEvent

public abstract void HandleEvent(CEvent Event)
Event handler

Overrides:
HandleEvent in class CDasherComponent
Parameters:
Event - Event received.
See Also:
CEventHandler