de.cau.cs.kieler.sim.kiem
Class KiemEvent

java.lang.Object
  extended by de.cau.cs.kieler.sim.kiem.KiemEvent
Direct Known Subclasses:
KiemConfigEvent

public class KiemEvent
extends Object

This class implements some constants that define specific events in KIEM. A DataComponent may register itself using the AbstractDataComponent.provideEventOfInterest() method to be a listener of some events. The method AbstractDataComponent.notifyEvent(KiemEvent) will then be called by KIEM for the registered events.

Rating proposed yellow
(2009-01-15)

Field Summary
static int ACTIVATED
          The Constant ACTIVATED event is triggered when the user activates the component.
static int ADDED
          The Constant ADDED event is triggered when the user adds a component (instance).
static int CALL_FOR_SHELL
          This constant is triggered when the KIEMPlugin needs shell to provide a dialog.
static int CMD_PAUSE
          The Constant CMD_PAUSE event is triggered when the user hits the pause button.
static int CMD_RUN
          The Constant CMD_RUN event is triggered when the user hits the run button.
static int CMD_STEP
          The Constant CMD_STEP event is triggered when the user hits the step button.
static int CMD_STEP_BACK
          The Constant CMD_STEP event is triggered when the user hits the step button.
static int CMD_STEP_MACRO
          The Constant CMD_STEP event is triggered when the user hits the step button.
static int CMD_STOP
          The Constant CMD_STOP event is triggered when user hits the stop button.
static int DEACTIVATED
          The Constant DEACTIVATED event is triggered when the user deactivates the component.
static int DELETED
          The Constant DELETED event is triggered when the user deletes a component (instance).
static int DISABLE_UI
          This constant is triggered when the UI should be locked.
static int ENABLE_UI
          This constant is triggered when the UI is released after a lock.
static int ERROR_PAUSE
          The Constant ERROR_STOP event is triggered when an error leads to the execution pause.
static int ERROR_STOP
          The Constant ERROR_STOP event is triggered when an error leads to the execution stop.
static int EXECUTION_START
          This constant is triggered when the UI is released after a lock.
static int EXECUTION_STOP
          This constant is triggered when the UI is released after a lock.
static int KIEMPROPERTY_CHANGE
          The Constant KIEMPROPERTY_CHANGE event is triggered when the user changes/edited a property value in table.
static int LOAD
          The Constant LOAD event is triggered when the user loads a scheduling.
static int NONE
          The Constant NONE event represents the default NULL event and means this component does not want to be notified for any event.
static int SAVE
          The Constant SAVE event is triggered when the user saves a scheduling.
static int SCHEDULED
          The Constant SCHEDULED event is triggered when the user changes the scheduling order.
static int SET_DIRTY
          This constant is triggered when the opened execution file is edited.
static int STEP_DONE
          The Constant STEP DONE event is triggered after a step has been made.
static int STEP_INFO
          The Constant STEP INFO event is triggered before a step is about to occur.
static int VIEW_DONE
          This constant is triggered when the Execution Manager finished building the view.
static int VIEW_REFRESH
          This constant is triggered when the view may need to refresh.
 
Constructor Summary
KiemEvent()
          This KiemEvent constructor sets the no event of interest during construction.
KiemEvent(int eventCodeParam)
          This KiemEvent constructor sets the event(s) of interest during construction.
KiemEvent(int[] eventCodesParam)
          This KiemEvent constructor sets the event(s) of interest during construction.
KiemEvent(int[] eventCodesParam, Object infoParam)
          This KiemEvent constructor sets the event(s) of interest during construction.
KiemEvent(int eventCodeParam, Object infoParam)
          This KiemEvent constructor sets the event(s) of interest during construction.
 
Method Summary
 void addEvent(int eventCodeParam)
          Sets the event.
 int[] getEventCodes()
          Gets the current contained events.
 List<Integer> getEventCodesAsList()
          Gets all events as a list.
static String getEventName(int eventCode)
          Gets the event name for an integer event code or null.
 Object getInfo()
          Gets the info parameter or null if no info was attached.
 boolean isEvent(int eventCodeParam)
          Checks whether an event is contained.
 void resetEvents()
          Resets the event to NONE.
 void setEvents(int[] eventCodesParam)
          Adds the event.
 void setInfo(Object infoParam)
          Sets the optional info parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
The Constant NONE event represents the default NULL event and means this component does not want to be notified for any event.

See Also:
Constant Field Values

STEP_INFO

public static final int STEP_INFO
The Constant STEP INFO event is triggered before a step is about to occur.

See Also:
Constant Field Values

STEP_DONE

public static final int STEP_DONE
The Constant STEP DONE event is triggered after a step has been made.

See Also:
Constant Field Values

CMD_STEP

public static final int CMD_STEP
The Constant CMD_STEP event is triggered when the user hits the step button.

See Also:
Constant Field Values

CMD_STEP_BACK

public static final int CMD_STEP_BACK
The Constant CMD_STEP event is triggered when the user hits the step button.

See Also:
Constant Field Values

CMD_STEP_MACRO

public static final int CMD_STEP_MACRO
The Constant CMD_STEP event is triggered when the user hits the step button.

See Also:
Constant Field Values

CMD_RUN

public static final int CMD_RUN
The Constant CMD_RUN event is triggered when the user hits the run button.

