org.ceryle.graph.tm
Class TMNavigateUI.AssociateTopicListener

java.lang.Object
  extended by javax.swing.event.MouseInputAdapter
      extended by org.ceryle.graph.tm.TMNavigateUI.AssociateTopicListener
All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener, MouseInputListener
Enclosing class:
TMNavigateUI

public class TMNavigateUI.AssociateTopicListener
extends MouseInputAdapter

MouseMotionListener extension to handle dragging a provisional node, creating a new Topic and optionally associating it with the initial mouseOverN. See the individual method descriptions for more details.


Constructor Summary
TMNavigateUI.AssociateTopicListener(TNode tnode, MouseEvent e)
           
 
Method Summary
 void disableListener()
          Disables the listener and returns the graph to normal functioning.
 void initializeDrag(MouseEvent e)
          Upon initialization, temporarily fixes the moused over TNode, then creates a phantom (marked provisional) TNode linked by an arrow-style GraphEdge.
 void mouseDragged(MouseEvent e)
          Drags the phantom TNode.
 void mouseExited(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void releaseDrag(MouseEvent e)
          Reverts the graph back to its pre-phantom state.
 
Methods inherited from class javax.swing.event.MouseInputAdapter
mouseClicked, mouseEntered, mouseMoved, mousePressed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TMNavigateUI.AssociateTopicListener

public TMNavigateUI.AssociateTopicListener(TNode tnode,
                                           MouseEvent e)
Method Detail

initializeDrag

public void initializeDrag(MouseEvent e)
Upon initialization, temporarily fixes the moused over TNode, then creates a phantom (marked provisional) TNode linked by an arrow-style GraphEdge. This continues via mouseDragged() until a mouse release.


mouseDragged

public void mouseDragged(MouseEvent e)
Drags the phantom TNode.

Specified by:
mouseDragged in interface MouseMotionListener
Overrides:
mouseDragged in class MouseInputAdapter

releaseDrag

public void releaseDrag(MouseEvent e)
Reverts the graph back to its pre-phantom state. If a MouseEvent is provided a new Topic is created at point p. If the Control key is down, a new Association will be created between the initial drag Topic and the new Topic. Furthermore, if the Shift key is down, the previous Association template (if available) will be used as the template for the new Association.


mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener
Overrides:
mouseReleased in class MouseInputAdapter

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener
Overrides:
mouseExited in class MouseInputAdapter

disableListener

public void disableListener()
Disables the listener and returns the graph to normal functioning.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.