org.jgraph.graph.AbstractCellView Class Reference

Inheritance diagram for org.jgraph.graph.AbstractCellView:

org.jgraph.graph.CellView manas.GGates.MyView org.jgraph.graph.EdgeView org.jgraph.graph.PortView org.jgraph.graph.VertexView List of all members.

Public Member Functions

 AbstractCellView ()
 AbstractCellView (Object cell)
Object getCell ()
void setCell (Object cell)
void refresh (GraphModel model, CellMapper mapper, boolean createDependentViews)
void update ()
void childUpdated ()
CellView getParentView ()
CellView[] getChildViews ()
void removeFromParent ()
boolean isLeaf ()
AttributeMap getAttributes ()
void setAttributes (AttributeMap attributes)
AttributeMap getAllAttributes ()
Map changeAttributes (Map change)
Rectangle2D getBounds ()
void setBounds (Rectangle2D bounds)
boolean intersects (JGraph graph, Rectangle2D rect)
Component getRendererComponent (JGraph graph, boolean selected, boolean focus, boolean preview)
abstract CellViewRenderer getRenderer ()
abstract CellHandle getHandle (GraphContext context)
GraphCellEditor getEditor ()
Point2D getPerimeterPoint (EdgeView edge, Point2D source, Point2D p)

Static Public Member Functions

static CellView[] getDescendantViews (CellView[] views)
static Rectangle2D getBounds (CellView[] views)
static Point2D getCenterPoint (CellView vertex)

Protected Member Functions

AttributeMap createAttributeMap ()
AttributeMap getCellAttributes (GraphModel model)
void mergeAttributes ()
void updateGroupBounds ()
boolean includeInGroupBounds (CellView view)
void translate (double dx, double dy)
void scale (double sx, double sy, Point2D origin)

Protected Attributes

Object cell = null
CellView parent = null
java.util.List childViews = new ArrayList(0)
AttributeMap allAttributes = createAttributeMap()
AttributeMap attributes = allAttributes
transient Rectangle2D groupBounds = VertexView.defaultBounds

Static Protected Attributes

static transient GraphCellEditor cellEditor = null

Static Package Functions

 [static initializer]

Detailed Description

The abstract base class for all cell views.

Version:
1.0 1/3/02
Author:
Gaudenz Alder


Constructor & Destructor Documentation

org.jgraph.graph.AbstractCellView.AbstractCellView  ) 
 

Constructs an empty abstract cell view. You should set a cell on this view using setCell before doing anything. Optionally you can also set a different attribute map using setAttributeMap. Note: To change the attribute map you should now use the changeAttributes method.

org.jgraph.graph.AbstractCellView.AbstractCellView Object  cell  ) 
 

Constructs a view for the specified model object, and invokes update on the new instance.

Parameters:
cell reference to the model object


Member Function Documentation

org.jgraph.graph.AbstractCellView.[static initializer]  )  [static, package]
 

Reimplemented in org.jgraph.graph.VertexView.

Map org.jgraph.graph.AbstractCellView.changeAttributes Map  change  ) 
 

Applies change to the attributes of the view and calls update.

Parameters:
change a map of attribute changes to apply
Returns:
the undo map that reverses this change

Implements org.jgraph.graph.CellView.

void org.jgraph.graph.AbstractCellView.childUpdated  ) 
 

Indicates to parent, if any, that this child has been updated.

Implements org.jgraph.graph.CellView.

AttributeMap org.jgraph.graph.AbstractCellView.createAttributeMap  )  [protected]
 

Hook for subclassers to avoid creating an empty AttributeMap during construction of the instance. Override this and return null if you want to avoid creation of an attribute map at construction time.

AttributeMap org.jgraph.graph.AbstractCellView.getAllAttributes  ) 
 

Returns the attributes of the view combined with the attributes of the corresponding cell. The view's attributes override the cell's attributes with the same key.

Implements org.jgraph.graph.CellView.

AttributeMap org.jgraph.graph.AbstractCellView.getAttributes  ) 
 

Return the attributes of the view.

Returns:
the attributes of this view

Implements org.jgraph.graph.CellView.

