mauda
Class ExerciseUpdateEvent

java.lang.Object
  extended by mauda.ExerciseUpdateEvent

public class ExerciseUpdateEvent
extends java.lang.Object

A semantic event which indicates that a exercise-defined event occured. This high-level event is generated at different places in the whole project, and is normally passed through the queue of JedasPanel, and then transmitted to every ExerciseUpdateListener object, that registered to receive such events using the Exercise's addExerciseUpdateListener method. This event is essential for sychronizing objects with the scheduler (animation).

Author:
Markus Krebs

Field Summary
static int BACK
          ID that indicates that an undo was made
static int CLEAR_FOLLOWING
          ID that indicates that all data-structures should delete related to the actual position all following operations.
static int CLEAR_PRECEDING
          ID that indicates that all data-structures should delete their previous stored information related to e.g. already executed operations.
static int DSOBJECT_HIDE
          ID that indicates to hide the animation-object
static int DSOBJECT_SHOW
          ID that indicates to show a previously hidden animation- object.
static int END_OF_EXECUTION
          ID that indicates that all operations in the current queue are fully executed by the JedasPanel.
static int FILENAME_CHANGED
          ID that indicates that the filename of the current exercise was changed.
static int FINISHED_LOADING
          ID that indicates that the exercise was finished in loading.
static int FORWARD
          ID that indicates that a redo was made
static int FORWARD_ANIMATED
          ID that indicates that a animated redo was made.
static int FULL_LOADED
          ID that indicates that an exercise is fully loaded
static int JUMP
          ID that indicates that the user is jumped to another operation.
static int OPERATION_EXECUTED
          ID that indicates that a operation was executed.
static int PLUGIN_CHANGED
          ID that indicates that the plug in was changed.
static int REDO
          ID that indicates that a real redo occured
static int RESET
          ID that indicates that the exercise was cleared.
static int RESUME_EXECUTION
          ID that indicates that the Jedas-Animation resumes from suspend.
static int SPECIAL
          ID for special events.
static int START_OF_EXECUTION
          ID that indicates that the JedasPanel starts the execution of passed operations/events to the queue.
static int SUSPEND_EXECUTION
          ID that indicates that the Jedas-Animation goes in suspend-Mode.
static int UNDO
          ID that indicates that a real undo occured
 
Constructor Summary
ExerciseUpdateEvent(SimpleExercise ex, int id)
          Creates an event
 
Method Summary
 boolean dsChanged()
          Returns TRUE if the current event changes the data-structure, what means that e.g. the display have to be updated.
 SimpleExercise getExercise()
          Returns the exercise-object the event belongs to.
 int getID()
          Returns the ID of the event
 java.lang.String getMessage()
          Returns the message field of the event
 SimpleOperation getOperation()
          Returns the operation.
 int getValue()
          Returns the value-field.
 void setMessage(java.lang.String m)
          Sets the message field of the event
 void setOperation(SimpleOperation so)
          Sets the operation for the current event.
 void setValue(int value)
          Sets the value field of an event.
 java.lang.String toString()
          Returns a string-representation of the event-object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SPECIAL

public static final int SPECIAL
ID for special events. Further event-specific information is stored in message

See Also:
Constant Field Values

OPERATION_EXECUTED

public static final int OPERATION_EXECUTED
ID that indicates that a operation was executed.

See Also:
Constant Field Values

FILENAME_CHANGED

public static final int FILENAME_CHANGED
ID that indicates that the filename of the current exercise was changed.

See Also:
Constant Field Values

CLEAR_PRECEDING

public static final int CLEAR_PRECEDING
ID that indicates that all data-structures should delete their previous stored information related to e.g. already executed operations. For example for OperationRecorder this event will clear all previous stored operations.

See Also:
Constant Field Values

CLEAR_FOLLOWING

public static final int CLEAR_FOLLOWING
ID that indicates that all data-structures should delete related to the actual position all following operations.

See Also:
CLEAR_PRECEDING, Constant Field Values

FINISHED_LOADING

