|
JGraph |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgraph.graph.AbstractCellView
org.jgraph.graph.EdgeView
public class EdgeView
The default implementation of an edge view.
Nested Class Summary | |
---|---|
static class |
EdgeView.EdgeHandle
|
Field Summary | |
---|---|
Shape |
beginShape
Drawing attributes that are created on the fly |
protected Rectangle2D |
cachedBounds
|
protected Rectangle2D[] |
cachedExtraLabelBounds
|
protected Rectangle2D |
cachedLabelBounds
|
Shape |
endShape
Drawing attributes that are created on the fly |
protected Point[] |
extraLabelPositions
|
protected Point |
labelPosition
Cached label position of the edge. |
Shape |
lineShape
Drawing attributes that are created on the fly |
protected List |
points
List of points of the edge. |
static EdgeRenderer |
renderer
Renderer for the class. |
GeneralPath |
sharedPath
Shared-path tune-up. |
protected CellView |
source
Cached source and target portview of the edge. |
protected CellView |
target
Cached source and target portview of the edge. |
Fields inherited from class org.jgraph.graph.AbstractCellView |
---|
allAttributes, attributes, cell, cellEditor, childViews, graph, groupBounds, mapper, parent |
Constructor Summary | |
---|---|
EdgeView(Object cell,
JGraph graph,
CellMapper mapper)
Constructs an edge view for the specified model object. |
Method Summary | |
---|---|
void |
addPoint(int index,
Point2D p)
Adds p at position index . |
Rectangle2D |
getBounds()
Returns the location for this portview. |
EdgeRenderer |
getEdgeRenderer()
Returns the local renderer. |
Rectangle2D |
getExtraLabelBounds(int index)
Returns the bounds of label according to the last rendering state |
Point2D |
getExtraLabelPosition(int index)
Returns a point that describes the position of the label. |
CellHandle |
getHandle(GraphContext context)
Returns a cell handle for the view. |
Rectangle2D |
getLabelBounds()
Returns the bounds of label according to the last rendering state |
Point2D |
getLabelPosition()
Returns a point that describes the position of the label. |
static double |
getLength(CellView view)
|
Point2D |
getPoint(int index)
Returns the cached points for this edge. |
int |
getPointCount()
Returns the number of point for this edge. |
List |
getPoints()
Returns the points. |
CellViewRenderer |
getRenderer()
Returns a renderer for the class. |
Shape |
getShape()
Returns the shape of the view according to the last rendering state |
CellView |
getSource()
Returns the CellView that represents the source of the edge. |
CellView |
getTarget()
Returns the CellView that represents the target of the edge. |
boolean |
intersects(Graphics g,
Rectangle2D rect)
Returns true if this view intersects the given rectangle. |
void |
refresh(boolean createDependentViews)
Overrides the parent method to udpate the cached points, source and target port. |
void |
removePoint(int index)
Removes the point at position index . |
void |
setExtraLabelPosition(int index,
Point2D pos)
Sets the description of the label position. |
void |
setLabelPosition(Point2D pos)
Sets the description of the label position. |
void |
setPoint(int index,
Point2D p)
Sets the point at index to p . |
void |
setSource(CellView sourceView)
Sets the sourceView of the edge. |
void |
setTarget(CellView targetView)
Sets the targetView of the edge. |
void |
update()
Update attributes and recurse children. |
Methods inherited from class org.jgraph.graph.AbstractCellView |
---|
childUpdated, createLocalAttributeMap, getAllAttributes, getAttributes, getBounds, getCell, getChildViews, getDescendantViews, getEditor, getGraph, getMapper, getModel, getParentView, getRendererComponent, isLeaf, removeFromParent, scale, setAttributes, setBounds, translate, updateAllAttributes, updateGroupBounds |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static EdgeRenderer renderer
protected List points
protected CellView source
protected CellView target
protected Point labelPosition
protected Point[] extraLabelPositions
public Shape beginShape
public Shape endShape
public Shape lineShape
public transient GeneralPath sharedPath
protected Rectangle2D cachedLabelBounds
protected Rectangle2D[] cachedExtraLabelBounds
protected Rectangle2D cachedBounds
Constructor Detail |
---|
public EdgeView(Object cell, JGraph graph, CellMapper mapper)
cell
- reference to the model objectMethod Detail |
---|
public void refresh(boolean createDependentViews)
refresh
in interface CellView
refresh
in class AbstractCellView
public void update()
update
in interface CellView
update
in class AbstractCellView
public Shape getShape()
public Rectangle2D getLabelBounds()
public Rectangle2D getExtraLabelBounds(int index)
public boolean intersects(Graphics g, Rectangle2D rect)
intersects
in interface CellView
intersects
in class AbstractCellView
public Rectangle2D getBounds()
getBounds
in interface CellView
getBounds
in class AbstractCellView
public EdgeRenderer getEdgeRenderer()
public CellViewRenderer getRenderer()
getRenderer
in class AbstractCellView
public CellHandle getHandle(GraphContext context)
getHandle
in interface CellView
getHandle
in class AbstractCellView
public CellView getSource()
public void setSource(CellView sourceView)
sourceView
of the edge.
public CellView getTarget()
public void setTarget(CellView targetView)
targetView
of the edge.
public Point2D getExtraLabelPosition(int index)
public Point2D getLabelPosition()
public void setLabelPosition(Point2D pos)
public void setExtraLabelPosition(int index, Point2D pos)
public List getPoints()
public int getPointCount()
public Point2D getPoint(int index)
public void setPoint(int index, Point2D p)
index
to p
.
public void addPoint(int index, Point2D p)
p
at position index
.
public void removePoint(int index)
index
.
public static double getLength(CellView view)
|
JGraph |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |