|
||||||||||
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 | |
---|---|
class |
EdgeView.EdgeHandle
|
Field Summary | |
---|---|
Shape |
beginShape
Drawing attributes that are created on the fly |
Shape |
endShape
Drawing attributes that are created on the fly |
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. |
static long |
shapeHits
|
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, 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,
Point p)
Adds p at position index . |
Rectangle |
getBounds()
Returns the location for this portview. |
EdgeRenderer |
getEdgeRenderer()
Returns the local renderer. |
CellHandle |
getHandle(GraphContext context)
Returns a cell handle for the view. |
Rectangle |
getLabelBounds()
Returns the bounds of label according to the last rendering state |
Point |
getLabelPosition()
Returns a point that describes the position of the label. |
static double |
getLength(CellView view)
|
Point |
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,
Rectangle rect)
Returns true if this view intersects the given rectangle. |
boolean |
isAddPointEvent(MouseEvent event)
Returning true signifies a mouse event adds a new point to an edge. |
boolean |
isConstrainedMoveEvent(MouseEvent e)
|
boolean |
isRemovePointEvent(MouseEvent event)
Returning true signifies a mouse event removes a given point. |
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 |
setLabelPosition(Point pos)
Sets the description of the label position. |
void |
setPoint(int index,
Point 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, getAllAttributes, getAttributes, getBounds, getCell, getChildViews, getDescendantViews, getEditor, getGraph, getMapper, getModel, getParentView, getRendererComponent, isLeaf, removeFromParent, scale, setAttributes, setBounds, translate, updateAllAttributes |
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
public Shape beginShape
public Shape endShape
public Shape lineShape
public transient GeneralPath sharedPath
public static long shapeHits
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 final Shape getShape()
public final Rectangle getLabelBounds()
public boolean intersects(Graphics g, Rectangle rect)
intersects
in interface CellView
intersects
in class AbstractCellView
public Rectangle 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 Point getLabelPosition()
public void setLabelPosition(Point pos)
public List getPoints()
public int getPointCount()
public Point getPoint(int index)
public void setPoint(int index, Point p)
index
to p
.
public void addPoint(int index, Point p)
p
at position index
.
public void removePoint(int index)
index
.
public boolean isAddPointEvent(MouseEvent event)
public boolean isRemovePointEvent(MouseEvent event)
public static double getLength(CellView view)
public boolean isConstrainedMoveEvent(MouseEvent e)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |