syn3d.base
Class PluginManager

java.lang.Object
  extended by syn3d.base.PluginManager
Direct Known Subclasses:
Java3DPluginManager, Xith3DPluginManager

public class PluginManager
extends java.lang.Object

This is a central repository for Syn3D plugins

Author:
nicolas brodu

Field Summary
 java.util.Vector nodeFactories
          Vector of NodeFactory objects, constructed from the plugins capacities This Vector is guaranteed to be alphabetically sorted
 java.util.Vector plugins
          Vector of Syn3DPlugin objects, correspongin to all plugins already registerd
 
Constructor Summary
PluginManager()
           
 
Method Summary
 javax.swing.JPopupMenu getChildMenu(ActiveNode parent, java.awt.event.ActionListener listener)
          Utility wrapper around getNodeFactoriesFor method to create a ready to use popup menu.
 java.util.Vector getNodeFactoriesFor(ActiveNode parent)
          Return a Vector of NodeFactory objects capable of creating a child for the parent, in alphabetical order.
 Syn3DPlugin getPlugin(java.lang.Class c)
           
 void register(java.lang.String className)
           
 void showProperties(ActiveNode parent, java.awt.event.ActionListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plugins

public java.util.Vector plugins
Vector of Syn3DPlugin objects, correspongin to all plugins already registerd


nodeFactories

public java.util.Vector nodeFactories
Vector of NodeFactory objects, constructed from the plugins capacities This Vector is guaranteed to be alphabetically sorted

Constructor Detail

PluginManager

public PluginManager()
Method Detail

register

public void register(java.lang.String className)

getPlugin

public Syn3DPlugin getPlugin(java.lang.Class c)

getNodeFactoriesFor

public java.util.Vector getNodeFactoriesFor(ActiveNode parent)
Return a Vector of NodeFactory objects capable of creating a child for the parent, in alphabetical order.

Parameters:
parent - The ActiveNode for which a new child is desired
Returns:
a Vector, possibly empty, of NodeFactory objects capable of creating a child for the parent.

getChildMenu

public javax.swing.JPopupMenu getChildMenu(ActiveNode parent,
                                           java.awt.event.ActionListener listener)
Utility wrapper around getNodeFactoriesFor method to create a ready to use popup menu. If the user selects an entry in the popup menu, the corresponding child will be created in the parent, and the given listener will be notified.

Parameters:
parent - The parent node for for which a new child is desired
listener - An optional listener (possibly null) which will be notified if a child was created. The corresponding ActionEvent source is the new child, id = 1, and cmd = "childCreated". Use (ActiveNode(child)).getParent() on to get the parent back, if needed.
Returns:
A ready to use popup menu, or null if no child can be created for this parent. The menu is ready to be shown, but the caller may add more entries if necessary.

showProperties

public void showProperties(ActiveNode parent,
                           java.awt.event.ActionListener listener)