public class BasicGraphUI.RootHandle extends java.lang.Object implements CellHandle, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
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 java.awt.geom.Point2D |
current |
protected ConnectionSet |
disconnect |
protected boolean |
firstDrag |
protected CellHandle[] |
handles |
protected CellView |
ignoreTargetGroup |
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
Reference to graph off screen graphics
|
protected CellView[] |
portViews |
protected java.awt.geom.Point2D |
snapLast |
protected java.awt.geom.Point2D |
snapStart |
protected java.awt.geom.Point2D |
start |
protected CellView |
targetGroup |
protected CellView[] |
views |
Constructor and Description |
---|
RootHandle(GraphContext ctx)
Creates a root handle which contains handles for the given cells.
|
Modifier and Type | Method and Description |
---|---|
protected java.awt.geom.Point2D |
constrainDrag(java.awt.event.MouseEvent event,
double totDx,
double totDy,
double dx,
double dy)
Hook method to constrain a mouse drag
|
protected CellView |
findUnselectedInnermostGroup(double x,
double y)
Used for move into group to find the target group.
|
protected CellView |
findViewForPoint(java.awt.geom.Point2D pt)
Hook for subclassers to return a different view for a mouse click at
pt . |
GraphContext |
getContext() |
java.awt.Component |
getFirstOpaqueParent(java.awt.Component component) |
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)
Messaged when a mouse button is pressed.
|
void |
mouseReleased(java.awt.event.MouseEvent event)
Messaged when the drag operation has
terminated with a drop.
|
void |
overlay(java.awt.Graphics g)
Paint the handle on the given graphics object during mouse
operations.
|
void |
paint(java.awt.Graphics g)
Paint the handle on the given graphics object once.
|
protected void |
startDragging(java.awt.event.MouseEvent event) |
protected transient double _mouseToViewDelta_x
protected transient double _mouseToViewDelta_y
protected transient boolean firstDrag
protected transient CellView[] views
protected transient CellView[] contextViews
protected transient CellView[] portViews
protected transient CellView targetGroup
protected transient CellView ignoreTargetGroup
protected transient java.awt.geom.Rectangle2D cachedBounds
protected transient java.awt.geom.Point2D initialLocation
protected transient CellHandle[] handles
protected transient java.awt.geom.Point2D start
protected transient java.awt.geom.Point2D last
protected transient java.awt.geom.Point2D snapStart
protected transient java.awt.geom.Point2D snapLast
protected transient java.awt.Graphics offgraphics
protected boolean isMoving
protected boolean isDragging
protected transient CellHandle activeHandle
protected transient GraphContext context
protected boolean isContextVisible
protected boolean blockPaint
protected java.awt.geom.Point2D current
protected transient ConnectionSet disconnect
public RootHandle(GraphContext ctx)
protected java.awt.geom.Point2D getInitialLocation(java.lang.Object[] cells)
public GraphContext getContext()
public void paint(java.awt.Graphics g)
CellHandle
paint
in interface CellHandle
g
- the graphics object to paint the handle onpublic void overlay(java.awt.Graphics g)
CellHandle
overlay
in interface CellHandle
g
- the graphics object to paint the handle onpublic void mouseMoved(java.awt.event.MouseEvent event)
mouseMoved
in interface CellHandle
event
- the mouse event to be processedpublic void mousePressed(java.awt.event.MouseEvent event)
CellHandle
mousePressed
in interface CellHandle
event
- the mouse event to be processedprotected CellView findViewForPoint(java.awt.geom.Point2D pt)
pt
. For example, this can be used to return a leaf
cell instead of a group.protected CellView findUnselectedInnermostGroup(double x, double y)
protected void startDragging(java.awt.event.MouseEvent event)
public java.awt.Component getFirstOpaqueParent(java.awt.Component component)
protected void initOffscreen()
public void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged
in interface CellHandle
event
- the drag event to be processedprotected java.awt.geom.Point2D constrainDrag(java.awt.event.MouseEvent event, double totDx, double totDy, double dx, double dy)
event
- totDx
- totDy
- dx
- dy
- public void mouseReleased(java.awt.event.MouseEvent event)
CellHandle
mouseReleased
in interface CellHandle
event
- the drop event to be processedCopyright (C) 2001-2009 JGraph Ltd. All rights reserved.