T
- Class parameter, indicating which type of operators is managed.public class ALDOperatorCollection<T extends ALDOperatorCollectionElement> extends Object
Each managed operator can be graphically configured and be executed.
Communication with this class works via method calls. Operators are run
in an ALDWorkflow
environment, messages are handed over from the
operator collection to interactors outside via events.
Modifier and Type | Class and Description |
---|---|
protected class |
ALDOperatorCollection.OperatorExecutionProxy
Manager class for (threaded) execution of operators of a collection.
|
protected class |
ALDOperatorCollection.ParameterUpdateListener
Listener class to react on parameter value updates in config window.
|
Modifier and Type | Field and Description |
---|---|
protected Set<Class> |
availableClasses
Set of available operator classes.
|
protected HashMap<String,ALDOperatorConfigurationFrame> |
configFrames
Collection of configuration frames for the available operators.
|
protected Class<T> |
elementType
Class object of the generics type.
|
protected HashMap<String,T> |
idsToOperatorObjects
Mapping of unique operator class IDs to operator instances.
|
protected HashMap<String,Boolean> |
idsToRerunFlags
Configuration map storing if operators are allowed to re-run with
identical parameter settings.
|
protected ALDOperatorCollection.OperatorExecutionProxy |
opProxy
Proxy object to run operators in threaded mode.
|
protected HashMap<String,ALDOperatorCollection.ParameterUpdateListener> |
paramListener
Collection of parameter change listeners.
|
Constructor and Description |
---|
ALDOperatorCollection(Class<T> type)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addALDOperatorCollectionEventListener(ALDOperatorCollectionEventListener evl)
Add an event listener for getting events when running operators.
|
void |
closeConfigWindows()
Close all configuration windows.
|
Set<Class> |
getAvailableClasses()
Request set of available classes.
|
protected ALDOperatorConfigurationFrame |
getConfigWin(ALDOperator op,
ALDOpParameterUpdateEventListener pListen)
Generate configuration window for given operator.
|
T |
getOperator(ALDWorkflowNodeID nid)
Get operator for given workflow node ID.
|
T |
getOperator(String classUID)
Returns the operator object for given unique class identifier.
|
Collection<String> |
getUniqueClassIDs()
Request collection of unique class IDs for available classes.
|
void |
openOperatorConfigWindow(String classUID)
Method to configure an operator, i.e., open its configuration window.
|
void |
operatorConfigurationChanged()
Method to notify the collection that configurations of operators
might have changed.
|
void |
removeALDOperatorCollectionEventListener(ALDOperatorCollectionEventListener evl)
Deregister an event listener.
|
void |
runOperators(Collection<String> ops)
Run a collection of operators.
|
void |
setRerunFlags(boolean flag)
Sets re-run flags of all operators to given boolean value.
|
void |
setRerunFlags(Collection<String> opIDs,
boolean flag)
Sets re-run flags of all operators in the list to given boolean value.
|
protected Class<T extends ALDOperatorCollectionElement> elementType
protected HashMap<String,T extends ALDOperatorCollectionElement> idsToOperatorObjects
protected HashMap<String,Boolean> idsToRerunFlags
protected HashMap<String,ALDOperatorConfigurationFrame> configFrames
protected HashMap<String,ALDOperatorCollection.ParameterUpdateListener> paramListener
protected ALDOperatorCollection.OperatorExecutionProxy opProxy
For execution of operators environments are used.
public ALDOperatorCollection(Class<T> type) throws InstantiationException, ALDOperatorException
type
- Class of generics type, simplifies internal type handling.InstantiationException
- Thrown in case of error or failure.ALDOperatorException
- Thrown in case of error or failure.public void addALDOperatorCollectionEventListener(ALDOperatorCollectionEventListener evl)
evl
- Event listener to register.public void removeALDOperatorCollectionEventListener(ALDOperatorCollectionEventListener evl)
evl
- Event listener to remove.public Set<Class> getAvailableClasses()
public Collection<String> getUniqueClassIDs()
Note that the collection has no specific ordering.
public T getOperator(String classUID)
classUID
- Unique class identifier.public T getOperator(ALDWorkflowNodeID nid)
nid
- Workflow node ID.public void openOperatorConfigWindow(String classUID)
classUID
- Unique class identifier of operator.public void operatorConfigurationChanged() throws ALDWorkflowException
ALDWorkflowException
- Thrown in case of failure.public void setRerunFlags(boolean flag)
flag
- If true, all operators are allowed to run again.public void setRerunFlags(Collection<String> opIDs, boolean flag)
opIDs
- Re-run flags of all operators in the list are set.flag
- If true, all operators in the list are allowed to rerun.public void runOperators(Collection<String> ops)
ops
- List of unique class identifiers for operators to run.public void closeConfigWindows()
protected ALDOperatorConfigurationFrame getConfigWin(ALDOperator op, ALDOpParameterUpdateEventListener pListen) throws ALDOperatorException
To be overwritten by sub-classes using specialized operators.
op
- Operator object.pListen
- Parameter update listener.ALDOperatorException
- Thrown in case of failure.Copyright © 2010–2021 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.