public class FlexibleRotatableLocator
extends org.eclipse.draw2d.AbstractLocator
RotatableDecoration
or a non-rotatable IFigure on a Connection
. The location is
determined using a relative distance on the connection (e.g. "0.5" is the
middle of the connection) and/or using an absolute distance on the connection
(e.g. "100" is 100 pixel from the anchor).Constructor and Description |
---|
FlexibleRotatableLocator(org.eclipse.draw2d.Connection connection,
boolean distanceToStart,
double relativeDistance,
int absoluteDistance,
double rotateDegrees)
Creates a new FlexibleRotabableLocator.
|
Modifier and Type | Method and Description |
---|---|
int |
getAbsoluteDistance()
Returns the absolute distance of the location to the start/end-point.
|
boolean |
getDistanceToStart()
Returns true, if the distance values (see
getRelativeDistance()
and getAbsoluteDistance() ) refer to the start point of the
connection. |
double |
getRelativeDistance()
Returns the relative distance of the location to the start/end-point.
|
double |
getRotateDegrees()
Returns the degrees, around which the figure shall be rotated, if it is a
RotatableDecoration.
|
void |
relocate(org.eclipse.draw2d.IFigure target)
Rotates the figure, if it is a RotatableDecoration.
|
void |
setAbsoluteDistance(int absoluteDistance)
Sets the absolute distance of the location to the start/end-point.
|
void |
setDistanceToStart(boolean distanceToStart)
Sets, If the distance values refer to the start-point or the end-point.
|
void |
setRelativeDistance(double relativeDistance)
Sets the relative distance of the location to the start/end-point.
|
void |
setRotateDegrees(double rotateDegrees)
Sets the degrees, around which the figure shall be rotated, if it is a
RotatableDecoration.
|
public FlexibleRotatableLocator(org.eclipse.draw2d.Connection connection, boolean distanceToStart, double relativeDistance, int absoluteDistance, double rotateDegrees)
connection
- The connection, as described in getConnection()
.distanceToStart
- If the distance values refer to the start-point or the
end-point. See getDistanceToStart()
.relativeDistance
- The relative distance, as described in
getRelativeDistance()
.absoluteDistance
- The absolute distance, as described in
getAbsoluteDistance()
.rotateDegrees
- The degrees to rotate, as described in
getRotateDegrees()
.public final boolean getDistanceToStart()
getRelativeDistance()
and getAbsoluteDistance()
) refer to the start point of the
connection. Returns false, if the distance values refer to the end point
of the connection. For example if a relative and absolute distance are
"0", then returning true will place the location on the start point and
returning false on the end point.public final void setDistanceToStart(boolean distanceToStart)
getDistanceToStart()
.distanceToStart
- If true, the distance values refer to the start-point.public final double getRelativeDistance()
getAbsoluteDistance()
,
getDistanceToStart()
public final void setRelativeDistance(double relativeDistance)
getRelativeDistance()
.relativeDistance
- The relative distance of the location to the start/end-point.public final int getAbsoluteDistance()
getRelativeDistance()
,
getDistanceToStart()
public final void setAbsoluteDistance(int absoluteDistance)
getAbsoluteDistance()
.absoluteDistance
- The absolute distance of the location to the start/end-point.public final double getRotateDegrees()
public final void setRotateDegrees(double rotateDegrees)
getRotateDegrees()
.rotateDegrees
- The degrees, around which the figure shall be rotated, if it
is a RotatableDecoration.public void relocate(org.eclipse.draw2d.IFigure target)
relocate
in interface org.eclipse.draw2d.Locator
relocate
in class org.eclipse.draw2d.AbstractLocator
target
- The figure to rotate.