jsynoptic.plugins.java3d.tree
Class SceneGraphNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by jsynoptic.plugins.java3d.tree.AbstractNode
          extended by jsynoptic.plugins.java3d.tree.SceneGraphNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode, AddRemoveSceneGraphObject
Direct Known Subclasses:
AnimatorNode, AppearanceNode, GroupNode, ShapeNode

public class SceneGraphNode
extends AbstractNode
implements AddRemoveSceneGraphObject

A Node to hold a Scene Graph Object

See Also:
Serialized Form

Nested Class Summary
static class SceneGraphNode.CopyAction
           
static class SceneGraphNode.CutAction
           
static class SceneGraphNode.PasteAction
           
static class SceneGraphNode.PropertiesAction
           
static class SceneGraphNode.RemoveAction
           
 
Field Summary
static MenuResourceBundle sharedResources
           
 
Fields inherited from class jsynoptic.plugins.java3d.tree.AbstractNode
_name
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
SceneGraphNode(Tree tree, java.lang.Object graphObject, boolean getChildren)
           
 
Method Summary
static void addActions(java.lang.String className, java.lang.Object... actions)
           
 SceneGraphObject addSceneGraphObject(SceneGraphObject obj)
          Add one scene graph object According to the target, this new object can replace the previous object or be added to a list
 boolean canAddSceneGraphObject(SceneGraphObject obj)
          This default implementation simply checks if a tree node class exists as a children of the current node This is used a default rule used to check the compatibility of the scene graph object with the current object
 boolean canPaste()
           
 SceneGraphNode cloneNode(boolean deepClone, AbstractNode parent)
          A generic tree node clone method A new tree node is created with inside a clone of the original scene graph One can override if needed
 void copy()
           
 void cut()
           
protected  java.lang.Class<?> getChildrenNodeClass(java.lang.Object sceneGraphObject)
          According to a child scene graph object, returns the class of the Node to hold it in the Tree
 java.lang.String getName()
           
protected  void getSceneGraphChildren(java.util.ArrayList<java.lang.Object> list)
          Get the list of children of this scene graph object
 void paste()
           
 void remove()
           
 void removeSceneGraphObject(SceneGraphObject obj, SceneGraphObject oldObj)
          Remove one scene graph object
 
Methods inherited from class jsynoptic.plugins.java3d.tree.AbstractNode
addResource, addResources, createNode, getAllowsChildren, getChildCount, getDescription, getGraphObject, getIcon, getOwner, getTree, refresh
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getChildAfter, getChildAt, getChildBefore, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sharedResources

public static MenuResourceBundle sharedResources
Constructor Detail

SceneGraphNode

public SceneGraphNode(Tree tree,
                      java.lang.Object graphObject,
                      boolean getChildren)
Method Detail

addActions

public static void addActions(java.lang.String className,
                              java.lang.Object... actions)

getName

public java.lang.String getName()
Overrides:
getName in class AbstractNode

getChildrenNodeClass

protected java.lang.Class<?> getChildrenNodeClass(java.lang.Object sceneGraphObject)
Description copied from class: AbstractNode
According to a child scene graph object, returns the class of the Node to hold it in the Tree

Specified by:
getChildrenNodeClass in class AbstractNode
Parameters:
sceneGraphObject - a child object of this Node scene graph object
Returns:
the class to use to create the Node
See Also:
createNode

getSceneGraphChildren

protected void getSceneGraphChildren(java.util.ArrayList<java.lang.Object> list)
Description copied from class: AbstractNode
Get the list of children of this scene graph object

Specified by:
getSceneGraphChildren in class AbstractNode
Parameters:
list - the list to fill with the scene graph children

canAddSceneGraphObject

public boolean canAddSceneGraphObject(SceneGraphObject obj)
This default implementation simply checks if a tree node class exists as a children of the current node This is used a default rule used to check the compatibility of the scene graph object with the current object

Specified by:
canAddSceneGraphObject in interface AddRemoveSceneGraphObject
Parameters:
obj - the object to add
Returns:
true if it can be added

addSceneGraphObject

public SceneGraphObject addSceneGraphObject(SceneGraphObject obj)
Description copied from interface: AddRemoveSceneGraphObject
Add one scene graph object According to the target, this new object can replace the previous object or be added to a list

Specified by:
addSceneGraphObject in interface AddRemoveSceneGraphObject
Parameters:
obj - the object to add
Returns:
the replace object or null if simply added

removeSceneGraphObject

public void removeSceneGraphObject(SceneGraphObject obj,
                                   SceneGraphObject oldObj)
Description copied from interface: AddRemoveSceneGraphObject
Remove one scene graph object

Specified by:
removeSceneGraphObject in interface AddRemoveSceneGraphObject
Parameters:
obj - the object to remove
oldObj - the optional object to be used in place of

paste

public void paste()

canPaste

public boolean canPaste()

copy

public void copy()

cut

public void cut()

remove

public void remove()

cloneNode

public SceneGraphNode cloneNode(boolean deepClone,
                                AbstractNode parent)
A generic tree node clone method A new tree node is created with inside a clone of the original scene graph One can override if needed

Parameters:
forceDuplicate - if true force duplication of nodes and sub graph nodes
parent - used to create a new tree node according to the cloned scene graph object
Returns:
a clone of the tree node with a clone of the scene graph object in