public class TaskImp extends ToolImp implements Task
Task.ConnectionStatus
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 |
---|
TaskImp(Tool tool,
TaskFactory factory,
boolean preserveinst) |
Modifier and Type | Method and Description |
---|---|
Node |
addDataInputNode()
Adds a data input node.
|
Node |
addDataOutputNode()
Adds a data output node.
|
void |
addDeclaredNodeProperty(java.lang.String prop) |
ParameterNode |
addParameterInputNode(java.lang.String paramname)
Adds a parameter input node for the specified parameter name.
|
ParameterNode |
addParameterOutputNode(java.lang.String paramname)
Adds a parameter output node for the specified paramter name.
|
void |
addTaskListener(TaskListener listener)
Adds a task listener to this task.
|
void |
dispose()
cleans up any operations associated with this task
|
int |
getAbsoluteNodeIndex(Node node)
This is a convience method to provide backward compatibility with TrianaGUI, in which parameter nodes where
indexed after data nodes.
|
TaskGraphContext |
getContext() |
java.lang.Object |
getContextProperty(java.lang.String name) |
Node |
getDataInputNode(int index) |
int |
getDataInputNodeCount() |
Node[] |
getDataInputNodes() |
Node |
getDataOutputNode(int index) |
int |
getDataOutputNodeCount() |
Node[] |
getDataOutputNodes() |
java.util.List<java.lang.String> |
getDeclaredNodeProperties() |
java.lang.String |
getDefaultNodeRequirement() |
java.lang.String |
getErrorMessage() |
int |
getExecutionCount() |
int |
getExecutionRequestCount() |
ExecutionState |
getExecutionState() |
Node |
getInputNode(int absoluteindex) |
Node[] |
getInputNodes() |
java.lang.String |
getInstanceID()
All copies of a task within a parameter space (sharing the same parameters) have the same intance id.
|
int |
getNodeIndex(Node node)
Returns the index of the specified node within the data input/output and parameter input/output nodes; or -1 if
not attached to this task.
|
java.lang.String |
getNodeRequirement(int index) |
Node |
getOutputNode(int absoluteindex) |
Node[] |
getOutputNodes() |
java.lang.String |
getParameterInputName(int index) |
ParameterNode |
getParameterInputNode(int index) |
int |
getParameterInputNodeCount() |
ParameterNode[] |
getParameterInputNodes() |
java.lang.String |
getParameterOutputName(int index) |
ParameterNode |
getParameterOutputNode(int index) |
int |
getParameterOutputNodeCount() |
ParameterNode[] |
getParameterOutputNodes() |
TaskGraph |
getParent() |
java.lang.String |
getQualifiedTaskName() |
TaskGraph |
getUltimateParent() |
void |
init()
Initialisation method is called immediately after the parent is set
|
boolean |
isDataInputNode(Node node) |
boolean |
isDataOutputNode(Node node) |
boolean |
isParameterInputNode(Node node) |
boolean |
isParameterOutputNode(Node node) |
boolean |
isParameterTriggerNode(int index) |
boolean |
isRunContinuously() |
protected void |
notifyNodeAdded(Node node)
Notifies all the task listeners that a node has been added.
|
protected void |
notifyNodeRemoved(Node node)
Notifies all the task listeners that a node has been removed.
|
protected void |
notifyParameterSet(java.lang.String name,
java.lang.String type,
java.lang.Object oldval,
java.lang.Object newval)
Notifies all the task listeners that a parameter has been set.
|
protected void |
notifyPropertyUpdate(int property,
java.lang.Object oldval,
java.lang.Object newval)
Notifies all the task listeners that a task property has been updated.
|
protected void |
notifyTaskDisposed()
Notifies all the task listeners that the task is about to be disposed
|
void |
removeDataInputNode(Node node)
Removes a data input node.
|
void |
removeDataOutputNode(Node node)
Removes a data output node.
|
void |
removeNode(Node node)
Removes the specified node
|
void |
removeParameter(java.lang.String name)
Removes the value associated with the specified parameter name.
|
void |
removeParameterInputNode(ParameterNode node)
Removes a parameter input node.
|
void |
removeParameterOutputNode(ParameterNode node)
Removes a parameter output node.
|
void |
removeProxy()
Removes the proxy for this tool
|
void |
removeTaskListener(TaskListener listener)
Removes a task listener from this task.
|
void |
setContextProperty(java.lang.String name,
java.lang.Object value) |
void |
setDataInputNodeCount(int nodeCount)
Used by ToolFactory to set the number of input nodes.
|
void |
setDataOutputNodeCount(int nodeCount)
Used by ToolFactory to set the number of output nodes.
|
void |
setDeclaredNodeProperties(java.util.List<java.lang.String> props) |
void |
setDefaultNodeRequirement(java.lang.String requirement)
Sets the default input node requirement for this task (ESSENTIAL, ESSENTIAL_IF_CONNECTED or OPTIONAL)
|
void |
setNodeRequirement(int index,
java.lang.String requirement)
Sets the input node requirement for the specified node index (ESSENTIAL, ESSENTIAL_IF_CONNECTED or OPTIONAL)
|
void |
setParameter(java.lang.String name,
java.lang.Object value)
Sets the value for the specified parameter name.
|
void |
setParameterInputs(java.lang.String[] names,
boolean[] trigger)
Used to set the names/number of input parameter nodes
|
void |
setParameterOutputNames(java.lang.String[] names)
Used to set the names/number of output parameter nodes
|
void |
setParent(TaskGraph taskgraph)
Sets the taskgraph that this task is located within
|
void |
setProxy(Proxy proxy)
Adds a proxy this tool
|
void |
setRunContinuously(boolean state)
Sets whether this task runs continuously.
|
void |
setSubTitle(java.lang.String subtext) |
void |
setToolName(java.lang.String toolname)
Sets the name associated with this Task.
|
void |
updateProxy()
Refreshes the proxy
|
addExtension, addRenderingHint, getDataInputTypes, getDataInputTypes, getDataOutputTypes, 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
addExtension, addRenderingHint, getDataInputTypes, getDataInputTypes, getDataOutputTypes, 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, getVersion, isExtensionName, isParameterName, isRenderingHint, removeExtension, removeRenderingHint, setDataInputTypes, setDataOutputTypes, setDefinitionPath, setDefinitionType, setHelpFile, setParameterOutputs, setParameterType, setPopUpDescription, setProperties, setToolBox, setToolPackage, setVersion
public TaskImp(Tool tool, TaskFactory factory, boolean preserveinst) throws TaskException
TaskException
public void init() throws TaskException
init
in interface Task
TaskException
public void setToolName(java.lang.String toolname)
setToolName
in interface Tool
setToolName
in class ToolImp
public java.lang.String getQualifiedTaskName()
getQualifiedTaskName
in interface Task
public TaskGraph getParent()
public TaskGraph getUltimateParent()
getUltimateParent
in interface Task
public void setParent(TaskGraph taskgraph)
public java.lang.String getInstanceID()
getInstanceID
in interface Task
public void setProxy(Proxy proxy) throws TaskException
setProxy
in interface Tool
setProxy
in class ToolImp
TaskException
public void updateProxy()
updateProxy
in interface Task
public void removeProxy() throws TaskException
removeProxy
in interface Tool
removeProxy
in class ToolImp
TaskException
public void addTaskListener(TaskListener listener)
addTaskListener
in interface Task
public void removeTaskListener(TaskListener listener)
removeTaskListener
in interface Task
public void setParameter(java.lang.String name, java.lang.Object value)
setParameter
in interface Tool
setParameter
in class ToolImp
public void removeParameter(java.lang.String name)
removeParameter
in interface Tool
removeParameter
in class ToolImp
public Node addDataInputNode() throws NodeException
addDataInputNode
in interface Task
NodeException
public void removeDataInputNode(Node node)
removeDataInputNode
in interface Task
public Node getDataInputNode(int index)
getDataInputNode
in interface Task
public Node[] getDataInputNodes()
getDataInputNodes
in interface Task
public int getDataInputNodeCount()
getDataInputNodeCount
in interface Tool
getDataInputNodeCount
in class ToolImp
public void setDataInputNodeCount(int nodeCount) throws NodeException
setDataInputNodeCount
in class ToolImp
NodeException
public Node addDataOutputNode() throws NodeException
addDataOutputNode
in interface Task
NodeException
public void removeDataOutputNode(Node node)
removeDataOutputNode
in interface Task
public Node getDataOutputNode(int index)
getDataOutputNode
in interface Task
public Node[] getDataOutputNodes()
getDataOutputNodes
in interface Task
public int getDataOutputNodeCount()
getDataOutputNodeCount
in interface Tool
getDataOutputNodeCount
in class ToolImp
public void setDataOutputNodeCount(int nodeCount) throws NodeException
setDataOutputNodeCount
in class ToolImp
NodeException
public ParameterNode addParameterInputNode(java.lang.String paramname) throws NodeException
addParameterInputNode
in interface Task
NodeException
public void removeParameterInputNode(ParameterNode node)
removeParameterInputNode
in interface Task
public void setParameterInputs(java.lang.String[] names, boolean[] trigger) throws NodeException
setParameterInputs
in interface Tool
setParameterInputs
in class ToolImp
NodeException
public ParameterNode getParameterInputNode(int index)
getParameterInputNode
in interface Task
public java.lang.String getParameterInputName(int index)
getParameterInputName
in interface Tool
getParameterInputName
in class ToolImp
public boolean isParameterTriggerNode(int index)
isParameterTriggerNode
in interface Tool
isParameterTriggerNode
in class ToolImp
public ParameterNode[] getParameterInputNodes()
getParameterInputNodes
in interface Task
public int getParameterInputNodeCount()
getParameterInputNodeCount
in interface Tool
getParameterInputNodeCount
in class ToolImp
public ParameterNode addParameterOutputNode(java.lang.String paramname) throws NodeException
addParameterOutputNode
in interface Task
NodeException
public void removeParameterOutputNode(ParameterNode node)
removeParameterOutputNode
in interface Task
public void setParameterOutputNames(java.lang.String[] names) throws NodeException
NodeException
public java.lang.String getParameterOutputName(int index)
getParameterOutputName
in interface Tool
getParameterOutputName
in class ToolImp
public ParameterNode getParameterOutputNode(int index)
getParameterOutputNode
in interface Task
public ParameterNode[] getParameterOutputNodes()
getParameterOutputNodes
in interface Task
public int getParameterOutputNodeCount()
getParameterOutputNodeCount
in interface Tool
getParameterOutputNodeCount
in class ToolImp
public int getNodeIndex(Node node)
getNodeIndex
in interface Task
public int getAbsoluteNodeIndex(Node node)
getAbsoluteNodeIndex
in interface Task
public boolean isDataInputNode(Node node)
isDataInputNode
in interface Task
public boolean isDataOutputNode(Node node)
isDataOutputNode
in interface Task
public boolean isParameterInputNode(Node node)
isParameterInputNode
in interface Task
public boolean isParameterOutputNode(Node node)
isParameterOutputNode
in interface Task
public Node[] getInputNodes()
getInputNodes
in interface Task
public Node getInputNode(int absoluteindex)
getInputNode
in interface Task
public Node[] getOutputNodes()
getOutputNodes
in interface Task
public Node getOutputNode(int absoluteindex)
getOutputNode
in interface Task
public void removeNode(Node node)
removeNode
in interface Task
public boolean isRunContinuously()
isRunContinuously
in interface Task
public void setRunContinuously(boolean state)
setRunContinuously
in interface Task
public void setDefaultNodeRequirement(java.lang.String requirement)
setDefaultNodeRequirement
in interface Task
public java.lang.String getDefaultNodeRequirement()
getDefaultNodeRequirement
in interface Task
public void setNodeRequirement(int index, java.lang.String requirement)
setNodeRequirement
in interface Task
public java.lang.String getNodeRequirement(int index)
getNodeRequirement
in interface Task
public int getExecutionRequestCount()
getExecutionRequestCount
in interface Task
public int getExecutionCount()
getExecutionCount
in interface Task
public ExecutionState getExecutionState()
getExecutionState
in interface Task
public java.lang.String getErrorMessage()
getErrorMessage
in interface Task
protected void notifyPropertyUpdate(int property, java.lang.Object oldval, java.lang.Object newval)
protected void notifyNodeAdded(Node node)
protected void notifyNodeRemoved(Node node)
protected void notifyParameterSet(java.lang.String name, java.lang.String type, java.lang.Object oldval, java.lang.Object newval)
protected void notifyTaskDisposed()
public void dispose()
public TaskGraphContext getContext()
getContext
in interface Task
public java.lang.Object getContextProperty(java.lang.String name)
getContextProperty
in interface Task
public void setContextProperty(java.lang.String name, java.lang.Object value)
setContextProperty
in interface Task
public void setDeclaredNodeProperties(java.util.List<java.lang.String> props)
setDeclaredNodeProperties
in interface Task
public void addDeclaredNodeProperty(java.lang.String prop)
addDeclaredNodeProperty
in interface Task
public java.util.List<java.lang.String> getDeclaredNodeProperties()
getDeclaredNodeProperties
in interface Task
public void setSubTitle(java.lang.String subtext)
setSubTitle
in interface Tool
setSubTitle
in class ToolImp