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.graph
Class VertexView

    java.lang.Object
      |
      +--org.jgraph.graph.AbstractCellView
            |
            +--org.jgraph.graph.VertexView

All Implemented Interfaces:
  CellView, Serializable

public class VertexView
extends AbstractCellView

The default implementation of a vertex view.

See Also:
  Serialized Form

Nested Class Summary
`static class` | `VertexView.SizeHandle`

Field Summary
`protected Rectangle2D` | `bounds` Reference to the bounds attribute
`static int[]` | `defaultCursors` Array that holds the cursors for the different control points.
`protected Rectangle2D` | `groupBounds` Cached bounds of all children if vertex is a group
`static VertexRenderer` | `renderer` Renderer for the class.
`static int[]` | `xCursors` Array that holds the cursors for the different control points.
`static int[]` | `yCursors` Array that holds the cursors for the different control points.

Fields inherited from class org.jgraph.graph.AbstractCellView
`allAttributes, attributes, cell, cellEditor, childViews, graph, mapper, parent`

Constructor Summary
`VertexView(Object cell, JGraph graph, CellMapper mapper)` Constructs a vertex view for the specified model object and the specified child views.

Method Summary
`void` | `childUpdated()`
`Rectangle2D` | `getBounds()` Returns the cached bounds for the vertex.
`Rectangle2D` | `getCachedBounds()`
`Point2D` | `getCenterPoint()` Returns the center of this vertex.
`CellHandle` | `getHandle(GraphContext context)` Returns a cell handle for the view, if the graph and the view are sizeable.
`Point2D` | `getPerimeterPoint(Point2D source, Point2D p)` Returns the intersection of the bounding rectangle and the straight line between the source and the specified point p.
`CellViewRenderer` | `getRenderer()` Returns a renderer for the class.
`void` | `setCachedBounds(Rectangle2D bounds)`
`void` | `update()` Overrides the parent method to udpate the cached points.
`protected void` | `updateGroupBounds()`

Methods inherited from class org.jgraph.graph.AbstractCellView
`getAllAttributes, getAttributes, getBounds, getCell, getChildViews, getDescendantViews, getEditor, getGraph, getMapper, getModel, getParentView, getRendererComponent, intersects, isLeaf, refresh, removeFromParent, scale, setAttributes, setBounds, translate, updateAllAttributes`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### renderer

    public static VertexRenderer renderer

  Renderer for the class.

### bounds

    protected Rectangle2D bounds

  Reference to the bounds attribute

### groupBounds

    protected Rectangle2D groupBounds

  Cached bounds of all children if vertex is a group

### defaultCursors

    public static transient int[] defaultCursors

  Array that holds the cursors for the different control points.

### xCursors

    public static transient int[] xCursors

  Array that holds the cursors for the different control points.

### yCursors

    public static transient int[] yCursors

  Array that holds the cursors for the different control points.

Constructor Detail

### VertexView

    public VertexView(Object cell,
                      JGraph graph,
                      CellMapper mapper)

  Constructs a vertex view for the specified model object and the specified child views.

Parameters:
  `cell` - reference to the model object

Method Detail

### update

    public void update()

  Overrides the parent method to udpate the cached points.

  Specified by:
    `update` in interface `CellView`
  Overrides:
    `update` in class `AbstractCellView`

### childUpdated

    public void childUpdated()

  Specified by:
    `childUpdated` in interface `CellView`
  Overrides:
    `childUpdated` in class `AbstractCellView`

### getBounds

    public Rectangle2D getBounds()

  Returns the cached bounds for the vertex.

  Specified by:
    `getBounds` in interface `CellView`
  Specified by:
    `getBounds` in class `AbstractCellView`

### getCachedBounds

    public Rectangle2D getCachedBounds()

### setCachedBounds

    public void setCachedBounds(Rectangle2D bounds)

### updateGroupBounds

    protected void updateGroupBounds()

### getRenderer

    public CellViewRenderer getRenderer()

  Returns a renderer for the class.

  Specified by:
    `getRenderer` in class `AbstractCellView`

### getHandle

    public CellHandle getHandle(GraphContext context)

  Returns a cell handle for the view, if the graph and the view are sizeable.

  Specified by:
    `getHandle` in interface `CellView`
  Specified by:
    `getHandle` in class `AbstractCellView`

### getCenterPoint

    public Point2D getCenterPoint()

  Returns the center of this vertex.

### getPerimeterPoint

    public Point2D getPerimeterPoint(Point2D source,
                                     Point2D p)

  Returns the intersection of the bounding rectangle and the straight line between the source and the specified point p. The specified point is expected not to intersect the bounds. Note: You must override this method if you use a different renderer. This is because this method relies on the VertexRenderer interface, which can not be safely assumed for subclassers.

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.