|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgraph.graph.AbstractCellView
The abstract base class for all cell views.
Field Summary | |
protected java.util.Map |
attributes
Hashtable for attributes. |
protected java.lang.Object |
cell
Reference to the cell for this view |
protected static GraphCellEditor |
cellEditor
Editor for the cell. |
protected java.util.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(java.lang.Object cell,
JGraph graph,
CellMapper mapper)
Constructs a view for the specified model object, and invokes update on the new instance. |
Method Summary | |
java.util.Map |
getAttributes()
Return the attributes of the view. |
abstract java.awt.Rectangle |
getBounds()
Returns the bounding rectangle for this view. |
static java.awt.Rectangle |
getBounds(CellView[] views)
Returns the bounding box for the specified views. |
java.lang.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. |
protected abstract CellViewRenderer |
getRenderer()
|
java.awt.Component |
getRendererComponent(JGraph graph,
boolean selected,
boolean focus,
boolean preview)
Returns a renderer component, configured for the view. |
boolean |
intersects(java.awt.Graphics g,
java.awt.Rectangle rect)
Returns true if the view intersects the given rectangle. |
boolean |
isControlAttribute(java.lang.Object key)
The following control attributes may always be present. |
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,
java.awt.Point origin)
Scale view (group) by sx, sy . |
void |
setAttributes(java.util.Map change)
Applies change to the attributes of the view
and calls update. |
void |
setBounds(java.awt.Rectangle bounds)
Sets the bounds of view . |
protected void |
translate(int dx,
int dy)
Translates view (group) by dx, dy . |
void |
update()
Update attributes and recurse children. |
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 java.lang.Object cell
protected CellView parent
protected java.util.List childViews
protected java.util.Map attributes
Constructor Detail |
public AbstractCellView(java.lang.Object cell, JGraph graph, CellMapper mapper)
cell
- reference to the model objectMethod Detail |
public JGraph getGraph()
public GraphModel getModel()
public CellMapper getMapper()
public java.lang.Object getCell()
getCell
in interface CellView
public void refresh(boolean createDependentViews)
refresh
in interface CellView
public void update()
update
in interface CellView
public CellView getParentView()
getParentView
in interface CellView
public CellView[] getChildViews()
getChildViews
in interface CellView
public static CellView[] getDescendantViews(CellView[] views)
views
without the PortViews.
Note: Iterative Implementation.
public void removeFromParent()
removeFromParent
in interface CellView
public boolean isLeaf()
isLeaf
in interface CellView
public java.util.Map getAttributes()
getAttributes
in interface CellView
public void setAttributes(java.util.Map change)
change
to the attributes of the view
and calls update.
setAttributes
in interface CellView
public boolean isControlAttribute(java.lang.Object key)
public abstract java.awt.Rectangle getBounds()
getBounds
in interface CellView
public static java.awt.Rectangle getBounds(CellView[] views)
public void setBounds(java.awt.Rectangle bounds)
view
.
Calls translateView and scaleView.
protected void translate(int dx, int dy)
view
(group) by dx, dy
.
protected void scale(double sx, double sy, java.awt.Point origin)
view
(group) by sx, sy
.
public boolean intersects(java.awt.Graphics g, java.awt.Rectangle rect)
intersects
in interface CellView
public java.awt.Component getRendererComponent(JGraph graph, boolean selected, boolean focus, boolean preview)
getRendererComponent
in interface CellView
protected abstract CellViewRenderer getRenderer()
public abstract CellHandle getHandle(GraphContext context)
getHandle
in interface CellView
public GraphCellEditor getEditor()
getEditor
in interface CellView
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |