public interface Connector
extends java.lang.Cloneable, java.io.Serializable
ConnectionFigure
on a connected figure.
A connector is created and owned by a Figure
.
A connector knows its owning figure. A connector has bounds which describe
the area of the figure it is responsible for. A connector can be drawn, so
that users can see the bounds of the connector.
Framework
Two figures can be connected using a connection figure. The location of
the start or end point of the connection is handled by a connector object
at each connected figure.
Contract: Figure
,
ConnectionFigure
,
Connector
.
Strategy
The location of the start and end points of a connection figure are determined
by Connector
s which are owned by the connected figures.
Context: Figure
, ConnectionFigure
; Strategy: Connector
.
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns a clone of the Connection.
|
boolean |
contains(java.awt.geom.Point2D.Double p)
Tests if a point is contained in the connector.
|
void |
draw(java.awt.Graphics2D g)
Draws the connector.
|
java.awt.geom.Point2D.Double |
findEnd(ConnectionFigure connection)
Finds the end point for the connection.
|
java.awt.geom.Point2D.Double |
findStart(ConnectionFigure connection)
Finds the start point for the connection.
|
java.awt.geom.Point2D.Double |
getAnchor()
Gets the anchor of the connector.
|
java.awt.geom.Rectangle2D.Double |
getBounds()
Gets the bounds of the connector.
|
java.awt.geom.Rectangle2D.Double |
getDrawingArea()
Gets the drawing area of the connector.
|
Figure |
getOwner()
Gets the connector's owner.
|
void |
updateAnchor(java.awt.geom.Point2D.Double p)
Updates the anchor of the connector.
|
java.awt.geom.Point2D.Double findStart(ConnectionFigure connection)
java.awt.geom.Point2D.Double findEnd(ConnectionFigure connection)
Figure getOwner()
java.awt.geom.Point2D.Double getAnchor()
java.awt.geom.Rectangle2D.Double getBounds()
void updateAnchor(java.awt.geom.Point2D.Double p)
boolean contains(java.awt.geom.Point2D.Double p)
java.lang.Object clone()
java.awt.geom.Rectangle2D.Double getDrawingArea()
void draw(java.awt.Graphics2D g)