public class ConnectionLocator extends AbstractLocator
Figure
attached to a Connection
when the
Connection is moved. Provides for alignment at the start (source), middle, or
end (target) of the Connection.Modifier and Type | Field and Description |
---|---|
static int |
END
Deprecated.
Use
TARGET |
static int |
MIDDLE
The middle of the Connection
|
static int |
MIDPOINT
Deprecated.
Use
MIDDLE instead, since the location is not the
midpoint of a line-segment, but the middle of a polyline. |
static int |
SOURCE
The start (or source) of the Connection
|
static int |
START
Deprecated.
Use
SOURCE |
static int |
TARGET
The end (or target) of the Connection
|
Constructor and Description |
---|
ConnectionLocator(Connection connection)
Constructs a ConnectionLocator with the passed connection and
MIDDLE alignment. |
ConnectionLocator(Connection connection,
int align)
Constructs a ConnectionLocator with the passed Connection and alignment.
|
Modifier and Type | Method and Description |
---|---|
int |
getAlignment()
Returns the alignment of ConnectionLocator.
|
protected Connection |
getConnection()
Returns connection associated with ConnectionLocator.
|
protected Point |
getLocation(PointList points)
Returns a point from the passed PointList, dependent on
ConnectionLocator's alignment.
|
protected Point |
getReferencePoint()
Returns ConnectionLocator's reference point in absolute coordinates.
|
protected void |
setAlignment(int align)
Sets the alignment.
|
protected void |
setConnection(Connection connection)
Sets the Connection to be associated with this ConnectionLocator.
|
getGap, getNewBounds, getRelativePosition, relocate, setGap, setRelativePosition
public static final int START
SOURCE
public static final int SOURCE
public static final int END
TARGET
public static final int TARGET
public static final int MIDPOINT
MIDDLE
instead, since the location is not the
midpoint of a line-segment, but the middle of a polyline.public static final int MIDDLE
public ConnectionLocator(Connection connection)
MIDDLE
alignment.connection
- The Connectionpublic ConnectionLocator(Connection connection, int align)
SOURCE
,
MIDDLE
, and TARGET
.connection
- The Connectionalign
- The alignmentpublic int getAlignment()
protected Connection getConnection()
protected Point getReferencePoint()
getReferencePoint
in class AbstractLocator
protected Point getLocation(PointList points)
SOURCE
, it
returns the first point in points. If TARGET
, it returns
the last point in points. If MIDDLE
, it returns the
middle of line represented by points.points
- The points in the Connectionprotected void setAlignment(int align)
align
- The alignmentprotected void setConnection(Connection connection)
connection
- The ConnectionCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.