harmonic.mz.data.fields
Class NodeSetField

java.lang.Object
  |
  +--harmonic.mz.data.ModelNode
        |
        +--harmonic.mz.data.fields.NodeSetField
All Implemented Interfaces:
java.awt.event.ActionListener, DataNode, Documentable, java.util.EventListener, Interpolater, harmonic.meshGeom.math.MarkableObject, NodeListener

public class NodeSetField
extends ModelNode

This is the field contains a list of other nodes. When this field is contructed, it may be instructed to take nodes added to as its formal children (parenting the nodes to itself in the database), or to only keep a list in its own special array. Thus this class may be used for forming both trees and general networks of nodes. This field updates listeners when children are added or removed, and registers itself as a listener of any nodes added to it, so that if they are changed this fields listeners are updated. Note this is not the usual case for a tree node: usually a child doesn't tell its parent if it is changed.


Field Summary
 boolean bIncremental
           
 boolean bIsObjectSet
           
 boolean bNodeParent
           
 boolean bPickInvisible
           
 int exactCount
           
 java.lang.String[] filter
           
 ShapeNode[] include
           
 int minCount
           
 java.util.Vector nodes
           
 
Fields inherited from class harmonic.mz.data.ModelNode
_fileRoot_, _thread_, ATTRIB_CONTROL_WIDGET, ATTRIB_LISTABLE, ATTRIB_PRESENTABLE, ATTRIB_PRIVATE, ATTRIB_REMOVEABLE, ATTRIB_RENAMEABLE, ATTRIB_SHOW_CONTEXT_MENU, ATTRIB_TYPE_FILTER, ATTRIB_USERGROUP, ATTRIB_VALUE_GROUP, ATTRIB_VE_LISTENER, bCustomCS, bDebug, bValid, name
 
Constructor Summary
NodeSetField(boolean bNodeParent)
          Constructs a NodeSetField
NodeSetField(boolean bNodeParent, DataNode node)
          Constructs a NodeSetField
 
Method Summary
 void addNetworkInput(DataNode node)
          Overrides network editor behaviour
 void addNode(DataNode child)
          This overrides DataNode.addNode() to assert that this has been initialized as a parenting node, and to add this as a listener to child
 void addSharedNode(DataNode p)
          DataNode.add() will always really add given node as a child, removing from the old parent if there is one.
 void addSharedNodes(DataNode[] n)
          Array version of addSharedNode
 void assignFromXMLString(MVGFileOpener opener, java.lang.String string)
          Implements XML string in
 java.lang.String assignToXMLString(MVGFileSaver saver)
          Implements XML string out
 java.lang.String checkNetworkInput(DataNode node)
          Overrides network editor behaviour
 java.awt.Component createControlWidget()
          Implements abstract control widget creator by returning a NodeSetEntry
 ModelNode[] getModelNodeSelection()
          Returns selection set filterd to only have ModelNode's
 java.util.Vector getSelection_Vector()
          Returns an array of contained nodes.
 DataNode[] getSelection()
          Returns an array of contained nodes.
 ShapeNode[] getShapeSelection()
          Returns selection set filterd to only have ShapeDef's
 DataNode[] getTempSelection()
           
 void initControlWidget(java.awt.Component e)
          Implements abstract control widget initializer
 boolean isFinal()
          Returns !getTransient()
 boolean isObjectSet()
          Returns whether this is to be set of ShapeDef's
 boolean isSet()
          Returns whether user interface effecting this node has set its value yet.
 DataNode nodeAt(int i)
          Return contained node at index
 int nodeCount()
          DataNode.nodeCount() will always return the number for formal children.
 void purgeFinal()
          Called by database when node is intended to never come back, such as when a file is closed or node is deleted out of the undo system.
 java.lang.String pythonString()
          String for represention in python.
 void removeNetworkInput(DataNode node)
          Overrides network editor behaviour
 void removeNode(DataNode child, boolean bUnlink)
          This overrides DataNode.remove to remove this from child's listeners
 void removeSharedNode(DataNode p)
          Opposite of addNode()
 void removeSharedNodes()
          Remove all shared nodes
 ShapeNode sdat(int i)
          Handy function for geting node at index, if is it is known all contained nodes are ShapeDefs
 void set(DataNode _source)
          Does proper copying.
 void setExactCount(int n)
          Sets the exact count requirement used to select nodes, passed on to control widget.
 void setFilter(java.lang.String[] filter)
          Sets the filter to be used to select nodes, passed on to control widget.
 void setInclude(ShapeNode[] include)
          Sets the intance filter to be used to select nodes, passed on to control widget.
 void setIsObjectSet(boolean b)
          Set whether this is to be set of ShapeDef's
 void setMinCount(int n)
          Sets the minimum count requirement used to select nodes, passed on to control widget.
 void setPickInvisible(boolean b)
          Sets the whether the object entry device should be able to pick invisible object when filing this nodes value
 void setSelection(DataNode[] nodes)
           
 void setSingleNode(DataNode child)
          Removes any other nodes and adds the given node.
 DataNode singleNode()
          Returns the first node if list, null if list is empty.
 int tempCount()
           
