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 |
---|---|
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 display's this connector's label.
|
float |
getLineWidth()
Get the line width of this figure.
|
Shape |
getShape()
Get the outline shape of this connector.
|
Stroke |
getStroke()
Get the stroke of this connector.
|
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(double dx,
double dy)
Inform the connector that the head site has moved.
|
boolean |
hit(Rectangle2D r)
Test if this connector is hit by the given rectangle.
|
boolean |
intersects(Rectangle2D r)
Test if this connector intersects the given rectangle.
|
void |
paint(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(Shape s)
Set the shape, for subclasses only.
|
void |
setStroke(Stroke s)
Set the stroke of this connector.
|
void |
setStrokePaint(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(double dx,
double dy)
Inform the connector that the tail site has moved.
|
void |
transform(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 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 Shape getShape()
getShape
in interface Figure
getShape
in class AbstractFigure
public Stroke getStroke()
public Paint getStrokePaint()
public Site getTailSite()
getTailSite
in interface Connector
public void headMoved(double dx, double dy)
public boolean hit(Rectangle2D r)
hit
in interface Figure
hit
in class AbstractFigure
public boolean intersects(Rectangle2D r)
intersects
in interface Figure
intersects
in class AbstractFigure
public void paint(Graphics2D g)
paint
in interface VisibleComponent
paint
in class AbstractFigure
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(Shape s)
public void setStroke(Stroke s)
public void setStrokePaint(Paint p)
public void setTailEnd(ConnectorEnd e)
public void setTailSite(Site s)
setTailSite
in interface Connector
public void tailMoved(double dx, double dy)
public void transform(AffineTransform at)
transform
in interface Figure
transform
in class AbstractFigure
public abstract void translate(double x, double y)
translate
in interface Figure
translate
in class AbstractFigure
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.