NCSA Portfolio

ncsa.j3d.ui.tools
Class Tool

java.lang.Object
  |
  +--ncsa.j3d.ui.tools.Tool

public abstract class Tool
extends java.lang.Object
implements ToolInterface

This abstract class provides a template for tool construction. It provides basic operations to process events.


Constructor Summary
Tool()
           
Tool(javax.media.j3d.Canvas3D c, javax.media.j3d.BranchGroup g)
           
 
Method Summary
 java.lang.String describe()
          The name of the tool.
 java.lang.String describeFunctionality()
          Returns a detailed message describing the functionality of the tool and how to use the tool.
static boolean left(java.awt.event.MouseEvent event)
          This function determines if the event deals with the left mouse button.
static boolean middle(java.awt.event.MouseEvent event)
          This function determines if the event deals with the middle mouse button.
 boolean notify(java.util.EventObject event)
          Allows an external object to send an event to this tool, typically this will be the ToolManager.
static boolean right(java.awt.event.MouseEvent event)
          This function determines if the event deals with the right mouse button.
 void setBranchGroup(javax.media.j3d.BranchGroup bg)
          Allows the branchgroup to be set.
 void setCanvas(javax.media.j3d.Canvas3D canvas)
          Allows the canvas to be set.
 void setToolManager(ToolManagerInterface manager)
          Allows an object to specify which toolmanager that this tool should use.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tool

public Tool()

Tool

public Tool(javax.media.j3d.Canvas3D c,
            javax.media.j3d.BranchGroup g)
Method Detail

setCanvas

public void setCanvas(javax.media.j3d.Canvas3D canvas)
Allows the canvas to be set.
Parameters:
canvas - The canvas to use for computations.

setBranchGroup

public void setBranchGroup(javax.media.j3d.BranchGroup bg)
Allows the branchgroup to be set.
Parameters:
bg - The new branch group to use for computations.

notify

public boolean notify(java.util.EventObject event)
Allows an external object to send an event to this tool, typically this will be the ToolManager.
Parameters:
event - The event to process.

setToolManager

public void setToolManager(ToolManagerInterface manager)
Allows an object to specify which toolmanager that this tool should use.
Specified by:
setToolManager in interface ToolInterface
Parameters:
manager - The manager to report to.

describe

public java.lang.String describe()
The name of the tool.
Specified by:
describe in interface ToolInterface
Returns:
The name of the tool.

describeFunctionality

public java.lang.String describeFunctionality()
Returns a detailed message describing the functionality of the tool and how to use the tool.
Specified by:
describeFunctionality in interface ToolInterface
Returns:
A detailed explaination of the tool.

left

public static boolean left(java.awt.event.MouseEvent event)
This function determines if the event deals with the left mouse button.
Parameters:
event - The MouseEvent to check.
Returns:
Whether the event deals with the left mouse button.

middle

public static boolean middle(java.awt.event.MouseEvent event)
This function determines if the event deals with the middle mouse button.
Parameters:
event - The MouseEvent to check.
Returns:
Whether the event deals with the middle mouse button.

right

public static boolean right(java.awt.event.MouseEvent event)
This function determines if the event deals with the right mouse button.
Parameters:
event - The MouseEvent to check.
Returns:
Whether the event deals with the right mouse button.

NCSA Portfolio

NCSA Portfolio, Copyright 1997-1999, National Center for Supercomputing Applications, University of Illinois Urbana-Champaign, All Rights Reserved