uavsim.graphics.controls
Class ControlCallbackEvent

java.lang.Object
  extended by uavsim.graphics.controls.ControlCallbackEvent

public class ControlCallbackEvent
extends java.lang.Object

Defines a callback event from a control. It could be polymorphic, but for simplicity in teaching, it combines all possible states and expects the originator and recipient to agree on which are valid.

Author:
Dan Tappan [23.06.11]

Nested Class Summary
static class ControlCallbackEvent.E_StateChange
          Provides the interpretation of an event.
 
Field Summary
private  java.lang.String _id
          the unique event identifier
private  ControlCallbackEvent.E_StateChange _stateChange
          the state change as a result of the event
 
Constructor Summary
ControlCallbackEvent(java.lang.String id)
          Creates a callback event with no state change.
ControlCallbackEvent(java.lang.String id, ControlCallbackEvent.E_StateChange stateChange)
          Creates a callback event.
 
Method Summary
 java.lang.String getID()
          Gets the unique event identifier.
 ControlCallbackEvent.E_StateChange getStateChange()
          Gets the state change as a result of the event.
 boolean hasStateChange()
          Returns whether there is a state change.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_id

private final java.lang.String _id
the unique event identifier


_stateChange

private final ControlCallbackEvent.E_StateChange _stateChange
the state change as a result of the event

Constructor Detail

ControlCallbackEvent

public ControlCallbackEvent(java.lang.String id)
Creates a callback event with no state change.

Parameters:
id - - the unique event identifier

ControlCallbackEvent

public ControlCallbackEvent(java.lang.String id,
                            ControlCallbackEvent.E_StateChange stateChange)
Creates a callback event.

Parameters:
id - - the unique event identifier
stateChange - - the state change as a result of the event
Method Detail

getID

public java.lang.String getID()
Gets the unique event identifier.

Returns:
the identifier

getStateChange

public ControlCallbackEvent.E_StateChange getStateChange()
Gets the state change as a result of the event. This is valid only if there is a state change.

Returns:
the state

hasStateChange

public boolean hasStateChange()
Returns whether there is a state change.

Returns:
the result

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object