public class TaskGraphImp extends TaskImp implements TaskGraph, TaskListener, java.io.Serializable, java.lang.Cloneable
Task.ConnectionStatus| Modifier and Type | Field and Description |
|---|---|
protected java.util.ArrayList<ExecutionListener> |
execlisteners
a list of the execution listeners for this task
|
CONTROL_TASK_CONNECTED, CONTROL_TASK_DISCONNECTED, CONTROL_TASK_UNSTABLEDEFAULT_NODE_REQUIREMENT, DEPRECATED_GUI_XPOS, DEPRECATED_GUI_YPOS, ERROR_MESSAGE, ESSENTIAL, ESSENTIAL_IF_CONNECTED, EXECUTION_COUNT, EXECUTION_REQUEST_COUNT, EXECUTION_STATE, GUI_X, GUI_Y, NODE_PROPERTIES, NODE_REQUIREMENT, OPTIONAL, OUTPUT_TYPEANY_DATA_TYPE, CLONE_ALL_OUTPUT, CLONE_MULTIPLE_OUTPUT, COPY_OUTPUT, DEFAULT_IN_NODES, DEFAULT_INPUT_NODES, DEFAULT_MAX_NODES, DEFAULT_MIN_NODES, DEFAULT_OUT_NODES, DEFAULT_OUTPUT_NODES, DEFAULT_POP_UP_DESCRIPTION, DEFINITION_JAVA_CLASS, DEFINITION_METADATA, DEFINITION_TRIANA_XML, DEFINITION_UNKNOWN, GUI, GUI_BUILDER, HELP_FILE_PARAM, IMMEDIATE_UPDATE, INTERNAL, LATE_INITIALIZE, MAX_INPUT_NODES, MAX_OUTPUT_NODES, MIN_INPUT_NODES, MIN_OUTPUT_NODES, NO_UPDATE, OLD_GUI_BUILDER, ON_TASK_INSTANTIATION, ON_USER_ACCESS, OUTPUT_POLICY, PANEL_INSTANCE, PARAM_PANEL_CLASS, PARAM_PANEL_HIDE, PARAM_PANEL_INSTANTIATE, PARAM_PANEL_SHOW, PARAM_UPDATE_POLICY, POP_UP_DESCRIPTION, PROCESS_UPDATE, TOOL_VERSION, TRANSIENT, TRANSIENT_ACCESSIBLE, UNKNOWN_DATA_TYPE, UNKNOWN_TYPE, USER_ACCESSIBLE| Constructor and Description |
|---|
TaskGraphImp(Task[] tasks,
TaskFactory factory,
boolean preserveinst,
TrianaProperties properties)
Create a taskgraph containig the specified tasks, and using the specified taskgraph factory.
|
TaskGraphImp(Tool tool,
TaskFactory factory,
boolean preserveinst)
Create a taskgraph that takes its details from a specified tool and uses a specific factory.
|
TaskGraphImp(TrianaProperties properties)
Create a taskgraph that uses the default task factory.
|
| Modifier and Type | Method and Description |
|---|---|
Node |
addDataInputNode(Node parent)
Adds a data input node, with the specified node as a parent
|
Node |
addDataOutputNode(Node parent)
Adds a data output node, with the specified node as a parent
|
void |
addExecutionListener(ExecutionListener listener)
Adds a execution listener to this runnable instance
|
void |
addTaskGraphListener(TaskGraphListener listener)
Adds a taskgraph listener to this taskgraph.
|
Cable |
connect(Node sendnode,
Node recnode)
Create a cable connecting sendnode on sendtask to recnode on rectask.
|
boolean |
containsNode(Node node) |
boolean |
containsTask(java.lang.String identifier) |
boolean |
containsTask(Task task) |
boolean |
containsTaskInstance(java.lang.String instanceid) |
Task |
createControlTask(Tool tool,
boolean preserveinst)
Constructs a new task for looping over the group, optionally preserving the original instance id in the new task.
|
Task |
createTask(Tool tool)
Create a new task in this taskgraph.
|
Task |
createTask(Tool tool,
boolean preserveinst)
Create a new task in this taskgraph, optionally preserving the instance id from the original task in the new
task.
|
protected Task |
createTaskNoNotify(Tool tool,
boolean preserveinst)
Creates the specified task without notifying the task listeners
|
void |
disconnect(Cable cable)
Disconnects the specified cable from its nodes.
|
void |
dispose()
cleans up any operations associated with this taskgraph and the tasks within it
|
void |
executionFinished(ExecutionEvent event)
Notified when the runnable instance has finished an execution
|
void |
executionRequested(ExecutionEvent event)
Notified when an execution is requested (either by the user or due to all essential input data having been
received)
|
void |
executionReset(ExecutionEvent event)
Notified when the runnable instance is reset
|
void |
executionStarting(ExecutionEvent event)
Notified when the runnable instance is about to be execution
|
void |
executionStateChanged(ExecutionEvent event)
Notified when the execution state of the task changes
|
Task |
getControlTask() |
int |
getControlTaskState() |
java.lang.String[] |
getDataInputTypes(int index) |
java.lang.String[] |
getDataOutputTypes(int index) |
Node |
getGroupNodeParent(Node groupnode) |
Task |
getTask(Node node) |
Task |
getTask(java.lang.String taskname) |
Task |
getTaskInstance(java.lang.String instanceid) |
Task[] |
getTasks(boolean includecontrol) |
TaskGraph |
groupTasks(java.lang.String[] tasknames,
java.lang.String groupname)
Groups the specified tasks, returning the taskgraph created.
|
void |
init()
Initialistion method should be called immediately after parent is set
|
boolean |
isControlTask() |
boolean |
isControlTaskConnected() |
boolean |
isControlTaskUnstable() |
void |
nodeAdded(TaskNodeEvent event)
Called when a data input node is added.
|
void |
nodeRemoved(TaskNodeEvent event)
If the node being removed is one of this group's nodes the this removes the group node also.
|
protected void |
notifyCableConnected(Cable cable,
boolean groupevent,
boolean ungroupevent)
Notifies all the taskgraph listeners that a cable has been connected.
|
protected void |
notifyCableDisconnected(Cable cable,
boolean groupevent,
boolean ungroupevent)
Notifies all the taskgraph listeners that a task has been removed.
|
protected void |
notifyCableReconnected(Cable cable,
boolean inputrecon)
Notifies all the taskgraph listeners that a task has been removed.
|
protected void |
notifyTaskCreated(Task task,
boolean groupevent,
boolean ungroupevent)
Notifies all the taskgraph listeners that a task has been created.
|
protected void |
notifyTaskRemoved(Task task,
boolean groupevent,
boolean ungroupevent)
Notifies all the taskgraph listeners that a task has been removed.
|
void |
parameterUpdated(ParameterUpdateEvent event)
Called when the value of a parameter is changed, including when a parameter is removed.
|
void |
removeControlTask()
Removes the control task from the group
|
void |
removeDataInputNode(Node node)
Removes a data input node.
|
void |
removeDataOutputNode(Node node)
Removes a data output node.
|
void |
removeExecutionListener(ExecutionListener listener)
Removes a execution listener from this runnable instance
|
void |
removeTask(Task task)
Remove the specified task from the taskgraph.
|
void |
removeTaskGraphListener(TaskGraphListener listener)
Removes a taskgraph listener from this taskgraph.
|
void |
setControlTaskState(int state)
Sets the state of the control task (CONTROL_TASK_CONNECTED, CONTROL_TASK_DISCONNECTED or CONTROL_TASK_UNSTABLE)
|
void |
setGroupNodeParent(Node groupnode,
Node parentnode)
Sets the parent of a group input/output node
|
static void |
setPositionFromDoubles(Tool tool,
java.lang.Double[] pos)
Sets the position of the specified task using Triana's co-ordinate system.
|
void |
swapGroupNodeParents(Node groupnode1,
Node groupnode2)
Swaps the parents of two group nodes (without disconnecting either).
|
void |
taskDisposed(TaskDisposedEvent event)
Called before the task is disposed
|
void |
taskNameUpdate(Task task)
This method is called when a tasks within this taskgraphs name is changed.
|
void |
taskPropertyUpdate(TaskPropertyEvent event)
This method is called when a tasks within this taskgraphs name is changed.
|
void |
ungroup()
removes tasks and notifies listeners when the taskgraph is ungrouped, but does not dispose of the tasks
|
void |
unGroupTask(java.lang.String groupname)
Ungroups the specified group task.
|
addDataInputNode, addDataOutputNode, addDeclaredNodeProperty, addParameterInputNode, addParameterOutputNode, addTaskListener, getAbsoluteNodeIndex, getContext, getContextProperty, getDataInputNode, getDataInputNodeCount, getDataInputNodes, getDataOutputNode, getDataOutputNodeCount, getDataOutputNodes, getDeclaredNodeProperties, getDefaultNodeRequirement, getErrorMessage, getExecutionCount, getExecutionRequestCount, getExecutionState, getInputNode, getInputNodes, getInstanceID, getNodeIndex, getNodeRequirement, getOutputNode, getOutputNodes, getParameterInputName, getParameterInputNode, getParameterInputNodeCount, getParameterInputNodes, getParameterOutputName, getParameterOutputNode, getParameterOutputNodeCount, getParameterOutputNodes, getParent, getQualifiedTaskName, getUltimateParent, isDataInputNode, isDataOutputNode, isParameterInputNode, isParameterOutputNode, isParameterTriggerNode, isRunContinuously, notifyNodeAdded, notifyNodeRemoved, notifyParameterSet, notifyPropertyUpdate, notifyTaskDisposed, removeNode, removeParameter, removeParameterInputNode, removeParameterOutputNode, removeProxy, removeTaskListener, setContextProperty, setDataInputNodeCount, setDataOutputNodeCount, setDeclaredNodeProperties, setDefaultNodeRequirement, setNodeRequirement, setParameter, setParameterInputs, setParameterOutputNames, setParent, setProxy, setRunContinuously, setSubTitle, setToolName, updateProxyaddExtension, addRenderingHint, getDataInputTypes, getDataOutputTypes, getDefaultDataInputNodes, getDefaultDataOutputNodes, getDefinitionPath, getDefinitionType, getDisplayName, getDisplayPackage, getExtension, getExtensionNames, getHelpFile, getInputNodeCount, getMaxDataInputNodes, getMaxDataOutputNodes, getMinDataInputNodes, getMinDataOutputNodes, getOutputNodeCount, getParameter, getParameterNames, getParameterType, getPopUpDescription, getProperties, getProxy, getQualifiedToolName, getRenderingHint, getRenderingHints, getSubTitle, getToolBox, getToolName, getToolPackage, getUnitName, getUnitPackage, getVersion, isExtensionName, isParameterName, isRenderingHint, removeExtension, removeRenderingHint, setDataInputTypes, setDataInputTypes, setDataOutputTypes, setDataOutputTypes, setDefaultDataInputNodes, setDefaultDataOutputNodes, setDefinitionPath, setDefinitionType, setDisplayName, setDisplayPackage, setHelpFile, setMaxDataInputNodes, setMaxDataOutputNodes, setMinDataInputNodes, setMinDataOutputNodes, setParameterOutputs, setParameterType, setPopUpDescription, setProperties, setToolBox, setToolPackage, setVersion, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddDataInputNode, addDataOutputNode, addDeclaredNodeProperty, addParameterInputNode, addParameterOutputNode, addTaskListener, getAbsoluteNodeIndex, getContext, getContextProperty, getDataInputNode, getDataInputNodes, getDataOutputNode, getDataOutputNodes, getDeclaredNodeProperties, getDefaultNodeRequirement, getErrorMessage, getExecutionCount, getExecutionRequestCount, getExecutionState, getInputNode, getInputNodes, getInstanceID, getNodeIndex, getNodeRequirement, getOutputNode, getOutputNodes, getParameterInputNode, getParameterInputNodes, getParameterOutputNode, getParameterOutputNodes, getParent, getQualifiedTaskName, getUltimateParent, isDataInputNode, isDataOutputNode, isParameterInputNode, isParameterOutputNode, isRunContinuously, removeNode, removeParameterInputNode, removeParameterOutputNode, removeTaskListener, setContextProperty, setDeclaredNodeProperties, setDefaultNodeRequirement, setNodeRequirement, setParent, setRunContinuously, updateProxyaddExtension, addRenderingHint, getDataInputNodeCount, getDataInputTypes, getDataOutputNodeCount, getDataOutputTypes, getDefaultDataInputNodes, getDefaultDataOutputNodes, getDefinitionPath, getDefinitionType, getDisplayName, getDisplayPackage, getExtension, getExtensionNames, getHelpFile, getInputNodeCount, getMaxDataInputNodes, getMaxDataOutputNodes, getMinDataInputNodes, getMinDataOutputNodes, getOutputNodeCount, getParameter, getParameterInputName, getParameterInputNodeCount, getParameterNames, getParameterOutputName, getParameterOutputNodeCount, getParameterType, getPopUpDescription, getProperties, getProxy, getQualifiedToolName, getRenderingHint, getRenderingHints, getSubTitle, getToolBox, getToolName, getToolPackage, getVersion, isExtensionName, isParameterName, isParameterTriggerNode, isRenderingHint, removeExtension, removeParameter, removeProxy, removeRenderingHint, setDataInputTypes, setDataOutputTypes, setDefinitionPath, setDefinitionType, setHelpFile, setParameter, setParameterInputs, setParameterOutputs, setParameterType, setPopUpDescription, setProperties, setProxy, setSubTitle, setToolBox, setToolName, setToolPackage, setVersionprotected java.util.ArrayList<ExecutionListener> execlisteners
public TaskGraphImp(TrianaProperties properties) throws TaskException
TaskExceptionpublic TaskGraphImp(Tool tool, TaskFactory factory, boolean preserveinst) throws TaskException
TaskExceptionpublic TaskGraphImp(Task[] tasks, TaskFactory factory, boolean preserveinst, TrianaProperties properties) throws TaskException
TaskExceptionpublic void addExecutionListener(ExecutionListener listener)
addExecutionListener in interface TaskGraphpublic void removeExecutionListener(ExecutionListener listener)
removeExecutionListener in interface TaskGraphpublic void init()
throws TaskException
init in interface Taskinit in class TaskImpTaskExceptionpublic static void setPositionFromDoubles(Tool tool, java.lang.Double[] pos)
public java.lang.String[] getDataInputTypes(int index)
getDataInputTypes in interface ToolgetDataInputTypes in class ToolImppublic java.lang.String[] getDataOutputTypes(int index)
getDataOutputTypes in interface ToolgetDataOutputTypes in class ToolImppublic Task createControlTask(Tool tool, boolean preserveinst) throws TaskException
createControlTask in interface TaskGraphTaskExceptionpublic void removeControlTask()
removeControlTask in interface TaskGraphpublic Task getControlTask()
getControlTask in interface TaskGraphpublic boolean isControlTask()
isControlTask in interface TaskGraphpublic boolean isControlTaskConnected()
isControlTaskConnected in interface TaskGraphpublic boolean isControlTaskUnstable()
isControlTaskUnstable in interface TaskGraphpublic int getControlTaskState()
getControlTaskState in interface TaskGraphpublic void setControlTaskState(int state)
setControlTaskState in interface TaskGraphpublic void addTaskGraphListener(TaskGraphListener listener)
addTaskGraphListener in interface TaskGraphpublic void removeTaskGraphListener(TaskGraphListener listener)
removeTaskGraphListener in interface TaskGraphpublic Task createTask(Tool tool) throws TaskException
createTask in interface TaskGraphTaskExceptionpublic Task createTask(Tool tool, boolean preserveinst) throws TaskException
createTask in interface TaskGraphTaskExceptionprotected Task createTaskNoNotify(Tool tool, boolean preserveinst) throws TaskException
TaskExceptionpublic void removeTask(Task task)
removeTask in interface TaskGraphpublic Task[] getTasks(boolean includecontrol)
public Task getTask(java.lang.String taskname)
public Task getTaskInstance(java.lang.String instanceid)
getTaskInstance in interface TaskGraphpublic boolean containsTask(java.lang.String identifier)
containsTask in interface TaskGraphpublic boolean containsTaskInstance(java.lang.String instanceid)
containsTaskInstance in interface TaskGraphpublic boolean containsTask(Task task)
containsTask in interface TaskGraphpublic boolean containsNode(Node node)
containsNode in interface TaskGraphpublic TaskGraph groupTasks(java.lang.String[] tasknames, java.lang.String groupname) throws TaskException
groupTasks in interface TaskGraphTaskExceptionpublic void unGroupTask(java.lang.String groupname)
throws TaskGraphException
unGroupTask in interface TaskGraphTaskGraphExceptionpublic void ungroup()
public Node addDataInputNode(Node parent) throws NodeException
addDataInputNode in interface TaskGraphNodeExceptionpublic Node addDataOutputNode(Node parent) throws NodeException
addDataOutputNode in interface TaskGraphNodeExceptionpublic void setGroupNodeParent(Node groupnode, Node parentnode)
setGroupNodeParent in interface TaskGraphpublic Node getGroupNodeParent(Node groupnode)
getGroupNodeParent in interface TaskGraphpublic void swapGroupNodeParents(Node groupnode1, Node groupnode2)
swapGroupNodeParents in interface TaskGraphpublic void removeDataInputNode(Node node)
removeDataInputNode in interface TaskremoveDataInputNode in class TaskImppublic void removeDataOutputNode(Node node)
removeDataOutputNode in interface TaskremoveDataOutputNode in class TaskImppublic Cable connect(Node sendnode, Node recnode) throws CableException
connect in interface TaskGraphCableExceptionpublic void disconnect(Cable cable) throws CableException
disconnect in interface TaskGraphCableExceptionpublic void taskPropertyUpdate(TaskPropertyEvent event)
taskPropertyUpdate in interface TaskListenerpublic void taskNameUpdate(Task task)
public void nodeAdded(TaskNodeEvent event)
nodeAdded in interface TaskListenerpublic void nodeRemoved(TaskNodeEvent event)
nodeRemoved in interface TaskListenerpublic void taskDisposed(TaskDisposedEvent event)
taskDisposed in interface TaskListenerpublic void parameterUpdated(ParameterUpdateEvent event)
parameterUpdated in interface TaskListenerprotected void notifyTaskCreated(Task task, boolean groupevent, boolean ungroupevent)
protected void notifyTaskRemoved(Task task, boolean groupevent, boolean ungroupevent)
protected void notifyCableConnected(Cable cable, boolean groupevent, boolean ungroupevent)
protected void notifyCableDisconnected(Cable cable, boolean groupevent, boolean ungroupevent)
protected void notifyCableReconnected(Cable cable, boolean inputrecon)
public void dispose()
public void executionStateChanged(ExecutionEvent event)
ExecutionListenerexecutionStateChanged in interface ExecutionListenerpublic void executionRequested(ExecutionEvent event)
ExecutionListenerexecutionRequested in interface ExecutionListenerpublic void executionStarting(ExecutionEvent event)
ExecutionListenerexecutionStarting in interface ExecutionListenerpublic void executionFinished(ExecutionEvent event)
ExecutionListenerexecutionFinished in interface ExecutionListenerpublic void executionReset(ExecutionEvent event)
ExecutionListenerexecutionReset in interface ExecutionListener