syn3d.nodes
Class ViewNode
java.lang.Object
syn3d.base.ActiveNode
syn3d.nodes.ViewNode
- All Implemented Interfaces:
- java.io.Serializable
public class ViewNode
- extends ActiveNode
- implements java.io.Serializable
- See Also:
- Serialized Form
Method Summary |
void |
doAction(java.lang.Object action)
When the user has selected an action in the list return by getActions(), this method is called. |
java.util.List |
getActions()
Returns a list of possible actions on this node. |
javax.swing.Icon |
getIcon()
Utility method to specialize the swing tree renderer. |
void |
restoreReferences(ActiveNode parent)
Restore a serialized object to the scene graph. |
boolean |
saveChildren()
The scene/swing tree is serialized from root to leaf, hierachically. |
Methods inherited from class syn3d.base.ActiveNode |
addChild, findDescendantOfType, findDescendantOfType, get3DObject, getChildren, getName, getParent, highlight, notifyInternalChange, notifyStructuralChange, propagateAddChildEvent, propagateChangeNameEvent, propagateHighlightEvent, propagateInternalChangeEvent, propagateRemoveChildEvent, propagateStructuralChangeEvent, remove, removeChild, removeNodeTree, removeNodeTreeFrom, setName, setParent, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
anonymousViewNumber
protected static int anonymousViewNumber
actions
protected static java.util.List actions
icon
protected static javax.swing.Icon icon
ViewNode
public ViewNode(ActiveNode parent)
getActions
public java.util.List getActions()
- Description copied from class:
ActiveNode
- Returns a list of possible actions on this node. Actions may be classified
by categories using the "|" separator.
Ex: a transform node may have the following actions: "Rotate|90° on X", "Rotate|180° on X", etc...
- Overrides:
getActions
in class ActiveNode
- Returns:
- an array of possible actions, or a null or empty array if this node doesn't handle any action
doAction
public void doAction(java.lang.Object action)
- Description copied from class:
ActiveNode
- When the user has selected an action in the list return by getActions(), this method is called.
The node should then do what it claims.
- Overrides:
doAction
in class ActiveNode
- Parameters:
action
- An action previously declared by the getActions method.
getIcon
public javax.swing.Icon getIcon()
- Description copied from class:
ActiveNode
- Utility method to specialize the swing tree renderer. Give a look to your node,
don't let it anonymous!
- Overrides:
getIcon
in class ActiveNode
- Returns:
- an Icon to display in the swing tree. May be shared along a node type class,
or may even change according the the state of this node.
restoreReferences
public void restoreReferences(ActiveNode parent)
- Description copied from class:
ActiveNode
- Restore a serialized object to the scene graph.
The scene is restored from root to leaf, hierachically.
A node can count on its parent beeing successfully deserialized, and its precisely
the added value of this method to indicate to this object the parent it should attach to.
This node is responsible for re-creating its children if it returned true in the save operation.
See description of the saveChildren method.
This method is called after this node was successfully de-serialized, to give it an occasion
to restore anything it may have to with its parent (listeners, etc...). As with the plugin
interface methode create, this method should ensure that the 3D object this nodes refers to
is added to its parent children list in the underlying 3D model (Java3D, Xith3D).
Default behavior is to set this node's parent field to the given value, but an implementor
SHALL do what's necessary for the underlying 3D scene graph.
- Overrides:
restoreReferences
in class ActiveNode
- Parameters:
parent
- The active node to attach this one to once it has been successfully de-serialized
saveChildren
public boolean saveChildren()
- Description copied from class:
ActiveNode
- The scene/swing tree is serialized from root to leaf, hierachically.
A node can count on its parent beeing successfully serialized, and should not
try to save its parent. On the other hand, if it is able to re-create the children
upon reload it should return true and this branch is considered done. This is
especially useful for nodes loaded from external scene object files.
This method is called after the object was successfully serialized, to determine
wheter or not continue in this tree branch.
- Overrides:
saveChildren
in class ActiveNode
- Returns:
- true if this object handles its children, false if it does not. Default is false