de.cau.cs.kieler.sim.kiem.ui
Class KiemEventListener

java.lang.Object
  extended by de.cau.cs.kieler.sim.kiem.ui.KiemEventListener
All Implemented Interfaces:
IKiemEventListener

public class KiemEventListener
extends Object
implements IKiemEventListener

The Event Listener for the KIELER Execution Manager.

Rating proposed yellow
(2010-01-15)

Constructor Summary
KiemEventListener()
          Instantiates a new kiem event listener.
 
Method Summary
 void notifyEvent(KiemEvent event)
          This is the basic notify method that is called by KIEM whenever an event occurs for which this EventListener is registered (see IKiemEventListener.provideEventOfInterest()).
 KiemEvent provideEventOfInterest()
           Return a KiemEvent type (integer value) that represents a number of events this component wants to listen to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KiemEventListener

public KiemEventListener()
Instantiates a new kiem event listener.

Method Detail

notifyEvent

public void notifyEvent(KiemEvent event)
This is the basic notify method that is called by KIEM whenever an event occurs for which this EventListener is registered (see IKiemEventListener.provideEventOfInterest()).

Specified by:
notifyEvent in interface IKiemEventListener
Parameters:
event - the KiemEvent with additional attached information, depending on the specific event

provideEventOfInterest

public KiemEvent provideEventOfInterest()

Return a KiemEvent type (integer value) that represents a number of events this component wants to listen to.

A KiemEvent can be a combination of several events. The simplest way to register for two events that e.g., indicate a step-command and the removal of the component is to have the following code:

public KiemEvent provideEventOfInterest() {
int[] events = {CMD_STEP, DELETED}
return new KiemEvent(events);
}

Specified by:
provideEventOfInterest in interface IKiemEventListener
Returns:
the KiemEvent type indicating the events of interest