public static final int FINISHED_LOADING
ID that indicates that the exercise was finished in loading. Remember that this is normally related to the init-operations of an exercise, what means that a exercise must not have really finished loading, when the this event occures.

See Also:
Constant Field Values

DSOBJECT_HIDE

public static final int DSOBJECT_HIDE
ID that indicates to hide the animation-object

See Also:
Constant Field Values

DSOBJECT_SHOW

public static final int DSOBJECT_SHOW
ID that indicates to show a previously hidden animation- object.

See Also:
Constant Field Values

BACK

public static final int BACK
ID that indicates that an undo was made

See Also:
Constant Field Values

FORWARD

public static final int FORWARD
ID that indicates that a redo was made

See Also:
Constant Field Values

FORWARD_ANIMATED

public static final int FORWARD_ANIMATED
ID that indicates that a animated redo was made. This event is only fired, when AnimatedUndoRedo was used.

See Also:
AnimatedUndoRedo, Constant Field Values

RESET

public static final int RESET
ID that indicates that the exercise was cleared. That means e.g. for OperationRecorder to delete all stored operations.

See Also:
Constant Field Values

PLUGIN_CHANGED

public static final int PLUGIN_CHANGED
ID that indicates that the plug in was changed.

See Also:
Constant Field Values

JUMP

public static final int JUMP
ID that indicates that the user is jumped to another operation. The delta-value can accessed by getValue()

See Also:
getValue(), Constant Field Values

END_OF_EXECUTION

public static final int END_OF_EXECUTION
ID that indicates that all operations in the current queue are fully executed by the JedasPanel.

See Also:
Constant Field Values

START_OF_EXECUTION

public static final int START_OF_EXECUTION
ID that indicates that the JedasPanel starts the execution of passed operations/events to the queue.

See Also:
Constant Field Values

SUSPEND_EXECUTION

public static final int SUSPEND_EXECUTION
ID that indicates that the Jedas-Animation goes in suspend-Mode. This is used, when e.g. the recording is paused.

See Also:
Constant Field Values

RESUME_EXECUTION

public static final int RESUME_EXECUTION
ID that indicates that the Jedas-Animation resumes from suspend. This is used, when e.g. a recording was paused, and now continueing.

See Also:
Constant Field Values

FULL_LOADED

public static final int FULL_LOADED
ID that indicates that an exercise is fully loaded

See Also:
Constant Field Values

UNDO

public static final int UNDO
ID that indicates that a real undo occured

See Also:
Constant Field Values

REDO

public static final int REDO
ID that indicates that a real redo occured

See Also:
Constant Field Values
Constructor Detail

ExerciseUpdateEvent

public ExerciseUpdateEvent(SimpleExercise ex,
                           int id)
Creates an event

Parameters:
ex - Exercise-Object
id - A ID for the event
Method Detail

getID

public int getID()
Returns the ID of the event

Returns:
ID

setMessage

public void setMessage(java.lang.String m)
Sets the message field of the event

Parameters:
m -

getMessage

public java.lang.String getMessage()
Returns the message field of the event

Returns:
Message

setOperation

public void setOperation(SimpleOperation so)
Sets the operation for the current event. This field is e.g. used in an OPERATION_EXECUTED event to store the executed operation.

Parameters:
so -

getOperation

public SimpleOperation getOperation()
Returns the operation.

Returns:
SimpleOperation
See Also:
setOperation(SimpleOperation)

setValue

public void setValue(int value)
Sets the value field of an event. This field is e.g. used in an JUMP event, to store the delta value for the distance of jumping, relativ to the actual position.

Parameters:
value -

getValue

public int getValue()
Returns the value-field.

Returns:
value

getExercise

public SimpleExercise getExercise()
Returns the exercise-object the event belongs to.

Returns:
Exercise

dsChanged

public boolean dsChanged()
Returns TRUE if the current event changes the data-structure, what means that e.g. the display have to be updated.

Returns:
true if the data-structure was changed, false otherwise

toString

public java.lang.String toString()
Returns a string-representation of the event-object

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()