|
|||||||||
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
public abstract class AbstractConnector
An abstract implementation of Connector. The implementation provides default implementations of all routing methods except for route(). It also provides a set of methods for setting the appearance of the connector, such as line width, dashes, and color. To do so, it uses an instance of PaintedPath, so see that class for a more detailed description of the paint- and stroke-related methods.
Field Summary | |
---|---|
private ConnectorEnd |
_headEnd
The head end |
private Site |
_headSite
The head site |
private LabelFigure |
_labelFigure
The label figure |
private java.awt.Paint |
_paint
The stroke paint. |
private java.awt.Shape |
_shape
The shape that we use to draw the connector. |
private java.awt.Stroke |
_stroke
The stroke. |
private ConnectorEnd |
_tailEnd
The tail end |
private Site |
_tailSite
The tail site |
Constructor Summary | |
---|---|
AbstractConnector(Site tail,
Site head)
Create a new connector between the given sites. |
Method Summary | |
---|---|
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 display's 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. |
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 ConnectorEnd _headEnd
private ConnectorEnd _tailEnd
private Site _headSite
private Site _tailSite
private LabelFigure _labelFigure
private java.awt.Shape _shape
private java.awt.Stroke _stroke
private java.awt.Paint _paint
Constructor Detail |
---|
public AbstractConnector(Site tail, Site head)
Method Detail |
---|
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()
headMoved
in interface Connector
public boolean hit(java.awt.geom.Rectangle2D r)
hit
in interface Figure
hit
in class AbstractFigure
public boolean intersects(java.awt.geom.Rectangle2D r)
intersects
in interface Figure
intersects
in class AbstractFigure
public void paint(java.awt.Graphics2D g)
paint
in interface VisibleComponent
paint
in class AbstractFigure
public abstract void repositionLabel()
public void reroute()
reroute
in interface Connector
public abstract void route()
route
in interface Connector
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()
tailMoved
in interface Connector
public void transform(java.awt.geom.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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |