de.unihalle.informatik.Alida.operator
Class ALDOperatorControllable

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.Alida.operator.ALDOperatorControllable
All Implemented Interfaces:
ALDConfigurationEventListener, ALDConfigurationEventReporter, ALDControlEventListener, ALDControlEventReporter, java.util.EventListener

@ALDAOperator
public class ALDOperatorControllable
extends ALDOperator
implements ALDControlEventListener, ALDControlEventReporter, ALDConfigurationEventListener, ALDConfigurationEventReporter

Operator class with inherent event handling for execution control.

This operator acts as listener for `Alida` control events. On receiving events the operator changes its control status which may be used to control operator execution, and in particular to interrupt calculations in a controlled fashion, i.e. to keep results already obtained.

Author:
moeller

Nested Class Summary
static class ALDOperatorControllable.OperatorControlStatus
          Control command and/or operator status, respectively.
 
Field Summary
protected  javax.swing.event.EventListenerList configurationEventlistenerList
          List of configuration event listeners attached to this reporter.
protected  javax.swing.event.EventListenerList controlEventlistenerList
          List of control event listeners attached to this reporter.
protected  boolean notifyListenersRecursively
          Flag for recursive propagation of events to nested listeners.
protected  ALDOperatorControllable.OperatorControlStatus operatorStatus
          Status of operator, used to stop/pause/resume calculations.
protected  int stepSize
          Step size in step-wise execution mode.
protected  boolean stepWiseExecution
          Flag for step-wise execution.
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, opNodeStackHash, portHashAccess, verbose, versionProvider
 
Constructor Summary
ALDOperatorControllable()
          Default constructor.
 
Method Summary
 void addALDConfigurationEventListener(ALDConfigurationEventListener listener)
          Adds a listener to this reporter.
 void addALDControlEventListener(ALDControlEventListener listener)
          Adds a listener to this reporter.
 void fireALDConfigurationEvent(ALDConfigurationEvent event)
          Sends an event to all registered listeners.
 void fireALDControlEvent(ALDControlEvent event)
          Sends the given event to all registered listeners.
 void handleALDConfigurationEvent(ALDConfigurationEvent event)
          Method which is called on event occurence.
 void handleALDControlEvent(ALDControlEvent event)
          Method which is called on event occurence.
protected  void operate()
          This method does the actual work and needs to be implemented by every subclass.
 void removeALDConfigurationEventListener(ALDConfigurationEventListener listener)
          Removes a listener from this reporter.
 void removeALDControlEventListener(ALDControlEventListener listener)
          Removes a listener from this reporter.
 void setNotifyRecursiveFlag(boolean flag)
          Specify if events are to be passed forward to nested listeners or not.
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
allowedClassForIO, deserializeFromXmlFile, getALDPortHashAccessKey, getInInoutNames, getInInoutNames, getName, getNumParameters, getOutInoutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, parametersToXmlObject, print, print, print, printInterface, printInterface, readHistory, runOp, runOp, runOp, serializeToXmlFile, setParameter, setParametersFromXml, setParametersFromXml, setVerbose, toString, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory, writeParametersToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

configurationEventlistenerList

protected volatile javax.swing.event.EventListenerList configurationEventlistenerList
List of configuration event listeners attached to this reporter.


controlEventlistenerList

protected volatile javax.swing.event.EventListenerList controlEventlistenerList
List of control event listeners attached to this reporter.


notifyListenersRecursively

protected boolean notifyListenersRecursively
Flag for recursive propagation of events to nested listeners.


operatorStatus

protected volatile ALDOperatorControllable.OperatorControlStatus operatorStatus
Status of operator, used to stop/pause/resume calculations.


stepSize

protected int stepSize
Step size in step-wise execution mode.


stepWiseExecution

protected boolean stepWiseExecution
Flag for step-wise execution.

Constructor Detail

ALDOperatorControllable

public ALDOperatorControllable()
                        throws ALDOperatorException
Default constructor.

Throws:
ALDOperatorException
Method Detail

addALDConfigurationEventListener

public void addALDConfigurationEventListener(ALDConfigurationEventListener listener)
Description copied from interface: ALDConfigurationEventReporter
Adds a listener to this reporter.

Specified by:
addALDConfigurationEventListener in interface ALDConfigurationEventReporter
Parameters:
listener - Listener to be added.

addALDControlEventListener

public void addALDControlEventListener(ALDControlEventListener listener)
Description copied from interface: ALDControlEventReporter
Adds a listener to this reporter.

Specified by:
addALDControlEventListener in interface ALDControlEventReporter
Parameters:
listener - Listener to be added.

fireALDConfigurationEvent

public void fireALDConfigurationEvent(ALDConfigurationEvent event)
Description copied from interface: ALDConfigurationEventReporter
Sends an event to all registered listeners.

Specified by:
fireALDConfigurationEvent in interface ALDConfigurationEventReporter
Parameters:
event - Event to be send to all listeners.

fireALDControlEvent

public void fireALDControlEvent(ALDControlEvent event)
Description copied from interface: ALDControlEventReporter
Sends the given event to all registered listeners.

Specified by:
fireALDControlEvent in interface ALDControlEventReporter
Parameters:
event - Event to be send to all listeners.

handleALDConfigurationEvent

public void handleALDConfigurationEvent(ALDConfigurationEvent event)
Description copied from interface: ALDConfigurationEventListener
Method which is called on event occurence.

Specified by:
handleALDConfigurationEvent in interface ALDConfigurationEventListener
Parameters:
event - Event to be handled.

handleALDControlEvent

public void handleALDControlEvent(ALDControlEvent event)
Description copied from interface: ALDControlEventListener
Method which is called on event occurence.

Specified by:
handleALDControlEvent in interface ALDControlEventListener
Parameters:
event - Event to be handled.

operate

protected void operate()
                throws ALDOperatorException,
                       ALDProcessingDAGException
Description copied from class: ALDOperator
This method does the actual work and needs to be implemented by every subclass.

Specified by:
operate in class ALDOperator
Throws:
ALDOperatorException
ALDProcessingDAGException

removeALDConfigurationEventListener

public void removeALDConfigurationEventListener(ALDConfigurationEventListener listener)
Description copied from interface: ALDConfigurationEventReporter
Removes a listener from this reporter.

Specified by:
removeALDConfigurationEventListener in interface ALDConfigurationEventReporter
Parameters:
listener - Listener to be removed.

removeALDControlEventListener

public void removeALDControlEventListener(ALDControlEventListener listener)
Description copied from interface: ALDControlEventReporter
Removes a listener from this reporter.

Specified by:
removeALDControlEventListener in interface ALDControlEventReporter
Parameters:
listener - Listener to be removed.

setNotifyRecursiveFlag

public void setNotifyRecursiveFlag(boolean flag)
Specify if events are to be passed forward to nested listeners or not.