com.altair.hwm.toolkit.workflow
Class HWMWorkflowNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by com.altair.hwm.toolkit.workflow.HWMWorkflowNode
All Implemented Interfaces:
java.awt.datatransfer.Transferable, java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class HWMWorkflowNode
extends javax.swing.tree.DefaultMutableTreeNode
implements java.awt.datatransfer.Transferable

Title: HWMWorkflowNode

Description: A tree node that contains information about a workflow task

Company: Altair Engineering, Inc.

Version:
2.0
See Also:
Serialized Form

Field Summary
static int ASSOCTYPE_PAGE
          The association types
static int ASSOCTYPE_TCL
           
static int FOLDER
          The types of node
static java.awt.datatransfer.DataFlavor s_dataFlavorWrkflowNode
          The flavor that this transferable class supports
static int TASK
           
 java.lang.String VERSION
          version for this class
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
EMPTY_ENUMERATION
 
Constructor Summary
HWMWorkflowNode()
          Constructor
HWMWorkflowNode(java.lang.Object objUserObject, boolean bAllowsChildren)
          Constructor
HWMWorkflowNode(java.lang.Object objUserObject, boolean bAllowsChildren, java.lang.String strNodeName)
          Constructor
 
Method Summary
 int GetAssociation()
          Gets the type of association with the node.
 boolean GetDockableState()
          Gets the node's dockable state.
 java.lang.String GetHelpFileName()
          Returns the name of the help file associated with the node
 java.lang.String GetIconFileName()
          Returns the name of the icon file.
 java.lang.String GetNodeDisplayName()
          Returns the name of the node which is displayed
 java.lang.String GetNodeName()
          Returns the name of the node
 int GetNodeType()
          Returns the type of the node
 HWMActionScript GetOnCloseActionScript()
          Get the Action Script for the OnClose event
 HWMActionScript GetOnDisplayActionScript()
          Get the Action Script for the OnDisplay event
 int GetPageID()
          Returns the ID of the associated HWMPage
 int GetPlayOption()
          Gets the play option: one of PLAYOPTION_XXX
 int GetState()
          Gets the node state.
 java.lang.String GetTCLFilePrefix()
          Returns the name of the TCL file preifx.
 java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor dataFlavor)
          Returns the data that needs to be transferred i.e.
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
          Returns all the flavors that this class supports
 boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor dataFlavor)
          Returns true if the given falvor is supported else false
 boolean IsDockable()
          Returns if this node is dockable or not
 boolean IsEnabled()
          Returns the node ENABLE state.
 boolean IsVisible()
          Returns if this node is visible or not
 void OnClose(HWMModelInstance hwmModelInstance)
          This method is called when the node is about to be closed
 void OnDisplay(HWMModelInstance hwmModelInstance)
          This method is called when the node is about to be displayed
 void readExternal(java.io.ObjectInput streamInput)
          Loads this class
 void SetAssociation(int nAssocType)
          Sets the type of association with the node.
 void SetDockable(boolean bDockable)
           
 void SetEnabledState(boolean bEnableState)
          Sets the ENABLE state of the node - TRUE/FALSE
 void SetHelpFileName(java.lang.String szNewName)
          Sets the name of the help file associated with the node.
 void SetIconFileName(java.lang.String szIconFile)
          Sets the name if the icons file to show for this node.
 void SetNodeDisplayName(java.lang.String szNewName)
          Sets the string that will be displayed in the tree node.
 void SetNodeName(java.lang.String szNewName)
          Sets the string that will be displayed in the tree node.
 void SetNodeType(int nNewType)
          Sets the type of the node.
 void SetOnCloseActionScript(HWMActionScript hwmActionScript)
          Set the Action Script for the OnClose event
 void SetOnDisplayActionScript(HWMActionScript hwmActionScript)
          Set the Action Script for the OnDisplay event
 void SetPageID(int nNewID)
          Sets the HWMPage that is associated with the node.
 void SetPlayOption(int nPlayOption)
          Set the play option: one of PLAYOPTION_XXX
 void SetState(int nState)
          Sets the state of the node - one of STATE_XXX
 void SetTCLFilePrefix(java.lang.String strTCLFilePrefix)
          Sets the prefix of the TCL file that should be executed when the task is selected.
 void SetVisible(boolean bVisible)
           
 void writeExternal(java.io.ObjectOutput streamOut)
          Saves this class
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FOLDER

