public class ArcConnector extends AbstractConnector
Currently, only the first is supported.
The connector uses an instance of PaintedPath to draw itself, so see that class for a more detailed description of the paint- and stroke-related methods.
Modifier and Type | Field and Description |
---|---|
protected static double |
_CLOSE_THRESHOLD
The threshold for when a source and a destination of an arc
are considered close to one another.
|
Constructor and Description |
---|
ArcConnector(Site tail,
Site head)
Create a new arc connector between the given
sites.
|
Modifier and Type | Method and Description |
---|---|
double |
getAngle()
Get the angle at which the arc leaves the tail figure.
|
java.awt.geom.Point2D |
getArcMidpoint()
Return the midpoint of the arc.
|
double |
getGamma()
Get the angle that determines the orientation of a
self-loop.
|
Site |
getMidpointSite()
Get the site that marks the midpoint of the connector.
|
boolean |
getSelfLoop()
Get the flag saying whether this arc is to be drawn as a self-loop.
|
void |
repositionLabel()
Tell the connector to reposition its label if it has one.
|
void |
route()
Tell the connector to route itself between the
current positions of the head and tail sites.
|
void |
setAngle(double angle)
Set the angle at which the arc leaves the tail figure, in
radians.
|
void |
setGamma(double gamma)
Set the angle that determines the orientation of a self-loop.
|
void |
setSelfLoop(boolean selfloop)
Set the flag that says that this arc is drawn as a "self-loop."
|
void |
translate(double x,
double y)
Translate the connector.
|
void |
translateMidpoint(double dx,
double dy)
Translate the midpoint of the arc.
|
getBounds, getDashArray, getHeadEnd, getHeadSite, getLabelFigure, getLineWidth, getShape, getStroke, getStrokePaint, getTailEnd, getTailSite, headMoved, hit, intersects, paint, reroute, setDashArray, setHeadEnd, setHeadSite, setLabelFigure, setLineWidth, setShape, setStroke, setStrokePaint, setTailEnd, setTailSite, tailMoved, transform
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, getTransformContext, getUserObject, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, setInteractor, setParent, setToolTipText
isVisible, paint, setVisible
getTransformContext, repaint, repaint
getUserObject, setUserObject
protected static final double _CLOSE_THRESHOLD
public double getAngle()
setAngle(double)
public double getGamma()
setGamma(double)
public java.awt.geom.Point2D getArcMidpoint()
public Site getMidpointSite()
public boolean getSelfLoop()
setSelfLoop(boolean)
public void repositionLabel()
repositionLabel
in class AbstractConnector
public void route()
route
in interface Connector
route
in class AbstractConnector
public void setAngle(double angle)
angle
- The anglegetAngle()
public void setGamma(double gamma)
gamma
- The gammagetGamma()
public void setSelfLoop(boolean selfloop)
selfloop
- true if this is a self-loop.getSelfLoop()
public void translate(double x, double y)
translate
in interface Figure
translate
in class AbstractConnector
x
- The x value to be moved.y
- The y value to be moved.public void translateMidpoint(double dx, double dy)
dx
- The x value to transformdy
- The y value to transform