|
NCSA Portfolio | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ncsa.j3d.ui.tools.ToolManager
ToolManager is responsible for managing tools. It holds them all and allows selection between them. See ToolManagerInterface to see how this class functions.
EXAMPLE:
Canvas3D canvas;
BranchGroup bg;
TransformGroup tg; //The transform group above the ViewPlatform.
initialize these variables
ToolManager tm = new ToolManager();
tm.setViewTransform(tg); tm.setBranchGroup(bg); tm.setCanvas(canvas); tm.initialize(); //Loads portfolio.properties and configures itself.
Please note that if the ToolManager is not configured properly with all the set methods indicated above, when some of the tools are loaded they could fail miserably.
Method Summary | |
void |
addActive(PortfolioEventReceiver i)
Adds this object into the list of active receivers. |
void |
addEventSource(java.lang.Object object)
Adds an event to the toolmanager that is not based on PortfolioEvent. |
void |
addInactive(PortfolioEventReceiver i)
Adds an object into the list of possible object to receive events. |
void |
addPortfolioEvent(PortfolioEvent event)
Adds a Portfolio event to the group of events that are reporting to this tool manager. |
javax.media.j3d.BranchGroup |
getBranchGroup()
This method allows objects to determine which BranchGroup the ToolManager is controlling. |
javax.media.j3d.Canvas3D |
getCanvas()
This method allows objects to determine which Canvas3D the ToolManager is controlling. |
java.lang.String[] |
getToolNames()
This returns a string listing of names of Tools. |
javax.media.j3d.TransformGroup |
getViewTransform()
Allows the retrieval of the view transform. |
static ToolManager |
instance()
|
void |
loadTools()
This is the function that is called to load the tools in. |
void |
makeActive(PortfolioEventReceiver i)
Makes an object that has already been added into the list of objects that can receive events active. |
void |
makeInactive(PortfolioEventReceiver i)
Makes an object inactive. |
boolean |
notify(java.util.EventObject e)
This beginning of the PortfolioEvent bus. |
void |
remove(PortfolioEventReceiver i)
Removes an object from the ToolManager. |
void |
setActiveTool(int index)
Changes the active tool. |
void |
setActiveTool(ToolInterface i)
Changes the active tool. |
void |
setBranchGroup(javax.media.j3d.BranchGroup bg)
This method allows the BranchGroup to be specified. |
void |
setCanvas(javax.media.j3d.Canvas3D c)
This method allows the Canvas to be specified. |
void |
setViewTransform(javax.media.j3d.TransformGroup t)
Allows the viewing transform to be set so that tools can access this. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public static ToolManager instance()
public void loadTools()
public void setViewTransform(javax.media.j3d.TransformGroup t)
t
- The transform above the ViewPlatform.public javax.media.j3d.TransformGroup getViewTransform()
public void setBranchGroup(javax.media.j3d.BranchGroup bg)
bg
- The new branch group.public javax.media.j3d.BranchGroup getBranchGroup()
public void setCanvas(javax.media.j3d.Canvas3D c)
c
- The new Canvaspublic javax.media.j3d.Canvas3D getCanvas()
public void addPortfolioEvent(PortfolioEvent event)
event
- The event to add.public void addEventSource(java.lang.Object object)
object
- The object that will send events to me.public void setActiveTool(ToolInterface i)
tool
- The tool to make active.public void setActiveTool(int index)
index
- The index of the tool to make active.public void addInactive(PortfolioEventReceiver i)
i
- The event receiver to add.public void addActive(PortfolioEventReceiver i)
i
- The object to be added.public void makeActive(PortfolioEventReceiver i)
i
- The object to make active.public void makeInactive(PortfolioEventReceiver i)
i
- The object to make inactive.public void remove(PortfolioEventReceiver i)
i
- The object to remove.public boolean notify(java.util.EventObject e)
e
- The object to distribute.public java.lang.String[] getToolNames()
|
NCSA Portfolio | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |