|
JGraph |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | 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
|
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 JGraph |
graph
Reference to the graph |
protected CellMapper |
mapper
Reference to the cell mapper for the view |
protected CellView |
parent
Cached parent view |
| Constructor Summary | |
AbstractCellView(Object cell,
JGraph graph,
CellMapper mapper)
Constructs a view for the specified model object, and invokes update on the new instance. |
|
| Method Summary | |
void |
childUpdated()
|
AttributeMap |
getAllAttributes()
Returns the attributes of the view combined with the attributes of the corresponding cell. |
AttributeMap |
getAttributes()
Return the attributes of the view. |
abstract Rectangle2D |
getBounds()
Returns the bounding rectangle for this view. |
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. |
JGraph |
getGraph()
Returns the graph associated with the view. |
abstract CellHandle |
getHandle(GraphContext context)
Returns a cell handle for the view. |
CellMapper |
getMapper()
Returns the cell mapper associated with the view. |
GraphModel |
getModel()
Returns the model associated with the view. |
CellView |
getParentView()
Returns the parent view for this view. |
abstract CellViewRenderer |
getRenderer()
|
Component |
getRendererComponent(JGraph graph,
boolean selected,
boolean focus,
boolean preview)
Returns a renderer component, configured for the view. |
boolean |
intersects(Graphics g,
Rectangle2D rect)
Returns true if the view intersects the given rectangle. |
boolean |
isLeaf()
Returns true if the view is a leaf. |
void |
refresh(boolean createDependentViews)
Create child views and reload properties. |
void |
removeFromParent()
Removes this view from the list of childs of the parent. |
protected void |
scale(double sx,
double sy,
Point2D origin)
Scale view (group) by sx, sy. |
AttributeMap |
setAttributes(AttributeMap change)
Applies change to the attributes of the view
and calls update. |
void |
setBounds(Rectangle2D bounds)
Sets the bounds of view. |
protected void |
translate(double dx,
double dy)
Translates view (group) by dx, dy. |
void |
update()
Update attributes and recurse children. |
protected void |
updateAllAttributes()
This method implements the merge between the cell's and the view's attributes. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static GraphCellEditor cellEditor
protected JGraph graph
protected CellMapper mapper
protected Object cell
protected CellView parent
protected List childViews
protected AttributeMap attributes
protected AttributeMap allAttributes
| Constructor Detail |
public AbstractCellView(Object cell,
JGraph graph,
CellMapper mapper)
cell - reference to the model object| Method Detail |
public JGraph getGraph()
public GraphModel getModel()
public CellMapper getMapper()
public Object getCell()
getCell in interface CellViewpublic void refresh(boolean createDependentViews)
refresh in interface CellViewpublic void update()
update in interface CellViewprotected void updateAllAttributes()
public 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
public void removeFromParent()
removeFromParent in interface CellViewpublic boolean isLeaf()
isLeaf in interface CellViewpublic AttributeMap getAttributes()
getAttributes in interface CellViewpublic AttributeMap getAllAttributes()
getAllAttributes in interface CellViewpublic AttributeMap setAttributes(AttributeMap change)
change to the attributes of the view
and calls update.
setAttributes in interface CellViewpublic abstract Rectangle2D getBounds()
getBounds in interface CellViewpublic static Rectangle2D getBounds(CellView[] views)
public void setBounds(Rectangle2D bounds)
view.
Calls translateView and scaleView.
protected void translate(double dx,
double dy)
view (group) by dx, dy.
protected void scale(double sx,
double sy,
Point2D origin)
view (group) by sx, sy.
public boolean intersects(Graphics g,
Rectangle2D rect)
intersects in interface CellView
public Component getRendererComponent(JGraph graph,
boolean selected,
boolean focus,
boolean preview)
getRendererComponent in interface CellViewpublic abstract CellViewRenderer getRenderer()
public abstract CellHandle getHandle(GraphContext context)
getHandle in interface CellViewpublic GraphCellEditor getEditor()
getEditor in interface CellView
|
JGraph |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||