jcreek.cke.visualizer
Class DragTool

java.lang.Object
  extended byjcreek.cke.visualizer.DragTool
All Implemented Interfaces:
ConceptViewListener, java.util.EventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class DragTool
extends java.lang.Object
implements ConceptViewListener


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  VertexList movingVertices
          The list of the entities being moved around.
protected  VisualEntity pressVertex
          Vertex the user pressed on in mousePressed().
protected  VertexList selectedList
          List of the selected entities in the order they were selected by the user.
protected  boolean wasPressed
          True if mouse was pressed on the view before being released.
protected  ConceptView view
          View that we're associated with.
 
Constructor Summary
DragTool()
          Creates a new DragTool object.
 
Method Summary
 void attach(ConceptView view)
           
 void detach()
           
protected  void finishMoving()
          If we were moving entities, clean up now.
 VertexList getSelected()
          Returns the list of selected entities, in the order they were selected by the user.
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

view

protected ConceptView 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.


selectedList

protected VertexList selectedList
List of the selected entities in the order they were selected by the user.


wasPressed

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


movingVertices

protected VertexList movingVertices
The list of the entities being moved around. These entities are a copy of the originals and can be modified.


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.

Method Detail

attach

public void attach(ConceptView view)

detach

public void detach()

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

finishMoving

protected void finishMoving()
If we were moving entities, clean up now.


getSelected

public VertexList getSelected()
Returns the list of selected entities, 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 entity list


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