syn3d.nodes.java3d
Class ShapeNodeJava3D

java.lang.Object
  extended by syn3d.base.ActiveNode
      extended by syn3d.nodes.ShapeNode
          extended by syn3d.nodes.java3d.ShapeNodeJava3D
All Implemented Interfaces:
java.io.Serializable, EndNotificationListener
Direct Known Subclasses:
CubeNodeJava3D, SphereNodeJava3D

public class ShapeNodeJava3D
extends ShapeNode
implements java.io.Serializable

Base class for Java3D shapes. Make cube and sphere from this, useful for plugins too

See Also:
Serialized Form

Nested Class Summary
protected  class ShapeNodeJava3D.J3DPropertiesPanel
           
 
Nested classes/interfaces inherited from class syn3d.nodes.ShapeNode
ShapeNode.PropertiesPanel
 
Field Summary
protected  float polygonOffset
           
protected  float polygonOffsetFactor
           
protected  Shape3D shape
           
 
Fields inherited from class syn3d.nodes.ShapeNode
actions, baseColor, baseColorMapper, baseColorMapperSource, FILLED_MODE, FLAT_MODE, highlightColor, highlightColorMapper, highlightColorMapperSource, highlighted, icon, mode, SHADING_MODE, WIREFRAME_MODE
 
Fields inherited from class syn3d.base.ActiveNode
children, name, parent
 
Constructor Summary
ShapeNodeJava3D(ActiveNode parent)
           
ShapeNodeJava3D(ActiveNode parent, Shape3D shape3d)
           
 
Method Summary
protected  ShapeNode.PropertiesPanel createPanel(boolean showName)
          Factory for subclasses
protected  Shape3D createShape()
          Subclasses API when using the constructor without a shape specified
 java.lang.Object get3DObject()
          Returns the 3D object that this node refers to.
 float getPolygonOffset()
           
 float getPolygonOffsetFactor()
           
 void highlight(boolean on, java.lang.Object parameter)
          Highlights this node some way.
 void notifyInternalChange()
          Notify the system that this node has changed and the scene needs to be re-built
 void remove()
          Removes this node from the parent list.
 void restoreReferences(ActiveNode parent)
          Restore a serialized object to the scene graph.
protected  void setAppearanceForHighlight(boolean on)
           
 void setPolygonOffset(float polygonOffset)
           
 void setPolygonOffsetFactor(float polygonOffsetFactor)
           
protected  PolygonAttributes unlockPolygonAttributes(PolygonAttributes pa)
           
 
Methods inherited from class syn3d.nodes.ShapeNode
configure, configure, doAction, duplicateProperties, getActions, getBaseColor, getHighlightColor, getIcon, getMode, notificationEnd, saveChildren, setBaseColor, setHighlightColor, setMode
 
Methods inherited from class syn3d.base.ActiveNode
addChild, findDescendantOfType, findDescendantOfType, getChildren, getName, getParent, notifyStructuralChange, propagateAddChildEvent, propagateChangeNameEvent, propagateHighlightEvent, propagateInternalChangeEvent, propagateRemoveChildEvent, propagateStructuralChangeEvent, removeChild, removeNodeTree, removeNodeTreeFrom, setName, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

shape

protected transient Shape3D shape

polygonOffset

protected float polygonOffset

polygonOffsetFactor

protected float polygonOffsetFactor
Constructor Detail

ShapeNodeJava3D

public ShapeNodeJava3D(ActiveNode parent)

ShapeNodeJava3D

public ShapeNodeJava3D(ActiveNode parent,
                       Shape3D shape3d)
Method Detail

createShape

protected Shape3D createShape()
Subclasses API when using the constructor without a shape specified

Returns:
a newly created Shape3D.

remove

public void remove()
Description copied from class: ActiveNode
Removes this node from the parent list. Notifies the parents for structural change.

Overrides:
remove in class ActiveNode

get3DObject

public java.lang.Object get3DObject()
Description copied from class: ActiveNode
Returns the 3D object that this node refers to. The object may depend on the 3D model used (Xith3D, Java3D) This object was previously created in the plugin create method, or in the loadTo method during de-serialization.

Overrides:
get3DObject in class ActiveNode
Returns:
the Object used for the scene graph, which probably depends on the underlying 3D architecture. This can be used on a parent node in the plugin canCreate method to check for this architecture.

setAppearanceForHighlight

protected void setAppearanceForHighlight(boolean on)

unlockPolygonAttributes

protected PolygonAttributes unlockPolygonAttributes(PolygonAttributes pa)

highlight

public void highlight(boolean on,
                      java.lang.Object parameter)
Description copied from class: ActiveNode
Highlights this node some way. It's up to the underlying 3D model to decide what it means. This is an optional operation. Highlighting may occur when the user selects a node in the tree, for example, or when picking an object on a scene view. Note for subclasses : please call the super implementation for event propagation.

Overrides:
highlight in class ShapeNode
Parameters:
on - true indicates to highlight this node, false to revert it back to normal
parameter - A parameter set from the 3D underlying model in case of a picking operation, or the node's 3D object in case of a user selection in the Scene Tree

createPanel

protected ShapeNode.PropertiesPanel createPanel(boolean showName)
Description copied from class: ShapeNode
Factory for subclasses

Overrides:
createPanel in class ShapeNode

notifyInternalChange

public void notifyInternalChange()
Description copied from class: ActiveNode
Notify the system that this node has changed and the scene needs to be re-built

Overrides:
notifyInternalChange in class ActiveNode

getPolygonOffset

public float getPolygonOffset()
Returns:
Returns the polygonOffset.

setPolygonOffset

public void setPolygonOffset(float polygonOffset)
Parameters:
polygonOffset - The polygonOffset to set.

getPolygonOffsetFactor

public float getPolygonOffsetFactor()
Returns:
Returns the polygonOffsetFactor.

setPolygonOffsetFactor

public void setPolygonOffsetFactor(float polygonOffsetFactor)
Parameters:
polygonOffsetFactor - The polygonOffsetFactor to set.

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 ShapeNode
Parameters:
parent - The active node to attach this one to once it has been successfully de-serialized