|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.AbstractFigure
diva.canvas.connector.AbstractConnector
diva.canvas.connector.ArcConnector
public class ArcConnector
A Connector that draws itself in an arc. The connector draws itself approximately through the center of the figures that own the sites to which it is connected. The curvature of the arc can be specified in one of two ways, depending on which variable of the arc's shape remain constant as the distance between the two figures at the ends of the arc is varied:
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.
Field Summary | |
---|---|
protected static double |
_CLOSE_THRESHOLD
The threshold for when a source and a destination of an arc are considered close to one another. |
Constructor Summary | |
---|---|
ArcConnector(Site tail,
Site head)
Create a new arc connector between the given sites. |
Method Summary | |
---|---|
double |
getAngle()
Get the angle at which the arc leaves the tail figure. |
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." Apart from changing (slightly) the way the arc geometry is determined, this method resets some internal variables so that the arc doesn't get into a "funny state" when switching between self-loops and non-self-loops. |
void |
translate(double x,
double y)
Translate the connector. |
void |
translateMidpoint(double dx,
double dy)
Translate the midpoint of the arc. |
Methods inherited from class diva.canvas.connector.AbstractConnector |
---|
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 |
Methods inherited from class diva.canvas.AbstractFigure |
---|
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, getTransformContext, getUserObject, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface diva.canvas.Figure |
---|
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, setInteractor, setParent, setToolTipText |
Methods inherited from interface diva.canvas.VisibleComponent |
---|
isVisible, paint, setVisible |
Methods inherited from interface diva.canvas.CanvasComponent |
---|
getTransformContext, repaint, repaint |
Methods inherited from interface diva.util.UserObjectContainer |
---|
getUserObject, setUserObject |
Field Detail |
---|
protected static double _CLOSE_THRESHOLD
Constructor Detail |
---|
public ArcConnector(Site tail, Site head)
Method Detail |
---|
public double getAngle()
public double getGamma()
public Point2D getArcMidpoint()
public Site getMidpointSite()
public boolean getSelfLoop()
public void repositionLabel()
repositionLabel
in class AbstractConnector
public void route()
route
in interface Connector
route
in class AbstractConnector
public void setAngle(double angle)
public void setGamma(double gamma)
public void setSelfLoop(boolean selfloop)
public void translate(double x, double y)
translate
in interface Figure
translate
in class AbstractConnector
public void translateMidpoint(double dx, double dy)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |