public final class RelativePosition extends Object
Constructor and Description |
---|
RelativePosition(Angle rotation,
HorizontalAlignment horizontalAlignment,
VerticalAlignment verticalAlignment,
double offsetX,
double offsetY)
Creates a new
RelativePosition with the given values. |
RelativePosition(RelativePosition other) |
Modifier and Type | Method and Description |
---|---|
static RelativePosition |
center()
Returns a
RelativePosition located on the anchor point with no offset. |
static RelativePosition |
east(double offset)
Returns a
RelativePosition located to the east of the anchor point with the given offset. |
boolean |
equals(Object other) |
HorizontalAlignment |
getHorizontalAlignment()
the horizontal alignment of this
RelativePosition . |
double |
getOffsetX()
the horizontal offset, expressed in pixels and relative to the anchor point.
|
double |
getOffsetY()
the vertical offset, expressed in pixels and relative to the anchor point.
|
Angle |
getRotation()
the rotation around the anchor point.
|
VerticalAlignment |
getVerticalAlignment()
the vertical alignment of this
RelativePosition . |
int |
hashCode() |
static RelativePosition |
north(double offset)
Returns a
RelativePosition located to the north of the anchor point with the given offset. |
static RelativePosition |
northEast(double offsetNorth,
double offsetEast)
Returns a
RelativePosition located to the north-east of the anchor point with the given offsets. |
static RelativePosition |
northWest(double offsetNorth,
double offsetWest)
Returns a
RelativePosition located to the north-west of the anchor point with the given offsets. |
static RelativePosition |
south(double offset)
Returns a
RelativePosition located to the south of the anchor point with the given offset. |
static RelativePosition |
southEast(double offsetSouth,
double offsetEast)
Returns a
RelativePosition located to the south-east of the anchor point with the given offsets. |
static RelativePosition |
southWest(double offsetSouth,
double offsetWest)
Returns a
RelativePosition located to the south-west of the anchor point with the given offsets. |
static RelativePosition |
west(double offset)
Returns a
RelativePosition located to the west of the anchor point with the given offset. |
public RelativePosition(@NotNull Angle rotation, @NotNull HorizontalAlignment horizontalAlignment, @NotNull VerticalAlignment verticalAlignment, double offsetX, double offsetY)
RelativePosition
with the given values.rotation
- the rotation around the anchor point.horizontalAlignment
- the horizontal alignment of this RelativePosition
.verticalAlignment
- the vertical alignment of this RelativePosition
.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.public RelativePosition(@NotNull RelativePosition other)
@NotNull public static RelativePosition north(double offset)
RelativePosition
located to the north of the anchor point with the given offset.offset
- : the vertical offset, expressed in pixels and relative to the anchor point.@NotNull public static RelativePosition east(double offset)
RelativePosition
located to the east of the anchor point with the given offset.offset
- : the horizontal offset, expressed in pixels and relative to the anchor point.@NotNull public static RelativePosition south(double offset)
RelativePosition
located to the south of the anchor point with the given offset.offset
- : the vertical offset, expressed in pixels and relative to the anchor point.@NotNull public static RelativePosition west(double offset)
RelativePosition
located to the west of the anchor point with the given offset.offset
- : the horizontal offset, expressed in pixels and relative to the anchor point.@NotNull public static RelativePosition northEast(double offsetNorth, double offsetEast)
RelativePosition
located to the north-east of the anchor point with the given offsets.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.@NotNull public static RelativePosition northWest(double offsetNorth, double offsetWest)
RelativePosition
located to the north-west of the anchor point with the given offsets.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.@NotNull public static RelativePosition southEast(double offsetSouth, double offsetEast)
RelativePosition
located to the south-east of the anchor point with the given offsets.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.@NotNull public static RelativePosition southWest(double offsetSouth, double offsetWest)
RelativePosition
located to the south-west of the anchor point with the given offsets.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.@NotNull public static RelativePosition center()
RelativePosition
located on the anchor point with no offset.@NotNull public Angle getRotation()
@NotNull public HorizontalAlignment getHorizontalAlignment()
RelativePosition
.@NotNull public VerticalAlignment getVerticalAlignment()
RelativePosition
.public double getOffsetX()
public double getOffsetY()