jcreek.gui.conceptmap.tool
Class DragTool

java.lang.Object
  extended byjcreek.gui.conceptmap.tool.DragTool
All Implemented Interfaces:
ConceptMapTool, java.util.EventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener
Direct Known Subclasses:
BuildTool

public class DragTool
extends java.lang.Object
implements ConceptMapTool, java.awt.event.MouseListener, java.awt.event.MouseMotionListener


Field Summary
protected  java.awt.Point firstMousePos
          The list of the relations being moved around.
protected  java.awt.Point lastMousePos
          Most recent mouse position while dragging.
protected  java.util.HashSet movingEntities
          The set of moving entites.
protected  VisualEntity pressVertex
          Vertex the user pressed on in mousePressed().
protected  boolean wasPressed
          True if mouse was pressed on the view before being released.
protected  ConceptMapView view
          View that we're associated with.
 
Constructor Summary
DragTool()
          Creates a new DragTool object.
DragTool(ConceptMapView view)
          Creates a new DragTool and attaches it to the supplied ConceptMapView.
 
Method Summary
 void attach(ConceptMapView view)
           
protected  void continueDrag(int x, int y)
           
 void detatch()
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent me)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent me)
           
 void mouseReleased(java.awt.event.MouseEvent me)
           
 void paintTool(java.awt.Graphics g)
           
protected  void startDrag(int x, int y)
           
protected  void stopDrag()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

view

protected ConceptMapView view
View that we're associated with.


pressVertex

protected VisualEntity pressVertex
Vertex the user pressed on in mousePressed(). Could be null if the user didn't press on a entity.


wasPressed

protected boolean wasPressed
True if mouse was pressed on the view before being released. Helps avoid some mis-firings of the mouse buttons.


movingEntities

protected java.util.HashSet movingEntities
The set of moving entites.


firstMousePos

protected java.awt.Point firstMousePos
The list of the relations being moved around.


lastMousePos

protected java.awt.Point lastMousePos
Most recent mouse position while dragging.

Constructor Detail

DragTool

public DragTool()
Creates a new DragTool object.


DragTool

public DragTool(ConceptMapView view)
Creates a new DragTool and attaches it to the supplied ConceptMapView.

Parameters:
view - The ConceptMapView to attach this tool to.
Method Detail

paintTool

public void paintTool(java.awt.Graphics g)
Specified by:
paintTool in interface ConceptMapTool

attach

public void attach(ConceptMapView view)
Specified by:
attach in interface ConceptMapTool

detatch

public void detatch()
Specified by:
detatch in interface ConceptMapTool

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent me)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

startDrag

protected void startDrag(int x,
                         int y)

continueDrag

protected void continueDrag(int x,
                            int y)

stopDrag

protected void stopDrag()


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