Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JGraph v5.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jgraph.plaf.basic
Class BasicGraphUI.RootHandle

    java.lang.Object
      |
      +--org.jgraph.plaf.basic.BasicGraphUI.RootHandle

All Implemented Interfaces:
  CellHandle, Serializable

Enclosing class:
  BasicGraphUI

public class BasicGraphUI.RootHandle
extends Object
implements CellHandle, 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 Rectangle2D` | `cachedBounds`
`protected GraphContext` | `context`
`protected CellView[]` | `contextViews`
`protected ConnectionSet` | `disconnect`
`protected boolean` | `firstDrag`
`protected CellHandle[]` | `handles`
`protected 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 Point2D` | `last`
`protected Graphics` | `offgraphics`
`protected Image` | `offscreen`
`protected CellView[]` | `portViews`
`protected Point2D` | `snapLast`
`protected Point2D` | `snapStart`
`protected Point2D` | `start`
`protected CellView[]` | `views`

Constructor Summary
`BasicGraphUI.RootHandle(GraphContext ctx)` Creates a root handle which contains handles for the given cells.

Method Summary
`protected CellView` | `findViewForPoint(Point2D pt)` Hook for subclassers to return a different view for a mouse click at `pt`.
`GraphContext` | `getContext()`
`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` | `initOffscreen()`
`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 drag gesture is recogniced.
`void` | `mouseReleased(MouseEvent event)` Messaged when the drag operation has terminated with a drop.
`void` | `overlay(Graphics g)` Paint the handle on the given graphics object during mouse operations.
`void` | `paint(Graphics g)` Paint the handle on the given graphics object once.
`protected void` | `startDragging(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 Image offscreen

### offgraphics

    protected transient 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 Rectangle2D cachedBounds

### initialLocation

    protected transient Point2D initialLocation

### handles

    protected transient CellHandle[] handles

### start

    protected transient Point2D start

### last

    protected transient Point2D last

### snapStart

    protected transient Point2D snapStart

### snapLast

    protected transient 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

### BasicGraphUI.RootHandle

    public BasicGraphUI.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 Point2D getInitialLocation(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(Graphics g)

  Description copied from interface: `CellHandle`
  Paint the handle on the given graphics object once.

  Specified by:
    `paint` in interface `CellHandle`
  Parameters:
    `g` - the graphics object to paint the handle on

### overlay

    public void overlay(Graphics g)

  Description copied from interface: `CellHandle`
  Paint the handle on the given graphics object during mouse operations.

  Specified by:
    `overlay` in interface `CellHandle`
  Parameters:
    `g` - the graphics object to paint the handle on

### mouseMoved

    public void mouseMoved(MouseEvent event)

  Invoked when the mouse pointer has been moved on a component (with no buttons down).

  Specified by:
    `mouseMoved` in interface `CellHandle`

### mousePressed

    public void mousePressed(MouseEvent event)

  Description copied from interface: `CellHandle`
  Messaged when a drag gesture is recogniced.

  Specified by:
    `mousePressed` in interface `CellHandle`

### findViewForPoint

    protected CellView findViewForPoint(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(MouseEvent event)

### initOffscreen

    protected void initOffscreen()

### mouseDragged

    public void mouseDragged(MouseEvent event)

  Process mouse dragged event.

  Specified by:
    `mouseDragged` in interface `CellHandle`
  Parameters:
    `event` - the drag event to be processed

### mouseReleased

    public void mouseReleased(MouseEvent event)

  Description copied from interface: `CellHandle`
  Messaged when the drag operation has terminated with a drop.

  Specified by:
    `mouseReleased` in interface `CellHandle`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JGraph v5.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) 2003-2004 Gaudenz Alder. All rights reserved.