org.jscience.architecture.traffic.tools
Interface Tool

All Superinterfaces:
Overlay
All Known Implementing Classes:
EdgeNodeTool, LaneTool, MoveTool, NodeTool, PopupMenuTool, RoadTool, ScrollTool, SelectTool, TotalEditTool, ZoomTool

public interface Tool
extends Overlay

All classes implementing this interface can serve as tool to be used in either simulator, editor or both.


Nested Class Summary
static class Tool.Mask
          Class used to pass on the modifiers.
 
Method Summary
 java.awt.Panel getPanel()
          Invoked when this tool is selected as the current tool.
 void mouseMoved(View view, java.awt.Point p, Tool.Mask mask)
          Invoked when the user moves the mouse over the View.
 void mousePressed(View view, java.awt.Point p, Tool.Mask mask)
          Invoked when the user presses a mouse button.
 void mouseReleased(View view, java.awt.Point p, Tool.Mask mask)
          Invoked when the user releases a mouse button.
 
Methods inherited from interface org.jscience.architecture.traffic.Overlay
overlayType, paint
 

Method Detail

mousePressed

void mousePressed(View view,
                  java.awt.Point p,
                  Tool.Mask mask)
Invoked when the user presses a mouse button.

Parameters:
view - The View that the event originates from.
p - The coordinates of the view the mouse cursor was at when the event was generated.
mask - The mask taken directly from the MouseEvent, wrapped in a Mask object

mouseReleased

void mouseReleased(View view,
                   java.awt.Point p,
                   Tool.Mask mask)
Invoked when the user releases a mouse button.

Parameters:
view - The View that the event originates from.
p - The coordinates of the view the mouse cursor was at when the event was generated.
mask - The mask taken directly from the MouseEvent, wrapped in a Mask object

mouseMoved

void mouseMoved(View view,
                java.awt.Point p,
                Tool.Mask mask)
Invoked when the user moves the mouse over the View.

Parameters:
view - The View that the event originates from.
p - The coordinates of the view the mouse cursor was at when the event was generated.
mask - The mask taken directly from the MouseEvent, wrapped in a Mask object

getPanel

java.awt.Panel getPanel()
Invoked when this tool is selected as the current tool. The panel will returned will be added to the end of the toolbar, allowing the current tool to add tool specific controls to the toolbar. The tool should take care of the listeners.

Returns:
DOCUMENT ME!