static Rectangle2D org.jgraph.graph.AbstractCellView.getBounds CellView[]  views  )  [static]
 

Returns the bounding box for the specified views.

Parameters:
views the views for whom the bounding box is to be determined
Returns:
the bounding box of the specified views

Rectangle2D org.jgraph.graph.AbstractCellView.getBounds  ) 
 

Returns the cached bounds for the group if isleaf is false

Implements org.jgraph.graph.CellView.

Reimplemented in org.jgraph.graph.EdgeView, org.jgraph.graph.PortView, and org.jgraph.graph.VertexView.

Object org.jgraph.graph.AbstractCellView.getCell  ) 
 

Returns the model object that this view represents.

Returns:
the model object that this view represents

Implements org.jgraph.graph.CellView.

AttributeMap org.jgraph.graph.AbstractCellView.getCellAttributes GraphModel  model  )  [protected]
 

Hook for subclassers to avoid cloning the cell's attributes. Return model.getAttributes(cell) to avoid cloning.

static Point2D org.jgraph.graph.AbstractCellView.getCenterPoint CellView  vertex  )  [static]
 

CellView [] org.jgraph.graph.AbstractCellView.getChildViews  ) 
 

Returns the child views of this view.

Returns:
the child views of this view

Implements org.jgraph.graph.CellView.

static CellView [] org.jgraph.graph.AbstractCellView.getDescendantViews CellView[]  views  )  [static]
 

Returns all views, including descendants that have a parent in views without the PortViews. Note: Iterative Implementation using view.getChildViews. This returns the array in inverse order, ie with the top most cell view at index 0.

Parameters:
views the cell views whose descendants are to be returned
Returns:
the specified views and all their descendant views

GraphCellEditor org.jgraph.graph.AbstractCellView.getEditor  ) 
 

Returns a cell editor for the view.

Returns:
the cell editor for this view

Implements org.jgraph.graph.CellView.

abstract CellHandle org.jgraph.graph.AbstractCellView.getHandle GraphContext  context  )  [pure virtual]
 

Returns a cell handle for the view.

Parameters:
context the context of this cell view (cells indirectly affected by it)
Returns:
the cell handle for this view

Implements org.jgraph.graph.CellView.

Implemented in manas.GGates.MyView, org.jgraph.graph.EdgeView, org.jgraph.graph.PortView, and org.jgraph.graph.VertexView.

CellView org.jgraph.graph.AbstractCellView.getParentView  ) 
 

Returns the parent view for this view.

Returns:
the parent view for this view

Implements org.jgraph.graph.CellView.

Reimplemented in org.jgraph.graph.PortView.

Point2D org.jgraph.graph.AbstractCellView.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.

Implements org.jgraph.graph.CellView.

Reimplemented in manas.GGates.MyView, org.jgraph.graph.EdgeView, and org.jgraph.graph.VertexView.

abstract CellViewRenderer org.jgraph.graph.AbstractCellView.getRenderer  )  [pure virtual]
 

Obtains the renderer instance for this view

Returns:
the renderer instance for this view

Implemented in manas.GGates.MyView, org.jgraph.graph.EdgeView, org.jgraph.graph.PortView, and org.jgraph.graph.VertexView.

Component org.jgraph.graph.AbstractCellView.getRendererComponent JGraph  graph,
boolean  selected,
boolean  focus,
boolean  preview
 

Returns a renderer component, configured for the view. The method used to obtain the renderer instance must install the necessary attributes from this view

Parameters:
graph the JGraph instance of the view
selected whether or not this view is selected
focus whether or not this view is the focus
preview whether or not it is a preview of the view
Returns:
the renderer component for this view with this views attributes installed

Implements org.jgraph.graph.CellView.

boolean org.jgraph.graph.AbstractCellView.includeInGroupBounds CellView  view  )  [protected]
 

This is used to exclude certain cell views from the group bounds computation. This implementation returns false for edges that connect to one of their ancestor groups (eg. parent).

Parameters:
view the cell view to be included in the group bounds or not
Returns:
whether or not to include the specified cell in the group bounds

boolean org.jgraph.graph.AbstractCellView.intersects JGraph  graph,
Rectangle2D  rect
 

