|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.EdgeRealizer y.view.BezierEdgeRealizer
public class BezierEdgeRealizer
This realizer draws an edge as a bezier (cubic) spline curve. The bends are interpreted as control points for the curve. The control points of this curve type do not lie on the curve itself. Every 2nd segment (starting with the 3rd) formed by the control points is tangential to the curve at the point lying in the middle of that segment.
Field Summary |
---|
Fields inherited from class y.view.EdgeRealizer |
---|
bends, path, PATH_CLIPPED_AT_SOURCE, PATH_CLIPPED_AT_SOURCE_AND_TARGET, PATH_CLIPPED_AT_TARGET, PATH_INVISBLE, PATH_UNCLIPPED |
Constructor Summary | |
---|---|
BezierEdgeRealizer()
Default Constructor. |
|
BezierEdgeRealizer(EdgeRealizer r)
Constructs a new BezierEdgeRealizer as a copy of the given realizer. |
Method Summary | |
---|---|
protected byte |
calculatePath(java.awt.geom.Point2D sourceIntersectionOut,
java.awt.geom.Point2D targetIntersectionOut)
Recalculates the bezier curve path after this realizer has been marked as dirty. |
void |
calcUnionRect(java.awt.geom.Rectangle2D r)
Calculate the union of rectangle enclosed by this realizer and r. |
boolean |
contains(double x,
double y)
Tests whether or not the given coordinate hits the path of this realizer. |
Bend |
createBend(double x,
double y,
Bend refBend,
int dir)
Adds a new bend before or after the given reference bend. |
EdgeRealizer |
createCopy(EdgeRealizer er)
Creates a copy of this realizer type that is initialized with the attributes of the given realizer. |
Bend |
insertBend(double x,
double y)
Inserts a new bend at location (x,y) into this realizer. |
boolean |
intersects(java.awt.geom.Rectangle2D box)
Checks whether the given rectangle overlaps the edge. |
protected void |
paintHighlightedBends(java.awt.Graphics2D gfx)
Specialized paint method. |
void |
read(java.io.ObjectInputStream in)
Deprecated. Use the GraphML format instead. |
void |
reInsertBend(Bend bend,
Bend refBend,
int dir)
Reinserts a bend to the edge which had been removed before. |
Bend |
removeBend(Bend b)
Removes a Bend of this realizer |
void |
write(java.io.ObjectOutputStream out)
Deprecated. Use the GraphML format instead. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BezierEdgeRealizer()
public BezierEdgeRealizer(EdgeRealizer r)
Method Detail |
---|
public EdgeRealizer createCopy(EdgeRealizer er)
createCopy
in class EdgeRealizer
public Bend createBend(double x, double y, Bend refBend, int dir)
createBend
in class EdgeRealizer
x
- X-coordinate of the Bendy
- Y-coordinate of the BendrefBend
- Bend which should be neighbordir
- indicates if the new Bend should be added before
(Graph.BEFORE) or after (Graph.AFTER) the refBend in
the bend sequence of the edgepublic void reInsertBend(Bend bend, Bend refBend, int dir)
EdgeRealizer
reInsertBend
in class EdgeRealizer
bend
- the bend to be reinsertedrefBend
- reference bend already contained in this realizerdir
- indicates whether the bend should be inserted before or after the
reference bend.Allowed values are Graph.AFTER
and Graph.BEFORE
.public Bend insertBend(double x, double y)
(x,y)
into this realizer.
If the given coordinates lie on the underlying bezier polygon, a new bend will be added that splits the corresponding segment in two parts. Otherwise, no bend is created (e.g. for coordinates very far away from the bezier polygon).
insertBend
in class EdgeRealizer
x
- X-coordinates of the bendy
- Y-coordinates of the bend
Bend
instance or null
if no
bend was created for the given coordinates.public boolean contains(double x, double y)
contains
in class EdgeRealizer
public Bend removeBend(Bend b)
removeBend
in class EdgeRealizer
b
- Bend to be removedprotected byte calculatePath(java.awt.geom.Point2D sourceIntersectionOut, java.awt.geom.Point2D targetIntersectionOut)
calculatePath
in class EdgeRealizer
sourceIntersectionOut
- output parameter for the coordinates of the
source intersection point calculated by this method.targetIntersectionOut
- output parameter for the coordinates of the
target intersection point calculated by this method.
EdgeRealizer.PATH_UNCLIPPED
, EdgeRealizer.PATH_CLIPPED_AT_SOURCE
,
EdgeRealizer.PATH_CLIPPED_AT_TARGET
, or EdgeRealizer.PATH_CLIPPED_AT_SOURCE_AND_TARGET
EdgeRealizer.path
,
EdgeRealizer.isPathClippedAtSource()
,
EdgeRealizer.isPathClippedAtTarget()
public void calcUnionRect(java.awt.geom.Rectangle2D r)
calcUnionRect
in class EdgeRealizer
public boolean intersects(java.awt.geom.Rectangle2D box)
EdgeRealizer
intersects
in class EdgeRealizer
box
- The box that has to be checked on intersection with this edge.protected void paintHighlightedBends(java.awt.Graphics2D gfx)
paintHighlightedBends
in class EdgeRealizer
public void write(java.io.ObjectOutputStream out) throws java.io.IOException
GraphML format
instead.
write
in class EdgeRealizer
java.io.IOException
public void read(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
GraphML format
instead.
write(ObjectOutputStream)
method.
read
in class EdgeRealizer
java.io.IOException
java.lang.ClassNotFoundException
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |