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
ConstructorsConstructorDescriptionRelativePosition(Angle rotation, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, double offsetX, double offsetY) Creates a newRelativePositionwith the given values.RelativePosition(RelativePosition other) -
Method Summary
Modifier and TypeMethodDescriptionstatic RelativePositioncenter()Returns aRelativePositionlocated on the anchor point with no offset.static RelativePositioneast(double offset) Returns aRelativePositionlocated to the east of the anchor point with the given offset.booleanthe horizontal alignment of thisRelativePosition.doublethe horizontal offset, expressed in pixels and relative to the anchor point.doublethe vertical offset, expressed in pixels and relative to the anchor point.the rotation around the anchor point.the vertical alignment of thisRelativePosition.inthashCode()static RelativePositionnorth(double offset) Returns aRelativePositionlocated to the north of the anchor point with the given offset.static RelativePositionnorthEast(double offsetNorth, double offsetEast) Returns aRelativePositionlocated to the north-east of the anchor point with the given offsets.static RelativePositionnorthWest(double offsetNorth, double offsetWest) Returns aRelativePositionlocated to the north-west of the anchor point with the given offsets.static RelativePositionsouth(double offset) Returns aRelativePositionlocated to the south of the anchor point with the given offset.static RelativePositionsouthEast(double offsetSouth, double offsetEast) Returns aRelativePositionlocated to the south-east of the anchor point with the given offsets.static RelativePositionsouthWest(double offsetSouth, double offsetWest) Returns aRelativePositionlocated to the south-west of the anchor point with the given offsets.static RelativePositionwest(double offset) Returns aRelativePositionlocated 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 newRelativePositionwith 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 aRelativePositionlocated 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 aRelativePositionlocated 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 aRelativePositionlocated 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 aRelativePositionlocated 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 aRelativePositionlocated 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 aRelativePositionlocated 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 aRelativePositionlocated 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 aRelativePositionlocated 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 aRelativePositionlocated 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()
-