Returns true if the view intersects the given rectangle.

Parameters:
graph the JGraph instance of the view
rect the rectangle within which intersection is being checked for
Returns:
whether or not the rectangle specified intersects the view

Implements org.jgraph.graph.CellView.

Reimplemented in org.jgraph.graph.EdgeView.

boolean org.jgraph.graph.AbstractCellView.isLeaf  ) 
 

Returns true if the view is a leaf.

Returns:
true if the view is a leaf

Implements org.jgraph.graph.CellView.

void org.jgraph.graph.AbstractCellView.mergeAttributes  )  [protected]
 

Implements the merging of the cell's attributes, initially stored in allAttributes, and the location attributes. The result should be stored in allAttributes. This hook is for subclassers to change the merging strategy.

void org.jgraph.graph.AbstractCellView.refresh GraphModel  model,
CellMapper  mapper,
boolean  createDependentViews
 

Create child views and reload properties for this view. Invokes update first.

Parameters:
model the graph model to be used
mapper the cell mapper to be used
createDependentViews whether or not to create a view if one does not already exist

Implements org.jgraph.graph.CellView.

Reimplemented in org.jgraph.graph.EdgeView.

void org.jgraph.graph.AbstractCellView.removeFromParent  ) 
 

Removes this view from the list of children of the parent.

Implements org.jgraph.graph.CellView.

void org.jgraph.graph.AbstractCellView.scale double  sx,
double  sy,
Point2D  origin
[protected]
 

Scale view (group) by sx, sy.

Parameters:
sx the multiple by which the x coordinate position of the cell view is to be scaled
sy the multiple by which the y coordinate position of the cell view is to be scaled
origin the origin point from which the scaling will calculate

void org.jgraph.graph.AbstractCellView.setAttributes AttributeMap  attributes  ) 
 

Sets the attributes of this view to the specified value

Parameters:
attributes the new attributes to set

void org.jgraph.graph.AbstractCellView.setBounds Rectangle2D  bounds  ) 
 

Sets the bounds of this view. Calls translateView and scaleView.

Parameters:
bounds the new bounds for this cell view

void org.jgraph.graph.AbstractCellView.setCell Object  cell  ) 
 

Sets the model object that this view represents to the specified cell

Parameters:
cell the model object this view will represent

void org.jgraph.graph.AbstractCellView.translate double  dx,
double  dy
[protected]
 

Translates view (group) by dx, dy.

Parameters:
dx the x-coordinate amount to translate by
dy the y-coordinate amount to translate by

void org.jgraph.graph.AbstractCellView.update  ) 
 

Update attributes for this view and indicate to the parent this child has been updated

Implements org.jgraph.graph.CellView.

Reimplemented in org.jgraph.graph.EdgeView, and org.jgraph.graph.VertexView.

void org.jgraph.graph.AbstractCellView.updateGroupBounds  )  [protected]
 

Updates the bounds of this view and its children


Member Data Documentation

AttributeMap org.jgraph.graph.AbstractCellView.allAttributes = createAttributeMap() [protected]
 

Contains the complete set of attributes, including the cell's attributes. The values in this map are overriden by the corresponding values in attributes.

AttributeMap org.jgraph.graph.AbstractCellView.attributes = allAttributes [protected]
 

Hashtable for attributes. Value in this map override the values in allAttributes.

Object org.jgraph.graph.AbstractCellView.cell = null [protected]
 

Reference to the cell for this view

transient GraphCellEditor org.jgraph.graph.AbstractCellView.cellEditor = null [static, protected]
 

Editor for the cell.

java.util.List org.jgraph.graph.AbstractCellView.childViews = new ArrayList(0) [protected]
 

Cached child views. Default is a ArrayList with allocation size 0.

transient Rectangle2D org.jgraph.graph.AbstractCellView.groupBounds = VertexView.defaultBounds [protected]
 

Cached bounds of all children if vertex is a group

CellView org.jgraph.graph.AbstractCellView.parent = null [protected]
 

Cached parent view


The documentation for this class was generated from the following file:
Generated on Sun May 28 19:13:13 2006 for Digimod by  doxygen 1.4.6-NO