See Also:
Constant Field Values

CMD_PAUSE

public static final int CMD_PAUSE
The Constant CMD_PAUSE event is triggered when the user hits the pause button.

See Also:
Constant Field Values

CMD_STOP

public static final int CMD_STOP
The Constant CMD_STOP event is triggered when user hits the stop button.

See Also:
Constant Field Values

ADDED

public static final int ADDED
The Constant ADDED event is triggered when the user adds a component (instance).

See Also:
Constant Field Values

DELETED

public static final int DELETED
The Constant DELETED event is triggered when the user deletes a component (instance).

See Also:
Constant Field Values

SCHEDULED

public static final int SCHEDULED
The Constant SCHEDULED event is triggered when the user changes the scheduling order.

See Also:
Constant Field Values

ACTIVATED

public static final int ACTIVATED
The Constant ACTIVATED event is triggered when the user activates the component.

See Also:
Constant Field Values

DEACTIVATED

public static final int DEACTIVATED
The Constant DEACTIVATED event is triggered when the user deactivates the component.

See Also:
Constant Field Values

LOAD

public static final int LOAD
The Constant LOAD event is triggered when the user loads a scheduling. The info in this case is the location of the file as an IPath object.

See Also:
Constant Field Values

SAVE

public static final int SAVE
The Constant SAVE event is triggered when the user saves a scheduling. The info in this case is the location of the file as an IPath object.

See Also:
Constant Field Values

KIEMPROPERTY_CHANGE

public static final int KIEMPROPERTY_CHANGE
The Constant KIEMPROPERTY_CHANGE event is triggered when the user changes/edited a property value in table.

See Also:
Constant Field Values

ERROR_STOP

public static final int ERROR_STOP
The Constant ERROR_STOP event is triggered when an error leads to the execution stop.

See Also:
Constant Field Values

ERROR_PAUSE

public static final int ERROR_PAUSE
The Constant ERROR_STOP event is triggered when an error leads to the execution pause.

See Also:
Constant Field Values

CALL_FOR_SHELL

public static final int CALL_FOR_SHELL
This constant is triggered when the KIEMPlugin needs shell to provide a dialog. If no shell is provided (anyone calling setShell()) then the default case is assumed for a headless operation.

See Also:
Constant Field Values

VIEW_DONE

public static final int VIEW_DONE
This constant is triggered when the Execution Manager finished building the view.

See Also:
Constant Field Values

VIEW_REFRESH

public static final int VIEW_REFRESH
This constant is triggered when the view may need to refresh.

See Also:
Constant Field Values

SET_DIRTY

public static final int SET_DIRTY
This constant is triggered when the opened execution file is edited.

See Also:
Constant Field Values

DISABLE_UI

public static final int DISABLE_UI
This constant is triggered when the UI should be locked.

See Also:
Constant Field Values

ENABLE_UI

public static final int ENABLE_UI
This constant is triggered when the UI is released after a lock.

See Also:
Constant Field Values

EXECUTION_START

public static final int EXECUTION_START
This constant is triggered when the UI is released after a lock.

See Also:
Constant Field Values

EXECUTION_STOP

public static final int EXECUTION_STOP
This constant is triggered when the UI is released after a lock.

See Also:
Constant Field Values
Constructor Detail

KiemEvent

public KiemEvent(int[] eventCodesParam,
                 Object infoParam)
This KiemEvent constructor sets the event(s) of interest during construction.

Parameters:
infoParam - the (optional) info parameter
eventCodesParam - the event codes param

KiemEvent

public KiemEvent(int[] eventCodesParam)
This KiemEvent constructor sets the event(s) of interest during construction.

Parameters:
eventCodesParam - the event codes param

KiemEvent

public KiemEvent(int eventCodeParam,
                 Object infoParam)
This KiemEvent constructor sets the event(s) of interest during construction.

Parameters:
infoParam - the (optional) info parameter
eventCodeParam - the event code param

KiemEvent

public KiemEvent(int eventCodeParam)
This KiemEvent constructor sets the event(s) of interest during construction.

Parameters:
eventCodeParam - the event code param

KiemEvent

public KiemEvent()
This KiemEvent constructor sets the no event of interest during construction.

Method Detail

getEventCodes

public int[] getEventCodes()
Gets the current contained events.

Returns:
the events

isEvent

public boolean isEvent(int eventCodeParam)
Checks whether an event is contained.

Parameters:
eventCodeParam - the event code param
Returns:
true, if is event

addEvent

public void addEvent(int eventCodeParam)
Sets the event.

Parameters:
eventCodeParam - the event code param

setEvents

public void setEvents(int[] eventCodesParam)
Adds the event.

Parameters:
eventCodesParam - the event codes param

resetEvents

public void resetEvents()
Resets the event to NONE.


setInfo

public void setInfo(Object infoParam)
Sets the optional info parameter.

Parameters:
infoParam - the new info

getInfo

public Object getInfo()
Gets the info parameter or null if no info was attached.

Returns:
the info

getEventName

public static String getEventName(int eventCode)
Gets the event name for an integer event code or null.

Parameters:
eventCode - the event code
Returns:
the event name

getEventCodesAsList

public List<Integer> getEventCodesAsList()
Gets all events as a list.

Returns:
all events as a list