org.jgraph.graph

Class VertexView

public class VertexView extends AbstractCellView

The default implementation of a vertex view.
Nested Class Summary
static classVertexView.SizeHandle
Field Summary
protected Rectangle2Dbounds
Reference to the bounds attribute
static Rectangle2DdefaultBounds
static int[]defaultCursors
Array that holds the cursors for the different control points.
static VertexRendererrenderer
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.
Constructor Summary
VertexView()
Constructs an empty vertex view.
VertexView(Object cell)
Constructs a vertex view for the specified model object and the specified child views.
Method Summary
Rectangle2DgetBounds()
Returns the cached bounds for the vertex.
Rectangle2DgetCachedBounds()
Point2DgetCenterPoint()
CellHandlegetHandle(GraphContext context)
Returns a cell handle for the view, if the graph and the view are sizeable.
Point2DgetPerimeterPoint(Point2D source, Point2D p)
Point2DgetPerimeterPoint(EdgeView edge, Point2D source, Point2D p)
Returns the intersection of the bounding rectangle and the straight line between the source and the specified point p.
CellViewRenderergetRenderer()
Returns a renderer for the class.
voidsetCachedBounds(Rectangle2D bounds)
voidupdate(GraphLayoutCache cache)
Overrides the parent method to udpate the cached points.

Field Detail

bounds

protected Rectangle2D bounds
Reference to the bounds attribute

defaultBounds

public static final Rectangle2D defaultBounds

defaultCursors

public static transient int[] defaultCursors
Array that holds the cursors for the different control points.

renderer

public static transient VertexRenderer renderer
Renderer for the class.

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()
Constructs an empty vertex view.

VertexView

public VertexView(Object cell)
Constructs a vertex view for the specified model object and the specified child views.

Parameters: cell reference to the model object

Method Detail

getBounds

public Rectangle2D getBounds()
Returns the cached bounds for the vertex.

getCachedBounds

public Rectangle2D getCachedBounds()

getCenterPoint

public Point2D getCenterPoint()

Deprecated: replaced by AbstractCellView

Returns: the center point of this vertex

getHandle

public CellHandle getHandle(GraphContext context)
Returns a cell handle for the view, if the graph and the view are sizeable.

getPerimeterPoint

public Point2D getPerimeterPoint(Point2D source, Point2D p)

Deprecated: replaced by VertexView

getPerimeterPoint

public Point2D getPerimeterPoint(EdgeView edge, 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.

getRenderer

public CellViewRenderer getRenderer()
Returns a renderer for the class.

setCachedBounds

public void setCachedBounds(Rectangle2D bounds)

update

public void update(GraphLayoutCache cache)
Overrides the parent method to udpate the cached points.
Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.