de.cau.cs.kieler.kev.extension.dataobserver
Class KEVDataObserver

java.lang.Object
  extended by de.cau.cs.kieler.sim.kiem.internal.AbstractDataComponent
      extended by de.cau.cs.kieler.sim.kiem.JSONObjectDataComponent
          extended by de.cau.cs.kieler.kev.extension.dataobserver.KEVDataObserver
All Implemented Interfaces:
IDataComponent, IJSONObjectDataComponent, IExecutableExtension

public class KEVDataObserver
extends JSONObjectDataComponent
implements IJSONObjectDataComponent

Rating proposed yellow
(2010-02-17)

Field Summary
 
Fields inherited from class de.cau.cs.kieler.sim.kiem.internal.AbstractDataComponent
MASTER_CMD_MACROSTEP, MASTER_CMD_PAUSE, MASTER_CMD_RUN, MASTER_CMD_STEP, MASTER_CMD_STEPBACK, MASTER_CMD_STOP
 
Constructor Summary
KEVDataObserver()
           
 
Method Summary
 void initialize()
          Disables the load button during execution and creates the KEV-view if it's not already done.
 boolean isHistoryObserver()
          Tells the ExecutionManager to store all data for an eventually history playback.
 boolean isObserver()
          Tells the ExecutionManager that the KEV-view is an observer.
 boolean isProducer()
          Tells the ExecutionManager that the KEV-view is not a producer.
 JSONObject provideInitialVariables()
          Sets the initial values for the KIEM data table with the SVG element id's from mapping file as JSON keys.
 JSONObject step(JSONObject jSONObject)
          Applies the JSON data to the SVG document.
 void wrapup()
          Sets the running status of the ExecutionManager to false an enables the open wizard button.
 
Methods inherited from class de.cau.cs.kieler.sim.kiem.JSONObjectDataComponent
getInitialVariables, provideFilterKeysJSON, setInitialVariables
 
Methods inherited from class de.cau.cs.kieler.sim.kiem.internal.AbstractDataComponent
checkProperties, finalize, getConfigurationElement, getDataComponentId, getName, getPluginId, getProperties, isDeltaObserver, isHistoryStep, isInvisible, isMacroStepDone, isMaster, isMasterImplementingGUI, isMultiInstantiable, masterCommand, masterGetAimedStepDuration, masterGUI, masterGUIisEnabled, masterIsPaused, masterIsRunning, masterSetAimedStepDuration, masterSetKIEMInstances, notifyEvent, provideEventOfInterest, provideFilterKeys, provideProperties, setConfigurationElemenet, setHistoryStep, setInitializationData, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KEVDataObserver

public KEVDataObserver()
Method Detail

step

public JSONObject step(JSONObject jSONObject)
Applies the JSON data to the SVG document.

Specified by:
step in interface IJSONObjectDataComponent
Parameters:
jSONObject - The actual JSONObject, returned by the ExecutionManager.
Returns:
null Here we don't need to return a JSON object, because the KEV-view is an observer only now.
See Also:
IJSONObjectDataComponent#step(de.cau.cs.kieler.sim.kiem.json.JSONObject), JSONObject, ExecutionManager

provideInitialVariables

public JSONObject provideInitialVariables()
Sets the initial values for the KIEM data table with the SVG element id's from mapping file as JSON keys.

Overrides:
provideInitialVariables in class JSONObjectDataComponent
Returns:
The JSONObject with all SVG element id's of the current mapping file.

initialize

public void initialize()
                throws KiemInitializationException
Disables the load button during execution and creates the KEV-view if it's not already done.

Specified by:
initialize in interface IDataComponent
Throws:
KiemInitializationException - An exception which raises if the KEV-view can't be created.

isObserver

public boolean isObserver()
Tells the ExecutionManager that the KEV-view is an observer.

Specified by:
isObserver in interface IDataComponent
Returns:
true, because the KEV-view is an observer.
See Also:
de.cau.cs.kieler.sim.kiem.extension.IDataComponent#isObserver(), ExecutionManager

isProducer

public boolean isProducer()
Tells the ExecutionManager that the KEV-view is not a producer.

Specified by:
isProducer in interface IDataComponent
Returns:
false, because the KEV-view is not a producer.
See Also:
de.cau.cs.kieler.sim.kiem.extension.IDataComponent#isProducer()

isHistoryObserver

public boolean isHistoryObserver()
Tells the ExecutionManager to store all data for an eventually history playback.

Overrides:
isHistoryObserver in class AbstractDataComponent
Returns:
true, because KEV-view should be able the show history steps.

wrapup

public void wrapup()
Sets the running status of the ExecutionManager to false an enables the open wizard button.

Specified by:
wrapup in interface IDataComponent
See Also:
de.cau.cs.kieler.sim.kiem.extension.IDataComponent#wrapup(), Activator