jcreek.cke.tool
Interface CreekTool

All Superinterfaces:
ConceptViewListener, java.util.EventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener
All Known Implementing Classes:
BuildTool, MoveTool, ZoomTool

public interface CreekTool
extends ConceptViewListener

Defines the interface for the tool objects in Creek. Since all tools in Creek will interact with the user (via the view) this interface extends the view listener interface.


Method Summary
 void attach(CreekModel model, ConceptView view, javax.swing.JInternalFrame win)
          Attach to the given model and view objects.
 void detach()
          Detach from the model and view and prepare to be deactivated.
 java.awt.Point getMousePosition()
          Returns the position of the mouse,this will return the first Mouse Position or last Mouse Position depending on the current Tool and the state of the tool
 VertexList getSelected()
          Returns the list of selected vertices, in the order they were selected by the user.
 
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from interface java.awt.event.MouseMotionListener
mouseDragged, mouseMoved
 

Method Detail

attach

public void attach(CreekModel model,
                   ConceptView view,
                   javax.swing.JInternalFrame win)
Attach to the given model and view objects. This begins user interaction and will imply that this tool is the currently active tool. The tool should add itself as a listener to the view object to begin interaction with the user.

Parameters:
model - GraphModel to attach to
view - GraphView to attach to

detach

public void detach()
Detach from the model and view and prepare to be deactivated. This does not imply that this object is about to be destroyed. The tool should remove itself from the view listener list and cease interaction with the user.

Note that this method may be called more than once between calls to attach()


getSelected

public VertexList getSelected()
Returns the list of selected vertices, in the order they were selected by the user. Often called by another class that is going to perform some operation on the graph, such as a search.

Returns:
selected vertex list

getMousePosition

public java.awt.Point getMousePosition()
Returns the position of the mouse,this will return the first Mouse Position or last Mouse Position depending on the current Tool and the state of the tool

Returns:
Point position of the mouse


Created at IDI, NTNU by the Artificial Intelligence and Learning group