static java.lang.String userString(DataNode p)
           
 java.lang.String valueString()
          String to represent value
 
Methods inherited from class harmonic.mz.data.ModelNode
actionPerformed, addAll, addAlphaed, addField, addField, addField, addFields, addNetworkInput, addNetworkOutput, addNodeListener, addNodeListener, addNodes, addNodes, addToCurrent, addToGlobals, addToNetworkEditor, addToTemps, addWithUndo, allFieldsAreFinal, applyDataTransfer, areFieldsValid, assignFromMetaFields, assignFromXMLAttributes, assignToMetaFields, assignToXMLAttributes, at, bind, canSelect, castSelection, checkFileRead, checkNetworkInput, childCount, clean, clearAttrib, clearNotified, compare, copyFrom, createCopy, createXMLElement, deepCopy, defeatNodeEvents, disableEvents, enableEvents, expectedValidationTime, fileRoot, finalize, findFieldElement, findNode, fromXMLNodes, getAttrib, getBound, getCatagory, getControlWidget, getCurrentNames, getDataTransfer, getDataTransferTypes, getDeleted, getDirectInputs, getDirectOutputs, getEffectors, getEntryListener, getErrorState, getFilterType, getFullName, getHandles, getInstanceURL, getInterpolater, getIsLeaf, getListable, getMark, getMetaFields, getName, getNodeChildren_V, getNodeChildren, getNodeID, getNodeParent, getObjectRep, getPresentable, getPrivate, getReferencePoolName, getRemoteOwner, getRemoveable, getRenameable, getSaveable, getSavedChildren, getSelect, getSeparateDirectInputs, getSeparateDirectOutputs, getSequenced, getSerialNo, getTags, getTentativeSelect, getTransformable, getTransformableParent, getTransient, getTreeName, getTypeImage, getTypeURL, getUnfoldedChildren, getUpdateTime, getUserGroup, getValidates, getValue, getXMLNodes, hasDependants, hasExternalRef, hashKey, hasValidationLock, hideControlWidget, indexOf, initControlWidget, insertNode, interpolate_Linear, interpolate_Quadratic, invalidate, isField, isInSubtree, isInTree, isLinked, isNotified, isPurged, isTemporary, isValid, linkedTo, linksChildren, makeContextMenu, makeFixed, makePrototype, makeReferenced, makeUnreferenced, makeVisibleInGUI, markNotified, mayValidate, nodeChanged, notifyListeners, postAssignFromXMLElement, preAssignToXMLElement, printChildren, printTags, printTree, printTree, purge, remove, removeAll, removeAll, removeHandles, removeNetworkInput, removeNetworkOutput, removeNode, removeNode, removeNodeListener, replace, selfNodeChanged, setActualName, setAttrib, setBound, setCatagory, setChildrenExcept, setCoordSystem, setCurrentControlWidget, setCurrentNames, setDeleted, setEntryListener, setErrorState, setFromPrototype, setIsField, setIsLeaf, setIsSet, setListable, setMark, setMetaFields, setName, setNodeParent, setPresentable, setPrivate, setRemoteOwner, setRemoveable, setRenameable, setSaveable, setSelect, setSelect, setSequenced, setSerialNo, setTentativeSelect, setTentativeSelect, setToLink, setTransient, setTransientChildren, setUpdateTime, setUserGroup, setValidates, setValidationLock, setValue, setValueGroup, showControlWidget, showControlWidget, showControlWidget, showHandles, startRename, tag, toString, unlinkListeners, unmarkNotified, untag, updateBindable, valChanged, valChanged, validate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

minCount

public int minCount

exactCount

public int exactCount

filter

public java.lang.String[] filter

include

public ShapeNode[] include

bIncremental

public boolean bIncremental

bPickInvisible

public boolean bPickInvisible

nodes

public java.util.Vector nodes

bNodeParent

public boolean bNodeParent

bIsObjectSet

public boolean bIsObjectSet
Constructor Detail

NodeSetField

public NodeSetField(boolean bNodeParent)
Constructs a NodeSetField

Parameters:
bNodeParent - Controls whether nodes will be added as formal children

NodeSetField

public NodeSetField(boolean bNodeParent,
                    DataNode node)
Constructs a NodeSetField

Parameters:
bNodeParent - Controls whether nodes will be added as formal children
node - Node is added
Method Detail

set

public void set(DataNode _source)
Does proper copying. If this is not a parent - list of references are copied. Otherwise, new children are created for destination that are clones of the source children. The NodeSetField has the assumption that children will not automatically be added by the NodeSetField's parent - it is to hold user defined children.

Specified by:
set in interface DataNode
Overrides:
set in class ModelNode

isObjectSet

public boolean isObjectSet()
Returns whether this is to be set of ShapeDef's


setIsObjectSet

public void setIsObjectSet(boolean b)
Set whether this is to be set of ShapeDef's


purgeFinal

