|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdasher.CDasherComponent
public class CDasherComponent
DasherComponent is the base class of most functional units of Dasher, and serves to provide a number of common functions and services to its children. These include:
Generally speaking, a single EventHandler and SettingsStore should be created during Dasher's initialisation, and a reference to both passed to each created DasherComponent. However, there is no reason why in future there could not be multiple subgroups of components which are not connected, and by virtue of having seperate EventHandlers and SettingsStores would not hear each other's events, or be effected by each other's parameter changes.
It is, however, not recommended that any two components should share a SettingsStore without also sharing an EventHandler, as the SettingsStore raises an Event to notify whenever a parameter is changed, a behaviour which components may depend upon.
| Field Summary | |
|---|---|
protected CEventHandler |
m_EventHandler
This Component's EventHandler |
protected CSettingsStore |
m_SettingsStore
This Component's SettingsStore |
| Constructor Summary | |
|---|---|
CDasherComponent(CEventHandler EventHandler,
CSettingsStore SettingsStore)
Sole constructor. |
|
| Method Summary | |
|---|---|
boolean |
GetBoolParameter(Ebp_parameters iParameter)
Retreives the value of a given global boolean parameter. |
long |
GetLongParameter(Elp_parameters iParameter)
Retreives the value of a given global long parameter. |
java.lang.String |
GetParameterName(EParameters iParameter)
Retrieves the friendly name of a given parameter. |
int |
GetParameterType(EParameters iParameter)
Determines the type of some parameter; this is exactly the same as checking whether it is an instance of Ebp_parameters (boolean), Elp_parameters (long) or Esp_parameters (string). |
java.lang.String |
GetStringParameter(Esp_parameters iParameter)
Retreives the value of a given global string parameter. |
void |
HandleEvent(CEvent pEvent)
Called by the EventHandler to notify this component of an event raised by another. |
void |
InsertEvent(CEvent Event)
Dispatches a new event, which will be passed to the HandleEvent of all other components registered with the EventHandler. |
void |
SetBoolParameter(Ebp_parameters iParameter,
boolean bValue)
Sets the value of a given boolean parameter by calling the SettingsStore's SetBoolParameter method. |
void |
SetLongParameter(Elp_parameters iParameter,
long lValue)
Sets the value of a given long parameter by calling the SettingsStore's SetBoolParameter method. |
void |
SetStringParameter(Esp_parameters iParameter,
java.lang.String sValue)
Sets the value of a given string parameter by calling the SettingsStore's SetBoolParameter method. |
void |
UnregisterComponent()
Unregisters this component with the EventHandler, preventing the receipt of any further events, though new ones can still be dispatched. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CEventHandler m_EventHandler
protected CSettingsStore m_SettingsStore
| Constructor Detail |
|---|
public CDasherComponent(CEventHandler EventHandler,
CSettingsStore SettingsStore)
EventHandler - Event handler with which to register. Must not be null.SettingsStore - Settings store to be used to get and set parameters. Must not be null.| Method Detail |
|---|
public void UnregisterComponent()
public void InsertEvent(CEvent Event)
Event - Event we wish to pass to other components.public void HandleEvent(CEvent pEvent)
pEvent - Event received.public boolean GetBoolParameter(Ebp_parameters iParameter)
This request is actioned by calling the same method on m_SettingsStore
iParameter - Parameter to retrieve
public long GetLongParameter(Elp_parameters iParameter)
This request is actioned by calling the same method on m_SettingsStore
iParameter - Parameter to retrieve
public java.lang.String GetStringParameter(Esp_parameters iParameter)
This request is actioned by calling the same method on m_SettingsStore
iParameter - Parameter to retrieve
public void SetBoolParameter(Ebp_parameters iParameter,
boolean bValue)
iParameter - Parameter to setbValue - New value for this parameter
public void SetLongParameter(Elp_parameters iParameter,
long lValue)
iParameter - Parameter to setlValue - New value for this parameter
public void SetStringParameter(Esp_parameters iParameter,
java.lang.String sValue)
iParameter - Parameter to setsValue - New value for this parameterpublic int GetParameterType(EParameters iParameter)
public java.lang.String GetParameterName(EParameters iParameter)
Useful for dumping a complete human-readable configuration.
iParameter - Parameter we wish to identify
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||