org.jgraph.example
Class CompoundVertexView

java.lang.Object
  extended by org.jgraph.graph.AbstractCellView
      extended by org.jgraph.graph.VertexView
          extended by org.jgraph.example.CompoundVertexView
All Implemented Interfaces:
java.io.Serializable, org.jgraph.graph.CellView

public class CompoundVertexView
extends org.jgraph.graph.VertexView

Vertex view that supports visual vertex nesting to show inclusion edges in a compound graph. Differs from a selection group view as follows:

Like any VertexView, the bounds of a compound vertex view are forced to always remain large enough to enclose its child views. Otherwise, no restrictions are placed on the bounds.

Author:
J. Pulley
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jgraph.graph.VertexView
org.jgraph.graph.VertexView.SizeHandle
 
Field Summary
 
Fields inherited from class org.jgraph.graph.VertexView
defaultBounds, defaultCursors, renderer, xCursors, yCursors
 
Fields inherited from class org.jgraph.graph.AbstractCellView
cellEditor
 
Constructor Summary
CompoundVertexView()
          Initializes a new view for a compound vertex.
CompoundVertexView(java.lang.Object cell)
          Initializes a new view for a compound vertex with the specified model object.
 
Method Summary
 java.awt.geom.Rectangle2D getBounds()
          Retrieve this view's bounds from the view's attributes.
 void scale(double sx, double sy, java.awt.geom.Point2D origin)
          Scale this view by sx and sy, relative to origin.
 void setBounds(java.awt.geom.Rectangle2D newBounds)
          Set this view's bounds in the view's attributes.
 void translate(double dx, double dy)
          Translate this view and all child views by dx, dy.
 void update(org.jgraph.graph.GraphLayoutCache cache)
          Update attributes for this view and indicate to the parent this child has been updated.
 
Methods inherited from class org.jgraph.graph.VertexView
getCachedBounds, getCenterPoint, getHandle, getPerimeterPoint, getPerimeterPoint, getRenderer, setCachedBounds
 
Methods inherited from class org.jgraph.graph.AbstractCellView
changeAttributes, childUpdated, getAllAttributes, getAttributes, getBounds, getCell, getCenterPoint, getChildViews, getDescendantViews, getEditor, getParentView, getRendererComponent, intersects, isLeaf, refresh, removeFromParent, setAttributes, setCell
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundVertexView

public CompoundVertexView()
Initializes a new view for a compound vertex.


CompoundVertexView

public CompoundVertexView(java.lang.Object cell)
Initializes a new view for a compound vertex with the specified model object.

Parameters:
cell - model object
Method Detail

getBounds

public java.awt.geom.Rectangle2D getBounds()
Retrieve this view's bounds from the view's attributes.

Specified by:
getBounds in interface org.jgraph.graph.CellView
Overrides:
getBounds in class org.jgraph.graph.VertexView
Returns:
view's bounds

setBounds

public void setBounds(java.awt.geom.Rectangle2D newBounds)
Set this view's bounds in the view's attributes. If the new bounds do not completely enclose any child vertices, the new bounds are set to the union of the child vertices' bounds and the argument.

Overrides:
setBounds in class org.jgraph.graph.AbstractCellView
Parameters:
newBounds - new bounds

update

public void update(org.jgraph.graph.GraphLayoutCache cache)
Update attributes for this view and indicate to the parent this child has been updated.

Specified by:
update in interface org.jgraph.graph.CellView
Overrides:
update in class org.jgraph.graph.VertexView

translate

public void translate(double dx,
                      double dy)
Translate this view and all child views by dx, dy.

Overrides:
translate in class org.jgraph.graph.AbstractCellView
Parameters:
dx - x-axis translation
dy - y-axis translation

scale

public void scale(double sx,
                  double sy,
                  java.awt.geom.Point2D origin)
Scale this view by sx and sy, relative to origin. Child views are not scaled.

Overrides:
scale in class org.jgraph.graph.AbstractCellView
Parameters:
sx - x scaling factor
sy - y scaling factor