Package org.jgraph.graph
Class VertexView
- java.lang.Object
-
- org.jgraph.graph.AbstractCellView
-
- org.jgraph.graph.VertexView
-
- All Implemented Interfaces:
java.io.Serializable,CellView
public class VertexView extends AbstractCellView
The default implementation of a vertex view.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVertexView.SizeHandle
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.geom.Rectangle2DboundsReference to the bounds attributestatic java.awt.geom.Rectangle2DdefaultBoundsstatic int[]defaultCursorsArray that holds the cursors for the different control points.static VertexRendererrendererRenderer for the class.static int[]xCursorsArray that holds the cursors for the different control points.static int[]yCursorsArray that holds the cursors for the different control points.-
Fields inherited from class org.jgraph.graph.AbstractCellView
allAttributes, attributes, cell, cellEditor, childViews, groupBounds, parent
-
-
Constructor Summary
Constructors Constructor Description VertexView()Constructs an empty vertex view.VertexView(java.lang.Object cell)Constructs a vertex view for the specified model object and the specified child views.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.awt.geom.Rectangle2DgetBounds()Returns the cached bounds for the vertex.java.awt.geom.Rectangle2DgetCachedBounds()java.awt.geom.Point2DgetCenterPoint()Deprecated.replaced byAbstractCellView.getCenterPoint(CellView vertex)CellHandlegetHandle(GraphContext context)Returns a cell handle for the view, if the graph and the view are sizeable.java.awt.geom.Point2DgetPerimeterPoint(java.awt.geom.Point2D source, java.awt.geom.Point2D p)Deprecated.java.awt.geom.Point2DgetPerimeterPoint(EdgeView edge, java.awt.geom.Point2D source, java.awt.geom.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(java.awt.geom.Rectangle2D bounds)voidupdate(GraphLayoutCache cache)Overrides the parent method to udpate the cached points.-
Methods inherited from class org.jgraph.graph.AbstractCellView
changeAttributes, childUpdated, createAttributeMap, getAllAttributes, getAttributes, getBounds, getCell, getCellAttributes, getCenterPoint, getChildViews, getDescendantViews, getEditor, getParentView, getRendererComponent, includeInGroupBounds, intersects, isLeaf, mergeAttributes, refresh, removeFromParent, scale, setAttributes, setBounds, setCell, translate, updateGroupBounds
-
-
-
-
Field Detail
-
renderer
public static transient VertexRenderer renderer
Renderer for the class.
-
defaultBounds
public static final java.awt.geom.Rectangle2D defaultBounds
-
bounds
protected java.awt.geom.Rectangle2D bounds
Reference to the bounds attribute
-
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.
-
-
Method Detail
-
update
public void update(GraphLayoutCache cache)
Overrides the parent method to udpate the cached points.- Specified by:
updatein interfaceCellView- Overrides:
updatein classAbstractCellView- Parameters:
cache- TODO
-
getCachedBounds
public java.awt.geom.Rectangle2D getCachedBounds()
-
setCachedBounds
public void setCachedBounds(java.awt.geom.Rectangle2D bounds)
-
getRenderer
public CellViewRenderer getRenderer()
Returns a renderer for the class.- Specified by:
getRendererin classAbstractCellView- Returns:
- the renderer instance for this view
-
getHandle
public CellHandle getHandle(GraphContext context)
Returns a cell handle for the view, if the graph and the view are sizeable.- Specified by:
getHandlein interfaceCellView- Specified by:
getHandlein classAbstractCellView- Parameters:
context- the context of this cell view (cells indirectly affected by it)- Returns:
- the cell handle for this view
-
getBounds
public java.awt.geom.Rectangle2D getBounds()
Returns the cached bounds for the vertex.- Specified by:
getBoundsin interfaceCellView- Overrides:
getBoundsin classAbstractCellView
-
getCenterPoint
public java.awt.geom.Point2D getCenterPoint()
Deprecated.replaced byAbstractCellView.getCenterPoint(CellView vertex)- Returns:
- the center point of this vertex
-
getPerimeterPoint
public java.awt.geom.Point2D getPerimeterPoint(java.awt.geom.Point2D source, java.awt.geom.Point2D p)Deprecated.
-
getPerimeterPoint
public java.awt.geom.Point2D getPerimeterPoint(EdgeView edge, java.awt.geom.Point2D source, java.awt.geom.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.- Specified by:
getPerimeterPointin interfaceCellView- Overrides:
getPerimeterPointin classAbstractCellView
-
-