syn3d.builtin.xith3d
Class Xith3DSyn3DBuiltin

java.lang.Object
  extended by syn3d.base.Syn3DPlugin
      extended by syn3d.builtin.ControlledSyn3DBuiltin
          extended by syn3d.builtin.xith3d.Xith3DSyn3DBuiltin
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener

public class Xith3DSyn3DBuiltin
extends ControlledSyn3DBuiltin

This plugin provides all basic types for a Xith3D scene graph

Author:
Nicolas Brodu

Field Summary
protected static java.lang.String[] nodeTypes
           
 
Fields inherited from class syn3d.builtin.ControlledSyn3DBuiltin
handleKeyTyped, handleMouseClicked, handleMouseDragged, handleMousePressed, handleMouseWheelMoved
 
Fields inherited from class syn3d.base.Syn3DPlugin
pluginManager
 
Constructor Summary
Xith3DSyn3DBuiltin()
           
 
Method Summary
 boolean canCreate(java.lang.String node, ActiveNode parent)
          This method is used for screne graph building, and should be fast.
 ActiveNode create(java.lang.String node, ActiveNode parent)
          Node factory.
 java.lang.String[] getNodes()
          This plugin may bring its own nodes for the scene graph.
 
Methods inherited from class syn3d.builtin.ControlledSyn3DBuiltin
isHandleKeyTyped, isHandleMouseClicked, isHandleMouseDragged, isHandleMousePressed, isHandleMouseWheelMoved, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, setHandleKeyTyped, setHandleMouseClicked, setHandleMouseDragged, setHandleMousePressed, setHandleMouseWheelMoved
 
Methods inherited from class syn3d.base.Syn3DPlugin
createFromKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeTypes

protected static java.lang.String[] nodeTypes
Constructor Detail

Xith3DSyn3DBuiltin

public Xith3DSyn3DBuiltin()
Method Detail

getNodes

public java.lang.String[] getNodes()
Description copied from class: Syn3DPlugin
This plugin may bring its own nodes for the scene graph. It should return here the names for the node types it can create. Tip: It is possible to gather the types by categories, using "|" in the strings. ex: "Shapes|Sphere", "Shapes|Cube", "Branch|Switch", "Branch|Group"... In popup menus, entries in the same categories are gathered in the same sub-menu

Overrides:
getNodes in class Syn3DPlugin
Returns:
An array of node types. An empty array or null is accepted if this plugin does not bring new nodes

canCreate

public boolean canCreate(java.lang.String node,
                         ActiveNode parent)
Description copied from class: Syn3DPlugin
This method is used for screne graph building, and should be fast. It determines what nodes can be added to a given node in the scene graph. This operation may be supported only for a given underlying 3D platform (Xith3D, Java3D), so check this too. Tip : check if the parent 3D object corresponds to a 3D architecture this plugin handles.

Overrides:
canCreate in class Syn3DPlugin
Parameters:
node - A node type, previously returned by the getNodes() method
parent - The candidate node on which the systems want to know if a new node of the given type could be added as a child.
Returns:
true if a new node of this type could be added to the parent. The new node shall not be created at this point.

create

public ActiveNode create(java.lang.String node,
                         ActiveNode parent)
Description copied from class: Syn3DPlugin
Node factory. On successful return from canCreate(...), the user may select a node type handled by this plugin. This method is responsible for creating such a node, and it is also responsible for attaching the 3D object it refers to as a child to the parent node 3Dobject. Note: The 3D platform used is the same as in canCreate, of course.

Overrides:
create in class Syn3DPlugin
Parameters:
node - A node type, previously returned by the getNodes() method
parent - The existing node on which to attach the new node as a child.
Returns:
A valid ActiveNode, attached to the given parent. null is permitted if something has changed since the moment when canCreate was called and the node cannot be created now. (no thread synchronization, so it may happen).