org.jgraph.graph

Interface CellView

public interface CellView

Defines the requirements for an object that represents a view for a model cell.
Method Summary
MapchangeAttributes(GraphLayoutCache cache, Map map)
Apply the specified map of attributes on the view.
voidchildUpdated()
AttributeMapgetAllAttributes()
AttributeMapgetAttributes()
Returns all attributes of the view as a map.
Rectangle2DgetBounds()
Returns the bounds for the view.
ObjectgetCell()
Returns the model object that this view represents.
CellView[]getChildViews()
Returns the child views of this view.
GraphCellEditorgetEditor()
Returns a cell editor for the view.
CellHandlegetHandle(GraphContext context)
Returns a cell handle for the view.
CellViewgetParentView()
Returns the parent of view of this view.
Point2DgetPerimeterPoint(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.
ComponentgetRendererComponent(JGraph graph, boolean selected, boolean focus, boolean preview)
Returns a renderer component, configured for the view.
booleanintersects(JGraph g, Rectangle2D rect)
Returns true if the view intersects the given rectangle.
booleanisLeaf()
Returns true if the view is a leaf.
voidrefresh(GraphLayoutCache cache, CellMapper mapper, boolean createDependentViews)
Refresh this view based on the model cell.
voidremoveFromParent()
Removes this view from the list of childs of the parent.
voidupdate(GraphLayoutCache cache)
Update this view's attributes.

Method Detail

changeAttributes

public Map changeAttributes(GraphLayoutCache cache, Map map)
Apply the specified map of attributes on the view.

childUpdated

public void childUpdated()

getAllAttributes

public AttributeMap getAllAttributes()

getAttributes

public AttributeMap getAttributes()
Returns all attributes of the view as a map.

getBounds

public Rectangle2D getBounds()
Returns the bounds for the view.

getCell

public Object getCell()
Returns the model object that this view represents.

getChildViews

public CellView[] getChildViews()
Returns the child views of this view.

getEditor

public GraphCellEditor getEditor()
Returns a cell editor for the view.

getHandle

public CellHandle getHandle(GraphContext context)
Returns a cell handle for the view.

getParentView

public CellView getParentView()
Returns the parent of view of this view.

getPerimeterPoint

public Point2D 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.

getRendererComponent

public Component getRendererComponent(JGraph graph, boolean selected, boolean focus, boolean preview)
Returns a renderer component, configured for the view.

intersects

public boolean intersects(JGraph g, Rectangle2D rect)
Returns true if the view intersects the given rectangle.

isLeaf

public boolean isLeaf()
Returns true if the view is a leaf.

refresh

public void refresh(GraphLayoutCache cache, CellMapper mapper, boolean createDependentViews)
Refresh this view based on the model cell. This is messaged when the model cell has changed.

removeFromParent

public void removeFromParent()
Removes this view from the list of childs of the parent.

update

public void update(GraphLayoutCache cache)
Update this view's attributes. This is messaged whenever refresh is messaged, and additionally when the context of the cell has changed, and during live-preview changes to the view.

Parameters: cache TODO

Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.