net.clackrouter.jgraph.pad
Class GPGraphUI.RootHandle

java.lang.Object
  extended by net.clackrouter.jgraph.pad.GPGraphUI.RootHandle
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
GPGraphUI

public class GPGraphUI.RootHandle
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  double _mouseToViewDelta_x
           
protected  double _mouseToViewDelta_y
           
protected  CellHandle activeHandle
          The handle that consumed the last mousePressedEvent.
protected  boolean blockPaint
           
protected  java.awt.geom.Rectangle2D cachedBounds
           
protected  GraphContext context
           
protected  CellView[] contextViews
           
protected  ConnectionSet disconnect
           
protected  boolean firstDrag
           
protected  CellHandle[] handles
           
protected  java.awt.geom.Point2D initialLocation
           
protected  boolean isContextVisible
           
protected  boolean isDragging
          Indicates whether this handle has started drag and drop.
protected  boolean isMoving
          Indicates whether this handle is currently moving cells.
protected  java.awt.geom.Point2D last
           
protected  java.awt.Graphics offgraphics
           
protected  java.awt.Image offscreen
           
protected  CellView[] portViews
           
protected  java.awt.geom.Point2D snapLast
           
protected  java.awt.geom.Point2D snapStart
           
protected  java.awt.geom.Point2D start
           
protected  CellView[] views
           
 
Constructor Summary
GPGraphUI.RootHandle(GraphContext ctx)
          Creates a root handle which contains handles for the given cells.
 
Method Summary
protected  CellView findViewForPoint(java.awt.geom.Point2D pt)
          Hook for subclassers to return a different view for a mouse click at pt.
 GraphContext getContext()
           
protected  java.awt.geom.Point2D getInitialLocation(java.lang.Object[] cells)
          Returns the initial location, which is the top left corner of the selection, ignoring all connected endpoints of edges.
protected  void initOffscreen()
           
 void mouseDragged(java.awt.event.MouseEvent event)
          Process mouse dragged event.
 void mouseMoved(java.awt.event.MouseEvent event)
          Invoked when the mouse pointer has been moved on a component (with no buttons down).
 void mousePressed(java.awt.event.MouseEvent event)
           
 void mouseReleased(java.awt.event.MouseEvent event)
           
 void overlay(java.awt.Graphics g)
           
 void paint(java.awt.Graphics g)
           
protected  void startDragging(java.awt.event.MouseEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_mouseToViewDelta_x

protected transient double _mouseToViewDelta_x

_mouseToViewDelta_y

protected transient double _mouseToViewDelta_y

offscreen

protected transient java.awt.Image offscreen

offgraphics

protected transient java.awt.Graphics offgraphics

firstDrag

protected transient boolean firstDrag

views

protected transient CellView[] views

contextViews

protected transient CellView[] contextViews

portViews

protected transient CellView[] portViews

cachedBounds

protected transient java.awt.geom.Rectangle2D cachedBounds

initialLocation

protected transient java.awt.geom.Point2D initialLocation

handles

protected transient CellHandle[] handles

start

protected transient java.awt.geom.Point2D start

last

protected transient java.awt.geom.Point2D last

snapStart

protected transient java.awt.geom.Point2D snapStart

snapLast

protected transient java.awt.geom.Point2D snapLast

isMoving

protected boolean isMoving
Indicates whether this handle is currently moving cells. Start may be non-null and isMoving false while the minimum movement has not been reached.


isDragging

protected boolean isDragging
Indicates whether this handle has started drag and drop. Note: isDragging => isMoving.


activeHandle

protected transient CellHandle activeHandle
The handle that consumed the last mousePressedEvent. Initially null.


context

protected transient GraphContext context

isContextVisible

protected boolean isContextVisible

blockPaint

protected boolean blockPaint

disconnect

protected transient ConnectionSet disconnect
Constructor Detail

GPGraphUI.RootHandle

public GPGraphUI.RootHandle(GraphContext ctx)
Creates a root handle which contains handles for the given cells. The root handle and all its childs point to the specified JGraph instance. The root handle is responsible for dragging the selection.

Method Detail

getInitialLocation

protected java.awt.geom.Point2D getInitialLocation(java.lang.Object[] cells)
Returns the initial location, which is the top left corner of the selection, ignoring all connected endpoints of edges.


getContext

public GraphContext getContext()

paint

public void paint(java.awt.Graphics g)

overlay

public void overlay(java.awt.Graphics g)

mouseMoved

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


mousePressed

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

findViewForPoint

protected CellView findViewForPoint(java.awt.geom.Point2D pt)
Hook for subclassers to return a different view for a mouse click at pt. For example, this can be used to return a leaf cell instead of a group.


startDragging

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

initOffscreen

protected void initOffscreen()

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent event)
Process mouse dragged event.


mouseReleased

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