Package org.jgraph.plaf.basic
Class BasicGraphUI.RootHandle
java.lang.Object
org.jgraph.plaf.basic.BasicGraphUI.RootHandle
- All Implemented Interfaces:
Serializable
,CellHandle
- Enclosing class:
- BasicGraphUI
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
protected double
protected CellHandle
The handle that consumed the last mousePressedEvent.protected boolean
protected Rectangle2D
protected GraphContext
protected CellView[]
protected Point2D
protected ConnectionSet
protected boolean
protected CellHandle[]
protected CellView
protected Point2D
protected boolean
protected boolean
Indicates whether this handle has started drag and drop.protected boolean
Indicates whether this handle is currently moving cells.protected Point2D
protected Graphics
Reference to graph off screen graphicsprotected CellView[]
protected Point2D
protected Point2D
protected Point2D
protected CellView
protected CellView[]
-
Constructor Summary
ConstructorsConstructorDescriptionRootHandle
(GraphContext ctx) Creates a root handle which contains handles for the given cells. -
Method Summary
Modifier and TypeMethodDescriptionprotected Point2D
constrainDrag
(MouseEvent event, double totDx, double totDy, double dx, double dy) Hook method to constrain a mouse dragprotected CellView
findUnselectedInnermostGroup
(double x, double y) Used for move into group to find the target group.protected CellView
Hook for subclassers to return a different view for a mouse click atpt
.getFirstOpaqueParent
(Component component) protected Point2D
getInitialLocation
(Object[] cells) Returns the initial location, which is the top left corner of the selection, ignoring all connected endpoints of edges.protected void
void
mouseDragged
(MouseEvent event) Process mouse dragged event.void
mouseMoved
(MouseEvent event) Invoked when the mouse pointer has been moved on a component (with no buttons down).void
mousePressed
(MouseEvent event) Messaged when a mouse button is pressed.void
mouseReleased
(MouseEvent event) Messaged when the drag operation has terminated with a drop.void
Paint the handle on the given graphics object during mouse operations.void
Paint the handle on the given graphics object once.protected void
startDragging
(MouseEvent event)
-
Field Details
-
_mouseToViewDelta_x
protected transient double _mouseToViewDelta_x -
_mouseToViewDelta_y
protected transient double _mouseToViewDelta_y -
firstDrag
protected transient boolean firstDrag -
views
-
contextViews
-
portViews
-
targetGroup
-
ignoreTargetGroup
-
cachedBounds
-
initialLocation
-
handles
-
start
-
last
-
snapStart
-
snapLast
-
offgraphics
Reference to graph off screen graphics -
isMoving
protected boolean isMovingIndicates 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 isDraggingIndicates whether this handle has started drag and drop. Note: isDragging => isMoving. -
activeHandle
The handle that consumed the last mousePressedEvent. Initially null. -
context
-
isContextVisible
protected boolean isContextVisible -
blockPaint
protected boolean blockPaint -
current
-
disconnect
-
-
Constructor Details
-
RootHandle
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 Details
-
getInitialLocation
Returns the initial location, which is the top left corner of the selection, ignoring all connected endpoints of edges. -
getContext
-
paint
Description copied from interface:CellHandle
Paint the handle on the given graphics object once.- Specified by:
paint
in interfaceCellHandle
- Parameters:
g
- the graphics object to paint the handle on
-
overlay
Description copied from interface:CellHandle
Paint the handle on the given graphics object during mouse operations.- Specified by:
overlay
in interfaceCellHandle
- Parameters:
g
- the graphics object to paint the handle on
-
mouseMoved
Invoked when the mouse pointer has been moved on a component (with no buttons down).- Specified by:
mouseMoved
in interfaceCellHandle
- Parameters:
event
- the mouse event to be processed
-
mousePressed
Description copied from interface:CellHandle
Messaged when a mouse button is pressed.- Specified by:
mousePressed
in interfaceCellHandle
- Parameters:
event
- the mouse event to be processed
-
findViewForPoint
Hook for subclassers to return a different view for a mouse click atpt
. For example, this can be used to return a leaf cell instead of a group. -
findUnselectedInnermostGroup
Used for move into group to find the target group. -
startDragging
-
getFirstOpaqueParent
- Returns:
- Returns the parent graph scrollpane for the specified graph.
-
initOffscreen
protected void initOffscreen() -
mouseDragged
Process mouse dragged event.- Specified by:
mouseDragged
in interfaceCellHandle
- Parameters:
event
- the drag event to be processed
-
constrainDrag
Hook method to constrain a mouse drag- Parameters:
event
-totDx
-totDy
-dx
-dy
-- Returns:
- a point describing any position constraining applied
-
mouseReleased
Description copied from interface:CellHandle
Messaged when the drag operation has terminated with a drop.- Specified by:
mouseReleased
in interfaceCellHandle
- Parameters:
event
- the drop event to be processed
-