public abstract class AbstractConnector extends AbstractFigure implements Connector
Constructor and Description |
---|
AbstractConnector(Site tail,
Site head)
Create a new connector between the given sites.
|
Modifier and Type | Method and Description |
---|---|
java.awt.geom.Rectangle2D |
getBounds()
Get the bounding box of this connector.
|
float[] |
getDashArray()
Get the dash array.
|
ConnectorEnd |
getHeadEnd()
Get the object drawn at the head end of the connector, if there
is one.
|
Site |
getHeadSite()
Get the site that marks the "head" of the connector.
|
LabelFigure |
getLabelFigure()
Get the figure that displays this connector's label.
|
float |
getLineWidth()
Get the line width of this figure.
|
java.awt.Shape |
getShape()
Get the outline shape of this connector.
|
java.awt.Stroke |
getStroke()
Get the stroke of this connector.
|
java.awt.Paint |
getStrokePaint()
Get the stroke paint pattern of this connector.
|
ConnectorEnd |
getTailEnd()
Get the object drawn at the tail end of the connector, if there
is one.
|
Site |
getTailSite()
Get the site that marks the "tail" of the connector.
|
void |
headMoved()
Inform the connector that the head site has moved.
|
boolean |
hit(java.awt.geom.Rectangle2D r)
Test if this connector is hit by the given rectangle.
|
boolean |
intersects(java.awt.geom.Rectangle2D r)
Test if this connector intersects the given rectangle.
|
void |
paint(java.awt.Graphics2D g)
Paint the connector.
|
abstract void |
repositionLabel()
Tell the connector to reposition its label if it has one.
|
void |
reroute()
Tell the connector to re-route itself.
|
abstract void |
route()
Tell the connector to route itself completely,
using all available information.
|
void |
setDashArray(float[] dashArray)
Set the dash array of the stroke.
|
void |
setHeadEnd(ConnectorEnd e)
Set the object drawn at the head end of the connector.
|
void |
setHeadSite(Site s)
Set the site that marks the "head" of the connector,
and call headMoved();
|
void |
setLabelFigure(LabelFigure label)
Set the LabelFigure of this connector.
|
void |
setLineWidth(float lineWidth)
Set the line width.
|
protected void |
setShape(java.awt.Shape s)
Set the shape, for subclasses only.
|
void |
setStroke(java.awt.Stroke s)
Set the stroke of this connector.
|
void |
setStrokePaint(java.awt.Paint p)
Set the stroke paint pattern of this connector.
|
void |
setTailEnd(ConnectorEnd e)
Set the object drawn at the tail end of the connector.
|
void |
setTailSite(Site s)
Set the site that marks the "tail" of the connector.
|
void |
tailMoved()
Inform the connector that the tail site has moved.
|
void |
transform(java.awt.geom.AffineTransform at)
Transform the connector.
|
abstract void |
translate(double x,
double y)
Translate the connector.
|
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
public java.awt.geom.Rectangle2D getBounds()
getBounds
in interface Figure
getBounds
in class AbstractFigure
public float[] getDashArray()
public ConnectorEnd getHeadEnd()
public Site getHeadSite()
getHeadSite
in interface Connector
public LabelFigure getLabelFigure()
public float getLineWidth()
public ConnectorEnd getTailEnd()
public java.awt.Shape getShape()
getShape
in interface Figure
getShape
in class AbstractFigure
public java.awt.Stroke getStroke()
public java.awt.Paint getStrokePaint()
public Site getTailSite()
getTailSite
in interface Connector
public void headMoved()
public boolean hit(java.awt.geom.Rectangle2D r)
hit
in interface Figure
hit
in class AbstractFigure
r
- The rectangle to be checked.public boolean intersects(java.awt.geom.Rectangle2D r)
intersects
in interface Figure
intersects
in class AbstractFigure
r
- The rectangle to be checked.public void paint(java.awt.Graphics2D g)
paint
in interface VisibleComponent
paint
in class AbstractFigure
g
- The 2D graphics object that this object
it to be painted upon.public abstract void repositionLabel()
public void reroute()
public abstract void route()
public void setDashArray(float[] dashArray)
public void setHeadEnd(ConnectorEnd e)
public void setHeadSite(Site s)
setHeadSite
in interface Connector
public void setLabelFigure(LabelFigure label)
public void setLineWidth(float lineWidth)
protected void setShape(java.awt.Shape s)
public void setStroke(java.awt.Stroke s)
public void setStrokePaint(java.awt.Paint p)
public void setTailEnd(ConnectorEnd e)
public void setTailSite(Site s)
setTailSite
in interface Connector
public void tailMoved()
public void transform(java.awt.geom.AffineTransform at)
transform
in interface Figure
transform
in class AbstractFigure
at
- The transform to be used.public abstract void translate(double x, double y)
translate
in interface Figure
translate
in class AbstractFigure
x
- The x value to be moved.y
- The y value to be moved.