public static final int FOLDER
The types of node

See Also:
Constant Field Values

TASK

public static final int TASK
See Also:
Constant Field Values

VERSION

public final java.lang.String VERSION
version for this class

See Also:
Constant Field Values

ASSOCTYPE_PAGE

public static final int ASSOCTYPE_PAGE
The association types

See Also:
Constant Field Values

ASSOCTYPE_TCL

public static final int ASSOCTYPE_TCL
See Also:
Constant Field Values

s_dataFlavorWrkflowNode

public static java.awt.datatransfer.DataFlavor s_dataFlavorWrkflowNode
The flavor that this transferable class supports

Constructor Detail

HWMWorkflowNode

public HWMWorkflowNode()
Constructor


HWMWorkflowNode

public HWMWorkflowNode(java.lang.Object objUserObject,
                       boolean bAllowsChildren)
Constructor

Parameters:
objUserObject - The object stored in the node
bAllowsChildren - True if accepts children, false if not.

HWMWorkflowNode

public HWMWorkflowNode(java.lang.Object objUserObject,
                       boolean bAllowsChildren,
                       java.lang.String strNodeName)
Constructor

Parameters:
objUserObject - The object stored in the node
bAllowsChildren - True if accepts children, false if not.
strNodeName - The unique name for the node
Method Detail

GetNodeName

public java.lang.String GetNodeName()
Returns the name of the node

Returns:
String The name of the node.

SetNodeName

public void SetNodeName(java.lang.String szNewName)
Sets the string that will be displayed in the tree node. NOTE: Replaces any '.' and ' ' with '_'

Parameters:
szNewName - The new name of the node

GetNodeDisplayName

public java.lang.String GetNodeDisplayName()
Returns the name of the node which is displayed

Returns:
String The name of the node.

SetNodeDisplayName

public void SetNodeDisplayName(java.lang.String szNewName)
Sets the string that will be displayed in the tree node. NOTE: Replaces any '.' with '_'

Parameters:
szNewName - The new name of the node

SetPageID

public void SetPageID(int nNewID)
Sets the HWMPage that is associated with the node. This is only used for nodes of the type TASK.

Parameters:
szNewName -

GetPageID

public int GetPageID()
Returns the ID of the associated HWMPage

Returns:
int The id of the page

SetHelpFileName

public void SetHelpFileName(java.lang.String szNewName)
Sets the name of the help file associated with the node. Currently this is an html file. This is only used for nodes of the type TASK.

Parameters:
szNewName - The name of the help file.

GetHelpFileName

public java.lang.String GetHelpFileName()
Returns the name of the help file associated with the node

Returns:
String The name of the help file

SetNodeType

public void SetNodeType(int nNewType)
Sets the type of the node.

Parameters:
nNewType - The node type: HWMWorkflowNode.FOLDER or HWMWorkflowNode.TASK

GetNodeType

public int GetNodeType()
Returns the type of the node

Returns:
int The type of the node.

SetAssociation

public void SetAssociation(int nAssocType)
Sets the type of association with the node.

Parameters:
nAssociation - Set the association type: one of ASSOCTYPE_XXX

GetAssociation

public int GetAssociation()
Gets the type of association with the node.

Returns:
int the association type: one of ASSOCTYPE_XXX

SetState

public void SetState(int nState)
Sets the state of the node - one of STATE_XXX

Parameters:
nState - Set the state: one of STATE_XXX

GetState

public int GetState()
Gets the node state.

Returns:
int the node state: one of STATE_XXX

SetPlayOption

public void SetPlayOption(int nPlayOption)
Set the play option: one of PLAYOPTION_XXX

Parameters:
nPlayOption - the play option: one of PLAYOPTION_XXX

