net.clackrouter.jgraph.pad
Class GPGraphUI.MouseHandler

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by net.clackrouter.jgraph.pad.GPGraphUI.MouseHandler
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, java.util.EventListener
Enclosing class:
GPGraphUI

public class GPGraphUI.MouseHandler
extends java.awt.event.MouseAdapter
implements java.awt.event.MouseMotionListener, java.io.Serializable

TreeMouseListener is responsible for updating the selection based on mouse events.

See Also:
Serialized Form

Field Summary
protected  CellView cell
           
protected  java.lang.Object handler
           
protected  java.awt.Cursor previousCursor
           
 
Constructor Summary
GPGraphUI.MouseHandler()
           
 
Method Summary
protected  void handleEditTrigger(java.lang.Object cell, java.awt.event.MouseEvent e)
           
protected  boolean isDescendant(CellView parentView, CellView childView)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
          Invoked when the mouse pointer has been moved on a component (with no buttons down).
 void mousePressed(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been pressed on a component.
 void mouseReleased(java.awt.event.MouseEvent e)
           
protected  void postProcessSelection(java.awt.event.MouseEvent e, java.lang.Object cell, boolean wasSelected)
          Invoked after a cell has been selected in the mouseReleased method.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseEntered, mouseExited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cell

protected CellView cell

handler

protected java.lang.Object handler

previousCursor

protected transient java.awt.Cursor previousCursor
Constructor Detail

GPGraphUI.MouseHandler

public GPGraphUI.MouseHandler()
Method Detail

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class java.awt.event.MouseAdapter

mouseClicked

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

handleEditTrigger

protected void handleEditTrigger(java.lang.Object cell,
                                 java.awt.event.MouseEvent e)

mouseDragged

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

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse pointer has been moved on a component (with no buttons down).

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class java.awt.event.MouseAdapter

postProcessSelection

protected void postProcessSelection(java.awt.event.MouseEvent e,
                                    java.lang.Object cell,
                                    boolean wasSelected)
Invoked after a cell has been selected in the mouseReleased method. This can be used to do something interesting if the cell was already selected, in which case this implementation selects the parent. Override if you want different behaviour, such as start editing.


isDescendant

protected boolean isDescendant(CellView parentView,
                               CellView childView)