org.jgraph.graph
public class EdgeView extends AbstractCellView
Nested Class Summary | |
---|---|
static class | EdgeView.EdgeHandle |
Field Summary | |
---|---|
Shape | beginShape Drawing attributes that are created on the fly |
protected Rectangle2D | cachedBounds |
Shape | endShape Drawing attributes that are created on the fly |
protected Point2D[] | extraLabelPositions |
protected Point2D | labelPosition Cached label position of the edge. |
protected Point2D | labelVector |
Shape | lineShape Drawing attributes that are created on the fly |
static boolean | LEGACY_DISCONNECTABLE Whether or not pre 5.12.3.3 disconnectable behaviour is to be used.
|
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 | sourceParentView |
protected CellView | target Cached source and target portview of the edge. |
protected CellView | targetParentView |
Constructor Summary | |
---|---|
EdgeView()
Constructs an empty edge view. | |
EdgeView(Object cell)
Constructs an edge view for the specified model object.
|
Method Summary | |
---|---|
void | addExtraLabel(Point2D location, Object label)
Adds an extra label. |
void | addPoint(int index, Point2D p)
Adds p at position index . |
protected void | checkDefaultLabelPosition()
Hook for subclassers to avoid default label positions. |
protected Point2D | convertRelativeLabelPositionToAbsolute(Point2D geometry)
Converts an relative label position (x is distance along edge and y is
distance above/below edge vector) into an absolute co-ordination point |
protected Point2D | getAbsoluteExtraLabelPosition(int index)
Returns the absolute position of the specified extra label |
protected Point2D | getAbsoluteLabelPosition()
Returns the absolute position of the main label |
protected Point2D | getAbsoluteLabelPositionFromRelative(Point2D geometry)
Converts relative label position to absolute and allows for
any label offset. |
Rectangle2D | getBounds()
Returns the location for this edgeview. |
Point2D | getExtraLabelPosition(int index)
Returns a point that describes the position of the label. |
int | getFirstPointOfSegment()
Utility method that returns the first point of the pair that forms the
segment that is relativeX along the edge as a proportion
|
CellHandle | getHandle(GraphContext context)
Returns a cell handle for the view. |
Point2D | getLabelPosition()
Returns a point that describes the position of the label. |
Point2D | getLabelVector()
Hook to return the vector that is taken as the base vector to compute
relative label positions. |
static double | getLength(CellView view) |
protected Point2D | getNearestPoint(boolean source)
Returns the nearest point wrt to the source or target. |
Point2D | getPerimeterPoint(EdgeView edge, Point2D source, Point2D p) |
Point2D | getPoint(int index)
Returns the cached points for this edge. |
int | getPointCount()
Returns the number of point for this edge. |
protected Point2D | getPointLocation(int index)
Returns the point of edge at index . |
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 | getSourceParentView() |
CellView | getTarget()
Returns the CellView that represents the target of the edge. |
CellView | getTargetParentView() |
protected CellView | getVisibleParent(GraphModel model, CellMapper mapper, Object port) |
boolean | intersects(JGraph graph, Rectangle2D rect)
Returns true if this view intersects the given rectangle. |
protected void | invalidate()
Resets the cached values of the edge view |
boolean | isLoop()
Returns true if the edge is a loop. |
void | refresh(GraphLayoutCache cache, CellMapper mapper, boolean createDependentViews)
Overrides the parent method to udpate the cached points, source and
target port. |
void | removeExtraLabel(int index)
Removes the point at position index . |
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(GraphLayoutCache cache)
Update attributes and recurse children. |
Parameters: cell reference to the model object
p
at position index
.Parameters: geometry the relative label position
Returns: the absolute label position
Parameters: index the index of the extra label
Returns: the absolute position of the specified extra label
Returns: the absolute position of the main label
Parameters: geometry the relative label position
Returns: the absolute label position including any offset
Returns: the index of the first point. A value of -1 indicate to use the first and last points
edge
at index
. Avoids
calling getLocation
on any ports of edge
.
Returns: List
index
.index
.index
to p
.sourceView
of the edge.targetView
of the edge.