GetPlayOption

public int GetPlayOption()
Gets the play option: one of PLAYOPTION_XXX

Returns:
int the play option: one of PLAYOPTION_XXX

SetTCLFilePrefix

public void SetTCLFilePrefix(java.lang.String strTCLFilePrefix)
Sets the prefix of the TCL file that should be executed when the task is selected.

Parameters:
strTCLFilePrefix - - TCL Fileprefix

GetTCLFilePrefix

public java.lang.String GetTCLFilePrefix()
Returns the name of the TCL file preifx.

Returns:
String The TCL file prefix

SetIconFileName

public void SetIconFileName(java.lang.String szIconFile)
Sets the name if the icons file to show for this node. The program will look in a dir call icons in the template dir.

Parameters:
szIconFile - Filename of the icon

GetIconFileName

public java.lang.String GetIconFileName()
Returns the name of the icon file.

Returns:
String

SetVisible

public void SetVisible(boolean bVisible)

IsVisible

public boolean IsVisible()
Returns if this node is visible or not

Returns:
boolean If visible - true else false

SetDockable

public void SetDockable(boolean bDockable)

IsDockable

public boolean IsDockable()
Returns if this node is dockable or not

Returns:
boolean If dockable - true else false

GetDockableState

public boolean GetDockableState()
Gets the node's dockable state.

Returns:
boolean - the node dockable state

SetEnabledState

public void SetEnabledState(boolean bEnableState)
Sets the ENABLE state of the node - TRUE/FALSE

Parameters:
bEnableState - - boolean flag

IsEnabled

public boolean IsEnabled()
Returns the node ENABLE state.

Returns:
boolean - ENABLE state - true/false

readExternal

public void readExternal(java.io.ObjectInput streamInput)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Loads this class

Parameters:
streamInput - The input stream to read from
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput streamOut)
                   throws java.io.IOException
Saves this class

Parameters:
streamOut - The stream to write to
Throws:
java.io.IOException

getTransferDataFlavors

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Returns all the flavors that this class supports

Specified by:
getTransferDataFlavors in interface java.awt.datatransfer.Transferable
Returns:
DataFlavor[] The list of flavors that this class supports

isDataFlavorSupported

public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor dataFlavor)
Returns true if the given falvor is supported else false

Specified by:
isDataFlavorSupported in interface java.awt.datatransfer.Transferable
Parameters:
dataFlavor - The flavor that needs to be checked with the list of supported falvors
Returns:
boolean true if dataFlavor is supported else false

getTransferData

public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor dataFlavor)
                                 throws java.awt.datatransfer.UnsupportedFlavorException,
                                        java.io.IOException
Returns the data that needs to be transferred i.e. HWMBeanInfo as the given flavor.

Specified by:
getTransferData in interface java.awt.datatransfer.Transferable
Parameters:
dataFlavor - The flavor that the data should be passed in
Returns:
Object The data tat needs to be transferred. It is returned in the flavor that was requested
Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException

SetOnDisplayActionScript

public void SetOnDisplayActionScript(HWMActionScript hwmActionScript)
Set the Action Script for the OnDisplay event

Parameters:
hwmActionScript - The Action Script

GetOnDisplayActionScript

public HWMActionScript GetOnDisplayActionScript()
Get the Action Script for the OnDisplay event

Returns:
HWMActionScript The Action Script

SetOnCloseActionScript

public void SetOnCloseActionScript(HWMActionScript hwmActionScript)
Set the Action Script for the OnClose event

Parameters:
hwmActionScript - The Action Script

GetOnCloseActionScript

public HWMActionScript GetOnCloseActionScript()
Get the Action Script for the OnClose event

Returns:
HWMActionScript The Action Script

OnDisplay

public void OnDisplay(HWMModelInstance hwmModelInstance)
This method is called when the node is about to be displayed

Parameters:
hwmModelInstance - The framework handle

OnClose

public void OnClose(HWMModelInstance hwmModelInstance)
This method is called when the node is about to be closed

Parameters:
hwmModelInstance - The framework handle