public void purgeFinal()
Description copied from class: ModelNode
Called by database when node is intended to never come back, such as when a file is closed or node is deleted out of the undo system. Override to purge all memory usded by this node. Its easy to think that just removing the node from the tree would cause it to be garbage collected, but references to nodes can be hard to compleatly remove, so this function exists to minimize the damage of a leaked node.

Specified by:
purgeFinal in interface DataNode
Overrides:
purgeFinal in class ModelNode

getShapeSelection

public ShapeNode[] getShapeSelection()
Returns selection set filterd to only have ShapeDef's


getModelNodeSelection

public ModelNode[] getModelNodeSelection()
Returns selection set filterd to only have ModelNode's


getSelection

public DataNode[] getSelection()
Returns an array of contained nodes.


getTempSelection

public DataNode[] getTempSelection()

getSelection_Vector

public java.util.Vector getSelection_Vector()
Returns an array of contained nodes.


singleNode

public DataNode singleNode()
Returns the first node if list, null if list is empty. Intended for use when only one node is expected.


sdat

public ShapeNode sdat(int i)
Handy function for geting node at index, if is it is known all contained nodes are ShapeDefs


nodeCount

public int nodeCount()
DataNode.nodeCount() will always return the number for formal children. This returns the child count of the unparented node list count depending on if this is node parent. Note if this keeping nodes as children, and the size of this list is 0, this function actually returns the size of the non-chidren node list, the assumption being that the nodes are only temporarally in the non-children list.


tempCount

public int tempCount()

nodeAt

public DataNode nodeAt(int i)
Return contained node at index


addSharedNode

public void addSharedNode(DataNode p)
DataNode.add() will always really add given node as a child, removing from the old parent if there is one. This function only adds to a special node list that is not considered a list of children. This function may be called if this is intended to be a node parent. A subsequent call to DataManager.prepareCompositeObject will transfer the node list to the formal child list according to compositing mode.


addSharedNodes

public void addSharedNodes(DataNode[] n)
Array version of addSharedNode


removeSharedNode

public void removeSharedNode(DataNode p)
Opposite of addNode()


removeSharedNodes

public void removeSharedNodes()
Remove all shared nodes


addNode

public void addNode(DataNode child)
This overrides DataNode.addNode() to assert that this has been initialized as a parenting node, and to add this as a listener to child

Specified by:
addNode in interface DataNode
Overrides:
addNode in class ModelNode

setSingleNode

public void setSingleNode(DataNode child)
Removes any other nodes and adds the given node.


removeNode

public void removeNode(DataNode child,
                       boolean bUnlink)
This overrides DataNode.remove to remove this from child's listeners

Specified by:
removeNode in interface DataNode
Overrides:
removeNode in class ModelNode
Parameters:
child - Node to remove
bUnlink - Indicates a more thorough removeal is done.

checkNetworkInput

public java.lang.String checkNetworkInput(DataNode node)
Overrides network editor behaviour


addNetworkInput

public void addNetworkInput(DataNode node)
Overrides network editor behaviour


removeNetworkInput

public void removeNetworkInput(DataNode node)
Overrides network editor behaviour


setFilter

public void setFilter(java.lang.String[] filter)
Sets the filter to be used to select nodes, passed on to control widget.


setMinCount

public void setMinCount(int n)
Sets the minimum count requirement used to select nodes, passed on to control widget.


setExactCount

public void setExactCount(int n)
Sets the exact count requirement used to select nodes, passed on to control widget.


setInclude

public void setInclude(ShapeNode[] include)
Sets the intance filter to be used to select nodes, passed on to control widget.


setPickInvisible

public void setPickInvisible(boolean b)
Sets the whether the object entry device should be able to pick invisible object when filing this nodes value


createControlWidget

public java.awt.Component createControlWidget()
Implements abstract control widget creator by returning a NodeSetEntry

Overrides:
createControlWidget in class ModelNode

initControlWidget

public void initControlWidget(java.awt.Component e)
Implements abstract control widget initializer


setSelection

public void setSelection(DataNode[] nodes)

isSet

public boolean isSet()
Description copied from class: ModelNode
Returns whether user interface effecting this node has set its value yet. Nodes are created with the set flag on by default. A user interface may turn it off to let dependancies know ther user has not set its value yet.

Overrides:
isSet in class ModelNode

isFinal

public boolean isFinal()
Description copied from class: ModelNode
Returns !getTransient()

Overrides:
isFinal in class ModelNode

assignToXMLString

public java.lang.String assignToXMLString(MVGFileSaver saver)
Implements XML string out

Overrides:
assignToXMLString in class ModelNode

assignFromXMLString

public void assignFromXMLString(MVGFileOpener opener,
                                java.lang.String string)
Implements XML string in

Overrides:
assignFromXMLString in class ModelNode

userString

public static java.lang.String userString(DataNode p)

valueString

public java.lang.String valueString()
Description copied from class: ModelNode
String to represent value

Specified by:
valueString in interface DataNode
Overrides:
valueString in class ModelNode

pythonString

public java.lang.String pythonString()
Description copied from class: ModelNode
String for represention in python. Thie is deprecated. Use valueString().

Overrides:
pythonString in class ModelNode