Package com.luciad.drawing
Class RelativePosition
java.lang.Object
com.luciad.drawing.RelativePosition
Describes a position relative to an anchor, with a rotation, alignment and offset.
-
Constructor Summary
ConstructorDescriptionRelativePosition
(Angle rotation, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, double offsetX, double offsetY) Creates a newRelativePosition
with the given values.RelativePosition
(RelativePosition other) -
Method Summary
Modifier and TypeMethodDescriptionstatic RelativePosition
center()
Returns aRelativePosition
located on the anchor point with no offset.static RelativePosition
east
(double offset) Returns aRelativePosition
located to the east of the anchor point with the given offset.boolean
the horizontal alignment of thisRelativePosition
.double
the horizontal offset, expressed in pixels and relative to the anchor point.double
the vertical offset, expressed in pixels and relative to the anchor point.the rotation around the anchor point.the vertical alignment of thisRelativePosition
.int
hashCode()
static RelativePosition
north
(double offset) Returns aRelativePosition
located to the north of the anchor point with the given offset.static RelativePosition
northEast
(double offsetNorth, double offsetEast) Returns aRelativePosition
located to the north-east of the anchor point with the given offsets.static RelativePosition
northWest
(double offsetNorth, double offsetWest) Returns aRelativePosition
located to the north-west of the anchor point with the given offsets.static RelativePosition
south
(double offset) Returns aRelativePosition
located to the south of the anchor point with the given offset.static RelativePosition
southEast
(double offsetSouth, double offsetEast) Returns aRelativePosition
located to the south-east of the anchor point with the given offsets.static RelativePosition
southWest
(double offsetSouth, double offsetWest) Returns aRelativePosition
located to the south-west of the anchor point with the given offsets.static RelativePosition
west
(double offset) Returns aRelativePosition
located to the west of the anchor point with the given offset.
-
Constructor Details
-
RelativePosition
public RelativePosition(@NotNull Angle rotation, @NotNull HorizontalAlignment horizontalAlignment, @NotNull VerticalAlignment verticalAlignment, double offsetX, double offsetY) Creates a newRelativePosition
with the given values.- Parameters:
rotation
- the rotation around the anchor point.horizontalAlignment
- the horizontal alignment of thisRelativePosition
.verticalAlignment
- the vertical alignment of thisRelativePosition
.offsetX
- the horizontal offset, expressed in pixels and relative to the anchor point.offsetY
- the vertical offset, expressed in pixels and relative to the anchor point.
-
RelativePosition
-
-
Method Details
-
north
Returns aRelativePosition
located to the north of the anchor point with the given offset.- Parameters:
offset
- : the vertical offset, expressed in pixels and relative to the anchor point.
-
east
Returns aRelativePosition
located to the east of the anchor point with the given offset.- Parameters:
offset
- : the horizontal offset, expressed in pixels and relative to the anchor point.
-
south
Returns aRelativePosition
located to the south of the anchor point with the given offset.- Parameters:
offset
- : the vertical offset, expressed in pixels and relative to the anchor point.
-
west
Returns aRelativePosition
located to the west of the anchor point with the given offset.- Parameters:
offset
- : the horizontal offset, expressed in pixels and relative to the anchor point.
-
northEast
Returns aRelativePosition
located to the north-east of the anchor point with the given offsets.- Parameters:
offsetNorth
- : the vertical offset, expressed in pixels and relative to the anchor point.offsetEast
- : the horizontal offset, expressed in pixels and relative to the anchor point.
-
northWest
Returns aRelativePosition
located to the north-west of the anchor point with the given offsets.- Parameters:
offsetNorth
- : the vertical offset, expressed in pixels and relative to the anchor point.offsetWest
- : the horizontal offset, expressed in pixels and relative to the anchor point.
-
southEast
Returns aRelativePosition
located to the south-east of the anchor point with the given offsets.- Parameters:
offsetSouth
- : the vertical offset, expressed in pixels and relative to the anchor point.offsetEast
- : the horizontal offset, expressed in pixels and relative to the anchor point.
-
southWest
Returns aRelativePosition
located to the south-west of the anchor point with the given offsets.- Parameters:
offsetSouth
- : the vertical offset, expressed in pixels and relative to the anchor point.offsetWest
- : the horizontal offset, expressed in pixels and relative to the anchor point.
-
center
Returns aRelativePosition
located on the anchor point with no offset. -
getRotation
the rotation around the anchor point. -
getHorizontalAlignment
the horizontal alignment of thisRelativePosition
. -
getVerticalAlignment
the vertical alignment of thisRelativePosition
. -
getOffsetX
public double getOffsetX()the horizontal offset, expressed in pixels and relative to the anchor point. -
getOffsetY
public double getOffsetY()the vertical offset, expressed in pixels and relative to the anchor point. -
equals
-
hashCode
public int hashCode()
-