net.clackrouter.gui
Class ClackMarqueeHandler

java.lang.Object
  extended by BasicMarqueeHandler
      extended by net.clackrouter.gui.ClackMarqueeHandler

public class ClackMarqueeHandler
extends BasicMarqueeHandler

ClackMarqueeHandler deals with user events for the RouterGraph.

The main role of this class is to handle mouse actions on the Router graph, keeping track of dragging and clicking behavior to implement different functionality

This class is modifed from GPMarqueeHandler from JGraphpad


Field Summary
protected  java.awt.geom.Rectangle2D bounds
           
static int CELL_EDGE_DEFAULT
           
static int CELL_PORT_DEFAULT
           
static int CELL_VERTEX_DEFAULT
           
static int CELL_VERTEX_ELLIPSE
           
static int CELL_VERTEX_IMAGE
           
static int CELL_VERTEX_TEXT
           
protected  java.awt.geom.Point2D current
           
protected  javax.swing.JComboBox currentComponentType
           
protected  java.awt.Color defaultBorderColor
          The default color for borders
protected  PortView firstPort
           
protected  ClackFramework graphpad
          A reference to the graphpad object
protected  PortView lastPort
           
protected  PortView port
           
protected  java.awt.geom.Point2D start
           
 
Constructor Summary
ClackMarqueeHandler(ClackFramework graphpad)
          Constructor for GPMarqueeHandler.
 
Method Summary
 java.awt.Point getLastClick()
          X-Y location of the last mouse click
 PortView getPortViewAt(int x, int y, boolean jump)
           
protected  boolean isClackPopupTrigger(java.awt.event.MouseEvent e)
          implements new definition of a right-click
 boolean isForceMarqueeEvent(java.awt.event.MouseEvent e)
          Return true if this handler should be preferred over other handlers.
 void mouseDragged(java.awt.event.MouseEvent event)
           
 void mouseMoved(java.awt.event.MouseEvent event)
           
 void mousePressed(java.awt.event.MouseEvent event)
          Handles mousePressed event.
 void mouseReleased(java.awt.event.MouseEvent event)
           
protected  void mouseReleasedPopup(java.awt.event.MouseEvent event)
           
 void overlay(java.awt.Graphics g)
           
protected  void paintPort(java.awt.Graphics g)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CELL_VERTEX_ELLIPSE

public static final int CELL_VERTEX_ELLIPSE
See Also:
Constant Field Values

CELL_VERTEX_DEFAULT

public static final int CELL_VERTEX_DEFAULT
See Also:
Constant Field Values

CELL_VERTEX_IMAGE

public static final int CELL_VERTEX_IMAGE
See Also:
Constant Field Values

CELL_VERTEX_TEXT

public static final int CELL_VERTEX_TEXT
See Also:
Constant Field Values

CELL_PORT_DEFAULT

public static final int CELL_PORT_DEFAULT
See Also:
Constant Field Values

CELL_EDGE_DEFAULT

public static final int CELL_EDGE_DEFAULT
See Also:
Constant Field Values

graphpad

protected ClackFramework graphpad
A reference to the graphpad object


defaultBorderColor

protected java.awt.Color defaultBorderColor
The default color for borders


start

protected java.awt.geom.Point2D start

current

protected java.awt.geom.Point2D current

bounds

protected java.awt.geom.Rectangle2D bounds

currentComponentType

protected javax.swing.JComboBox currentComponentType

port

protected PortView port

firstPort

protected PortView firstPort

lastPort

protected PortView lastPort
Constructor Detail

ClackMarqueeHandler

public ClackMarqueeHandler(ClackFramework graphpad)
Constructor for GPMarqueeHandler.

Method Detail

getLastClick

public java.awt.Point getLastClick()
X-Y location of the last mouse click


isForceMarqueeEvent

public boolean isForceMarqueeEvent(java.awt.event.MouseEvent e)
Return true if this handler should be preferred over other handlers.


isClackPopupTrigger

protected boolean isClackPopupTrigger(java.awt.event.MouseEvent e)
implements new definition of a right-click


mousePressed

public void mousePressed(java.awt.event.MouseEvent event)
Handles mousePressed event.

We check to see if it is a pop-up trigger, in which case we keep note of the component that has been right-clicked

We also pass non-popup events to the super-class and take care of updating the graph's selected cell


mouseDragged

public void mouseDragged(java.awt.event.MouseEvent event)

getPortViewAt

public PortView getPortViewAt(int x,
                              int y,
                              boolean jump)

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent event)

mouseReleasedPopup

protected void mouseReleasedPopup(java.awt.event.MouseEvent event)

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent event)

overlay

public void overlay(java.awt.Graphics g)

paintPort

protected void paintPort(java.awt.Graphics g)