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_UNSTABLE
DEFAULT_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_TYPE
ANY_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, updateProxy
addExtension, 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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addDataInputNode, 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, updateProxy
addExtension, 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, setVersion
protected java.util.ArrayList<ExecutionListener> execlisteners
public TaskGraphImp(TrianaProperties properties) throws TaskException
TaskException
public TaskGraphImp(Tool tool, TaskFactory factory, boolean preserveinst) throws TaskException
TaskException
public TaskGraphImp(Task[] tasks, TaskFactory factory, boolean preserveinst, TrianaProperties properties) throws TaskException
TaskException
public void addExecutionListener(ExecutionListener listener)
addExecutionListener
in interface TaskGraph
public void removeExecutionListener(ExecutionListener listener)
removeExecutionListener
in interface TaskGraph
public void init() throws TaskException
init
in interface Task
init
in class TaskImp
TaskException
public static void setPositionFromDoubles(Tool tool, java.lang.Double[] pos)
public java.lang.String[] getDataInputTypes(int index)
getDataInputTypes
in interface Tool
getDataInputTypes
in class ToolImp
public java.lang.String[] getDataOutputTypes(int index)
getDataOutputTypes
in interface Tool
getDataOutputTypes
in class ToolImp
public Task createControlTask(Tool tool, boolean preserveinst) throws TaskException
createControlTask
in interface TaskGraph
TaskException
public void removeControlTask()
removeControlTask
in interface TaskGraph
public Task getControlTask()
getControlTask
in interface TaskGraph
public boolean isControlTask()
isControlTask
in interface TaskGraph
public boolean isControlTaskConnected()
isControlTaskConnected
in interface TaskGraph
public boolean isControlTaskUnstable()
isControlTaskUnstable
in interface TaskGraph
public int getControlTaskState()
getControlTaskState
in interface TaskGraph
public void setControlTaskState(int state)
setControlTaskState
in interface TaskGraph
public void addTaskGraphListener(TaskGraphListener listener)
addTaskGraphListener
in interface TaskGraph
public void removeTaskGraphListener(TaskGraphListener listener)
removeTaskGraphListener
in interface TaskGraph
public Task createTask(Tool tool) throws TaskException
createTask
in interface TaskGraph
TaskException
public Task createTask(Tool tool, boolean preserveinst) throws TaskException
createTask
in interface TaskGraph
TaskException
protected Task createTaskNoNotify(Tool tool, boolean preserveinst) throws TaskException
TaskException
public void removeTask(Task task)
removeTask
in interface TaskGraph
public Task[] getTasks(boolean includecontrol)
public Task getTask(java.lang.String taskname)
public Task getTaskInstance(java.lang.String instanceid)
getTaskInstance
in interface TaskGraph
public boolean containsTask(java.lang.String identifier)
containsTask
in interface TaskGraph
public boolean containsTaskInstance(java.lang.String instanceid)
containsTaskInstance
in interface TaskGraph
public boolean containsTask(Task task)
containsTask
in interface TaskGraph
public boolean containsNode(Node node)
containsNode
in interface TaskGraph
public TaskGraph groupTasks(java.lang.String[] tasknames, java.lang.String groupname) throws TaskException
groupTasks
in interface TaskGraph
TaskException
public void unGroupTask(java.lang.String groupname) throws TaskGraphException
unGroupTask
in interface TaskGraph
TaskGraphException
public void ungroup()
public Node addDataInputNode(Node parent) throws NodeException
addDataInputNode
in interface TaskGraph
NodeException
public Node addDataOutputNode(Node parent) throws NodeException
addDataOutputNode
in interface TaskGraph
NodeException
public void setGroupNodeParent(Node groupnode, Node parentnode)
setGroupNodeParent
in interface TaskGraph
public Node getGroupNodeParent(Node groupnode)
getGroupNodeParent
in interface TaskGraph
public void swapGroupNodeParents(Node groupnode1, Node groupnode2)
swapGroupNodeParents
in interface TaskGraph
public void removeDataInputNode(Node node)
removeDataInputNode
in interface Task
removeDataInputNode
in class TaskImp
public void removeDataOutputNode(Node node)
removeDataOutputNode
in interface Task
removeDataOutputNode
in class TaskImp
public Cable connect(Node sendnode, Node recnode) throws CableException
connect
in interface TaskGraph
CableException
public void disconnect(Cable cable) throws CableException
disconnect
in interface TaskGraph
CableException
public void taskPropertyUpdate(TaskPropertyEvent event)
taskPropertyUpdate
in interface TaskListener
public void taskNameUpdate(Task task)
public void nodeAdded(TaskNodeEvent event)
nodeAdded
in interface TaskListener
public void nodeRemoved(TaskNodeEvent event)
nodeRemoved
in interface TaskListener
public void taskDisposed(TaskDisposedEvent event)
taskDisposed
in interface TaskListener
public void parameterUpdated(ParameterUpdateEvent event)
parameterUpdated
in interface TaskListener
protected 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)
ExecutionListener
executionStateChanged
in interface ExecutionListener
public void executionRequested(ExecutionEvent event)
ExecutionListener
executionRequested
in interface ExecutionListener
public void executionStarting(ExecutionEvent event)
ExecutionListener
executionStarting
in interface ExecutionListener
public void executionFinished(ExecutionEvent event)
ExecutionListener
executionFinished
in interface ExecutionListener
public void executionReset(ExecutionEvent event)
ExecutionListener
executionReset
in interface ExecutionListener