com.jgraph.graph
Class VertexView

java.lang.Object
  extended bycom.jgraph.graph.AbstractCellView
      extended bycom.jgraph.graph.VertexView
All Implemented Interfaces:
CellView, java.io.Serializable

public class VertexView
extends AbstractCellView

The default implementation of a vertex view.

See Also:
Serialized Form

Nested Class Summary
 class VertexView.SizeHandle
           
 
Field Summary
protected  java.awt.Rectangle bounds
          Reference to the bounds attribute
static VertexRenderer renderer
          Renderer for the class.
 
Fields inherited from class com.jgraph.graph.AbstractCellView
attributes, cell, cellEditor, childViews, graph, mapper, parent
 
Constructor Summary
VertexView(java.lang.Object cell, JGraph graph, CellMapper mapper)
          Constructs a vertex view for the specified model object and the specified child views.
 
Method Summary
 java.awt.Rectangle getBounds()
          Returns the cached bounds for the vertex.
 java.awt.Point 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.
 java.awt.Point getPerimeterPoint(java.awt.Point source, java.awt.Point 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.
 boolean isConstrainedSizeEvent(java.awt.event.MouseEvent e)
           
 boolean isControlAttribute(java.lang.Object key)
          The following control attributes may always be present.
 void update()
          Overrides the parent method to udpate the cached points.
 
Methods inherited from class com.jgraph.graph.AbstractCellView
getAttributes, getBounds, getCell, getChildViews, getDescendantViews, getEditor, getGraph, getMapper, getModel, getParentView, getRendererComponent, intersects, isLeaf, refresh, removeFromParent, scale, setAttributes, setBounds, translate
 
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 java.awt.Rectangle bounds
Reference to the bounds attribute

Constructor Detail

VertexView

public VertexView(java.lang.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

getBounds

public java.awt.Rectangle getBounds()
Returns the cached bounds for the vertex.

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

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

isControlAttribute

public boolean isControlAttribute(java.lang.Object key)
The following control attributes may always be present.

Overrides:
isControlAttribute in class AbstractCellView

getCenterPoint

public java.awt.Point getCenterPoint()
Returns the center of this vertex.


getPerimeterPoint

public java.awt.Point getPerimeterPoint(java.awt.Point source,
                                        java.awt.Point 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.


isConstrainedSizeEvent

public boolean isConstrainedSizeEvent(java.awt.event.MouseEvent e)