|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
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.
Red |
Field Summary | |
---|---|
private java.awt.geom.Arc2D |
_arc
The arc shape that defines the connector shape |
private double |
_centerX
The calculated parameters of the arc |
private double |
_centerY
|
protected static double |
_CLOSE_THRESHOLD
The threshold for when a source and a destination of an arc are considered close to one another. |
private double |
_exitAngle
The exit angle of the arc. |
private double |
_extentAngle
|
private double |
_gamma
The angle between the two ends of the arc. |
private ArcMidpointSite |
_midpointSite
The midpoint site. |
private double |
_previousAngle
The previous exit angle of the arc. |
private double |
_radius
|
private boolean |
_selfloop
The flag that says whether this connector is a "self-loop" |
private double |
_startAngle
|
private static double |
MINSELFLOOPANGLE
|
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. |
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. |
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 |
---|
private static double MINSELFLOOPANGLE
private java.awt.geom.Arc2D _arc
private boolean _selfloop
private double _exitAngle
private double _previousAngle
private double _centerX
private double _centerY
private double _radius
private double _startAngle
private double _extentAngle
private double _gamma
protected static final double _CLOSE_THRESHOLD
private ArcMidpointSite _midpointSite
Constructor Detail |
---|
public ArcConnector(Site tail, Site head)
Method Detail |
---|
public double getAngle()
public double getGamma()
public java.awt.geom.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 All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |