|
JGraph |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.jgraph.graph.AbstractCellView
The abstract base class for all cell views.
| Field Summary | |
protected AttributeMap |
allAttributes
Contains the complete set of attributes, including the cell's attributes. |
protected AttributeMap |
attributes
Hashtable for attributes. |
protected Object |
cell
Reference to the cell for this view |
protected static GraphCellEditor |
cellEditor
Editor for the cell. |
protected List |
childViews
Cached child views. |
protected Rectangle2D |
groupBounds
Cached bounds of all children if vertex is a group |
protected CellView |
parent
Cached parent view |
| Constructor Summary | |
AbstractCellView()
Constructs an empty abstract cell view. |
|
AbstractCellView(Object cell)
Constructs a view for the specified model object, and invokes update on the new instance. |
|
| Method Summary | |
Map |
changeAttributes(Map change)
Applies change to the attributes of the view and calls
update. |
void |
childUpdated()
Indicates to parent, if any, that this child has been updated. |
protected AttributeMap |
createFallbackAttributeMap()
Default implementation returns an AttributeMap |
AttributeMap |
getAllAttributes()
Returns the attributes of the view combined with the attributes of the corresponding cell. |
AttributeMap |
getAttributes()
Return the attributes of the view. |
Rectangle2D |
getBounds()
Returns the cached bounds for the group if isleaf is false |
static Rectangle2D |
getBounds(CellView[] views)
Returns the bounding box for the specified views. |
Object |
getCell()
Returns the model object that this view represents. |
CellView[] |
getChildViews()
Returns the child views of this view. |
static CellView[] |
getDescendantViews(CellView[] views)
Returns all views, including descendants that have a parent in views without the PortViews. |
GraphCellEditor |
getEditor()
Returns a cell editor for the view. |
abstract CellHandle |
getHandle(GraphContext context)
Returns a cell handle for the view. |
CellView |
getParentView()
Returns the parent view for this view. |
abstract CellViewRenderer |
getRenderer()
Obtains the renderer instance for this view |
Component |
getRendererComponent(JGraph graph,
boolean selected,
boolean focus,
boolean preview)
Returns a renderer component, configured for the view. |
protected boolean |
includeInGroupBounds(CellView view)
This is used to exclude certain cell views from the group bounds computation. |
boolean |
intersects(JGraph graph,
Rectangle2D rect)
Returns true if the view intersects the given rectangle. |
boolean |
isLeaf()
Returns true if the view is a leaf. |
protected void |
mergeAttributes()
Implements the merging of the cell's attributes, initially stored in allAttributes, and the location attributes. |
void |
refresh(GraphModel model,
CellMapper mapper,
boolean createDependentViews)
Create child views and reload properties for this view. |
void |
removeFromParent()
Removes this view from the list of children of the parent. |
protected void |
scale(double sx,
double sy,
Point2D origin)
Scale view (group) by sx, sy. |
void |
setAttributes(AttributeMap attributes)
Sets the attributes of this view to the specified value |
void |
setBounds(Rectangle2D bounds)
Sets the bounds of this view. |
void |
setCell(Object cell)
Sets the model object that this view represents to the specified cell |
protected void |
translate(double dx,
double dy)
Translates view (group) by dx, dy. |
void |
update()
Update attributes for this view and indicate to the parent this child has been updated |
protected void |
updateGroupBounds()
Updates the bounds of this view and its children |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static transient GraphCellEditor cellEditor
protected Object cell
protected transient CellView parent
protected transient List childViews
protected transient Rectangle2D groupBounds
protected AttributeMap attributes
allAttributes.protected transient AttributeMap allAttributes
attributes.| Constructor Detail |
public AbstractCellView()
public AbstractCellView(Object cell)
cell - reference to the model object| Method Detail |
public Object getCell()
getCell in interface CellViewpublic void setCell(Object cell)
cell - the model object this view will represent
public void refresh(GraphModel model,
CellMapper mapper,
boolean createDependentViews)
refresh in interface CellViewmodel - the graph model to be usedmapper - the cell mapper to be usedcreateDependentViews - whether or not to create a view if one does not already existpublic void update()
update in interface CellViewprotected void mergeAttributes()
protected AttributeMap createFallbackAttributeMap()
AttributeMapAttributeMappublic void childUpdated()
childUpdated in interface CellViewpublic CellView getParentView()
getParentView in interface CellViewpublic CellView[] getChildViews()
getChildViews in interface CellViewpublic static CellView[] getDescendantViews(CellView[] views)
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.views - the cell views whose descendants are to be returnedpublic void removeFromParent()
removeFromParent in interface CellViewpublic boolean isLeaf()
true if the view is a leaf.isLeaf in interface CellViewtrue if the view is a leafpublic AttributeMap getAttributes()
getAttributes in interface CellViewattributes of this viewpublic void setAttributes(AttributeMap attributes)
attributes - the new attributes to setpublic AttributeMap getAllAttributes()
getAllAttributes in interface CellViewpublic Map changeAttributes(Map change)
change to the attributes of the view and calls
update.changeAttributes in interface CellViewchange - a map of attribute changes to applypublic Rectangle2D getBounds()
getBounds in interface CellViewpublic static Rectangle2D getBounds(CellView[] views)
views - the views for whom the bounding box is to be determinedpublic void setBounds(Rectangle2D bounds)
view. Calls translateView and
scaleView.bounds - the new bounds for this cell viewprotected void updateGroupBounds()
protected boolean includeInGroupBounds(CellView view)
view - the cell view to be included in the group bounds or not
protected void translate(double dx,
double dy)
view (group) by dx, dy.dx - the x-coordinate amount to translate bydy - the y-coordinate amount to translate by
protected void scale(double sx,
double sy,
Point2D origin)
view (group) by sx, sy.sx - the multiple by which the x coordinate position of the cell
view is to be scaledsy - the multiple by which the y coordinate position of the cell
view is to be scaledorigin - the origin point from which the scaling will calculate
public boolean intersects(JGraph graph,
Rectangle2D rect)
intersects in interface CellViewgraph - the JGraph instance of the viewrect - the rectangle within which intersection is being checked for
public Component getRendererComponent(JGraph graph,
boolean selected,
boolean focus,
boolean preview)
getRendererComponent in interface CellViewgraph - the JGraph instance of the viewselected - whether or not this view is selectedfocus - whether or not this view is the focuspreview - whether or not it is a preview of the viewpublic abstract CellViewRenderer getRenderer()
public abstract CellHandle getHandle(GraphContext context)
getHandle in interface CellViewcontext - the context of this cell view (cells indirectly affected by
it)public GraphCellEditor getEditor()
getEditor in interface CellView
|
JGraph |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||