public final class PAreasL
extends java.lang.Object
Functions over areas.
These functions operate using the concepts of minimum-x, maximum-x, minimum-y, and maximum-y edges. It is up to individual applications to assign meaning to these edges such as "left" for minimum-x and "top" for minimum-y.
| Modifier and Type | Method | Description |
|---|---|---|
static <S> PAreaL<S> |
alignCenter(PAreaL<S> outer,
PAreaL<S> inner) |
Align the area
inner such that the center of the area is equal to
the center of outer. |
static <S> PAreaL<S> |
alignHorizontallyCenter(PAreaL<S> outer,
PAreaL<S> inner) |
Deprecated.
|
static <S> PAreaL<S> |
alignHorizontallyMaxX(PAreaL<S> outer,
PAreaL<S> inner) |
Deprecated.
|
static <S> PAreaL<S> |
alignHorizontallyMaxXOffset(PAreaL<S> outer,
PAreaL<S> inner,
long offset) |
Deprecated.
|
static <S> PAreaL<S> |
alignHorizontallyMinX(PAreaL<S> outer,
PAreaL<S> inner) |
Deprecated.
|
static <S> PAreaL<S> |
alignHorizontallyMinXOffset(PAreaL<S> outer,
PAreaL<S> inner,
long offset) |
Deprecated.
|
static <S> PAreaL<S> |
alignMaxYMaxX(PAreaL<S> outer,
PAreaL<S> inner) |
Equivalent to calling
alignMaxYMaxXOffset(PAreaL, PAreaL,
long, long) with zero offsets. |
static <S> PAreaL<S> |
alignMaxYMaxXOffset(PAreaL<S> outer,
PAreaL<S> inner,
long offset_x,
long offset_y) |
Align the area
inner such that the maximum-y edge is at least
offset_y from the inside maximum-y edge of outer and the
maximum-x edge is at least offset_x from the inside maximum-x edge
of outer. |
static <S> PAreaL<S> |
alignMaxYMinX(PAreaL<S> outer,
PAreaL<S> inner) |
Equivalent to calling
alignMaxYMinXOffset(PAreaL, PAreaL,
long, long) with zero offsets. |
static <S> PAreaL<S> |
alignMaxYMinXOffset(PAreaL<S> outer,
PAreaL<S> inner,
long offset_x,
long offset_y) |
Align the area
inner such that the maximum-y edge is at least
offset_y from the inside maximum-y edge of outer and the
minimum-x edge is at least offset_x from the inside minimum-x edge
of outer. |
static <S> PAreaL<S> |
alignMinYMaxX(PAreaL<S> outer,
PAreaL<S> inner) |
Equivalent to calling
alignMinYMaxXOffset(PAreaL, PAreaL,
long, long) with zero offsets. |
static <S> PAreaL<S> |
alignMinYMaxXOffset(PAreaL<S> outer,
PAreaL<S> inner,
long offset_x,
long offset_y) |
Align the area
inner such that the minimum-y edge is at least
offset_y from the inside minimum-y edge of outer and the
maximum-x edge is at least offset_x from the inside maximum-x edge
of outer. |
static <S> PAreaL<S> |
alignMinYMinX(PAreaL<S> outer,
PAreaL<S> inner) |
Equivalent to calling
alignMinYMinXOffset(PAreaL, PAreaL,
long, long) with zero offsets. |
static <S> PAreaL<S> |
alignMinYMinXOffset(PAreaL<S> outer,
PAreaL<S> inner,
long offset_x,
long offset_y) |
Align the area
inner such that the minimum-y edge is at least
offset_y from the inside minimum-y edge of outer and the
minimum-x edge is at least offset_x from the inside minimum-x edge
of outer. |
static <S> PAreaL<S> |
alignOnXCenter(PAreaL<S> outer,
PAreaL<S> inner) |
Align the area
inner along the X axis in the center of outer. |
static <S> PAreaL<S> |
alignOnXMaxX(PAreaL<S> outer,
PAreaL<S> inner) |
Equivalent to calling
alignOnXMaxXOffset(PAreaL,
PAreaL, long) with a zero offset. |
static <S> PAreaL<S> |
alignOnXMaxXOffset(PAreaL<S> outer,
PAreaL<S> inner,
long offset) |
Align the area
inner along the X axis against the inside maximum-x edge
of outer. |
static <S> PAreaL<S> |
alignOnXMinX(PAreaL<S> outer,
PAreaL<S> inner) |
Equivalent to calling
alignOnXMinXOffset(PAreaL, PAreaL,
long) with a zero offset. |
static <S> PAreaL<S> |
alignOnXMinXOffset(PAreaL<S> outer,
PAreaL<S> inner,
long offset) |
Align the area
inner along the X axis against the inside minimum-x edge
of outer. |
static <S> PAreaL<S> |
alignOnYCenter(PAreaL<S> outer,
PAreaL<S> inner) |
Align the area
inner along the Y axis in the center of outer. |
static <S> PAreaL<S> |
alignOnYMaxY(PAreaL<S> outer,
PAreaL<S> inner) |
Equivalent to calling
alignOnYMaxYOffset(PAreaL, PAreaL,
long) with a zero offset. |
static <S> PAreaL<S> |
alignOnYMaxYOffset(PAreaL<S> outer,
PAreaL<S> inner,
long offset) |
Align the area
inner along the Y axis against the inside maximum-y edge
of outer. |
static <S> PAreaL<S> |
alignOnYMinY(PAreaL<S> outer,
PAreaL<S> inner) |
Equivalent to calling
alignOnYMinYOffset(PAreaL, PAreaL,
long) with a zero offset. |
static <S> PAreaL<S> |
alignOnYMinYOffset(PAreaL<S> outer,
PAreaL<S> inner,
long offset) |
Align the area
inner along the Y axis against the inside minimum-y edge
of outer. |
static <S> PAreaL<S> |
alignVerticallyCenter(PAreaL<S> outer,
PAreaL<S> inner) |
Deprecated.
|
static <S> PAreaL<S> |
alignVerticallyMaxY(PAreaL<S> outer,
PAreaL<S> inner) |
Deprecated.
|
static <S> PAreaL<S> |
alignVerticallyMaxYOffset(PAreaL<S> outer,
PAreaL<S> inner,
long offset) |
Deprecated.
|
static <S> PAreaL<S> |
alignVerticallyMinY(PAreaL<S> outer,
PAreaL<S> inner) |
Deprecated.
|
static <S> PAreaL<S> |
alignVerticallyMinYOffset(PAreaL<S> outer,
PAreaL<S> inner,
long offset) |
Deprecated.
|
static <S,T> PAreaL<T> |
cast(PAreaL<S> area) |
Brand a given area as belonging to a different coordinate space.
|
static <S> PAreaL<S> |
containing(PAreaL<S> a,
PAreaL<S> b) |
Construct a area that will contain both
a and b. |
static <S> boolean |
contains(PAreaL<S> a,
PAreaL<S> b) |
Determine whether or not one area contains another.
|
static <S> boolean |
containsPoint(PAreaL<S> a,
long x,
long y) |
Determine whether or not a area contains a given point.
|
static <S> boolean |
couldFitInside(PAreaL<S> a,
PAreaL<S> b) |
Determine whether or not one area could fit inside another.
|
static <S> PAreaL<S> |
create(long x,
long y,
long size_x,
long size_y) |
Create an area of size
size_x on the X axis and size size_y
on the Y axis, placing the minimum corner at (x, y). |
static <S> PAreaL<S> |
fitBetweenHorizontal(PAreaL<S> fit,
PAreaL<S> a,
PAreaL<S> b) |
Deprecated.
|
static <S> PAreaL<S> |
fitBetweenOnX(PAreaL<S> fit,
PAreaL<S> a,
PAreaL<S> b) |
Attempt to fit
fit between a and b, horizontally. |
static <S> PAreaL<S> |
fitBetweenOnY(PAreaL<S> fit,
PAreaL<S> a,
PAreaL<S> b) |
Attempt to fit
fit between a and b, vertically. |
static <S> PAreaL<S> |
fitBetweenVertical(PAreaL<S> fit,
PAreaL<S> a,
PAreaL<S> b) |
Deprecated.
|
static <S> PAreaL<S> |
hollowOut(PAreaL<S> outer,
long min_x_offset,
long max_x_offset,
long min_y_offset,
long max_y_offset) |
Construct a new area that fits inside
outer based on the given
offsets from each edge. |
static <S> PAreaL<S> |
hollowOutEvenly(PAreaL<S> outer,
long offset) |
Equivalent to calling
hollowOut(PAreaL, long, long,
long, long) with offset for all offset parameters. |
static <S> PAreaL<S> |
moveAbsolute(PAreaL<S> area,
long x,
long y) |
Move the given area to
(x, y). |
static <S> PAreaL<S> |
moveRelative(PAreaL<S> area,
long x,
long y) |
Move the given area by
(x, y). |
static <S> PAreaL<S> |
moveToOrigin(PAreaL<S> area) |
Move the given area to
(0, 0). |
static <S> boolean |
overlaps(PAreaL<S> a,
PAreaL<S> b) |
Determine whether or not two areas overlap.
|
static <S> PAreaL<S> |
scaleFromCenter(PAreaL<S> area,
long x_diff,
long y_diff) |
Scale
area by adding x_diff to the sizeX, and
y_diff to the sizeY. |
static <S> PAreaL<S> |
scaleFromMaxYMaxX(PAreaL<S> area,
long x_diff,
long y_diff) |
Scale
area by adding x_diff to the sizeX, and
y_diff to the sizeY. |
static <S> PAreaL<S> |
scaleFromMaxYMinX(PAreaL<S> area,
long x_diff,
long y_diff) |
Scale
area by adding x_diff to the sizeX, and
y_diff to the sizeY. |
static <S> PAreaL<S> |
scaleFromMinYMaxX(PAreaL<S> area,
long x_diff,
long y_diff) |
Scale
area by adding x_diff to the sizeX, and
y_diff to the sizeY. |
static <S> PAreaL<S> |
scaleFromMinYMinX(PAreaL<S> area,
long x_diff,
long y_diff) |
Scale
area by adding x_diff to the sizeX, and
y_diff to the sizeY. |
static <S> PAreaL<S> |
setSizeFromCenter(PAreaL<S> area,
long sizeX,
long sizeY) |
Set the sizeX and sizeY of
area to sizeX and
sizeY, respectively. |
static <S> PAreaL<S> |
setSizeFromMaxYMaxX(PAreaL<S> area,
long sizeX,
long sizeY) |
Set the sizeX and sizeY of
area to sizeX and
sizeY, respectively. |
static <S> PAreaL<S> |
setSizeFromMaxYMinX(PAreaL<S> area,
long sizeX,
long sizeY) |
Set the sizeX and sizeY of
area to sizeX and
sizeY, respectively. |
static <S> PAreaL<S> |
setSizeFromMinYMaxX(PAreaL<S> area,
long sizeX,
long sizeY) |
Set the sizeX and sizeY of
area to sizeX and
sizeY, respectively. |
static <S> PAreaL<S> |
setSizeFromMinYMinX(PAreaL<S> area,
long sizeX,
long sizeY) |
Set the sizeX and sizeY of
area to sizeX and
sizeY, respectively. |
static <S> java.lang.String |
show(PAreaL<S> area) |
|
static <S> java.lang.String |
showToBuilder(PAreaL<S> area,
java.lang.StringBuilder sb) |
|
static <S> PAreaSizeL<S> |
size(PAreaL<S> area) |
|
static <S> PAreaXSplitL<S,PAreaL<S>> |
splitAlongParallelToX(PAreaL<S> area,
long y) |
Split
area along a line parallel to the X axis placed at
y units from its own minimum-y edge. |
static <S> PAreaYSplitL<S,PAreaL<S>> |
splitAlongParallelToY(PAreaL<S> area,
long x) |
Split
area along a line parallel to the Y axis placed at
x units from its own minimum-x edge. |
static <S> PAreaXYSplitL<S,PAreaL<S>> |
splitAlongXY(PAreaL<S> area,
long x,
long y) |
Split
area along a two axis-aligned perpendicular lines that intercept at (x, y). |
public static <S> PAreaL<S> create(long x, long y, long size_x, long size_y)
size_x on the X axis and size size_y
on the Y axis, placing the minimum corner at (x, y).S - The coordinate space of the areasx - The X value of the minimum cornery - The Y value of the minimum cornersize_x - The size of the area on the X axissize_y - The size of the area on the Y axispublic static <S> boolean contains(PAreaL<S> a, PAreaL<S> b)
Determine whether or not one area contains another.
Containing is reflexive: contains(a, a) == true.
Containing is transitive: contains(a, b) \u2192 contains(b, c) \u2192
contains(a, c).
Containing is not necessarily symmetric.
S - The coordinate space of the areasa - Area Ab - Area Btrue iff a contains bpublic static <S> PAreaL<S> moveRelative(PAreaL<S> area, long x, long y)
(x, y).S - The coordinate space of the areaarea - The areax - The amount to move on the X axisy - The amount to move on the Y axispublic static <S> PAreaL<S> moveAbsolute(PAreaL<S> area, long x, long y)
(x, y).S - The coordinate space of the areaarea - The areax - The position to which to move on the X axisy - The position to which to move on the Y axispublic static <S> PAreaL<S> moveToOrigin(PAreaL<S> area)
(0, 0).S - The coordinate space of the areaarea - The areapublic static <S,T> PAreaL<T> cast(PAreaL<S> area)
S - The starting coordinate spaceT - The resulting coordinate spacearea - An areaarea@Deprecated public static <S> PAreaL<S> alignHorizontallyCenter(PAreaL<S> outer, PAreaL<S> inner)
alignOnXCenter(PAreaL, PAreaL)inner horizontally in the center of outer.S - The coordinate space of the areasouter - The outer areainner - The inner area@Deprecated public static <S> PAreaL<S> alignHorizontallyMinX(PAreaL<S> outer, PAreaL<S> inner)
alignOnXMinX(PAreaL, PAreaL)alignHorizontallyMinXOffset(PAreaL, PAreaL,
long) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner area@Deprecated public static <S> PAreaL<S> alignHorizontallyMinXOffset(PAreaL<S> outer, PAreaL<S> inner, long offset)
alignOnXMinXOffset(PAreaL, PAreaL, long)inner horizontally against the inside minimum-x edge
of outer. The area will be at least offset units from the
minimum-x edge.S - The coordinate space of the areasouter - The outer areainner - The inner areaoffset - The offset from the edge@Deprecated public static <S> PAreaL<S> alignHorizontallyMaxX(PAreaL<S> outer, PAreaL<S> inner)
alignOnXMaxX(PAreaL, PAreaL)alignHorizontallyMaxXOffset(PAreaL,
PAreaL, long) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner area@Deprecated public static <S> PAreaL<S> alignHorizontallyMaxXOffset(PAreaL<S> outer, PAreaL<S> inner, long offset)
alignOnXMaxXOffset(PAreaL, PAreaL, long)inner horizontally against the inside maximum-x edge
of outer. The area will be at least offset units from the
maximum-x edge.S - The coordinate space of the areasouter - The outer areainner - The inner areaoffset - The offset from the edge@Deprecated public static <S> PAreaL<S> alignVerticallyMinY(PAreaL<S> outer, PAreaL<S> inner)
alignOnYMinY(PAreaL, PAreaL)alignVerticallyMinYOffset(PAreaL, PAreaL,
long) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner area@Deprecated public static <S> PAreaL<S> alignVerticallyMinYOffset(PAreaL<S> outer, PAreaL<S> inner, long offset)
alignOnYMinYOffset(PAreaL, PAreaL, long)inner vertically against the inside minimum-y edge
of outer. The area will be at least offset units from the
minimum-y edge.S - The coordinate space of the areasouter - The outer areainner - The inner areaoffset - The offset from the edge@Deprecated public static <S> PAreaL<S> alignVerticallyMaxY(PAreaL<S> outer, PAreaL<S> inner)
alignOnYMaxY(PAreaL, PAreaL)alignVerticallyMaxYOffset(PAreaL, PAreaL,
long) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner area@Deprecated public static <S> PAreaL<S> alignVerticallyMaxYOffset(PAreaL<S> outer, PAreaL<S> inner, long offset)
alignOnYMaxYOffset(PAreaL, PAreaL, long)inner vertically against the inside maximum-y edge
of outer. The area will be at least offset units from the
maximum-y edge.S - The coordinate space of the areasouter - The outer areainner - The inner areaoffset - The offset from the edge@Deprecated public static <S> PAreaL<S> alignVerticallyCenter(PAreaL<S> outer, PAreaL<S> inner)
alignOnYCenter(PAreaL, PAreaL)inner vertically in the center of outer.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaL<S> alignOnXCenter(PAreaL<S> outer, PAreaL<S> inner)
inner along the X axis in the center of outer.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaL<S> alignOnXMinX(PAreaL<S> outer, PAreaL<S> inner)
alignOnXMinXOffset(PAreaL, PAreaL,
long) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaL<S> alignOnXMinXOffset(PAreaL<S> outer, PAreaL<S> inner, long offset)
inner along the X axis against the inside minimum-x edge
of outer. The area will be at least offset units from the
minimum-x edge.S - The coordinate space of the areasouter - The outer areainner - The inner areaoffset - The offset from the edgepublic static <S> PAreaL<S> alignOnXMaxX(PAreaL<S> outer, PAreaL<S> inner)
alignOnXMaxXOffset(PAreaL,
PAreaL, long) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaL<S> alignOnXMaxXOffset(PAreaL<S> outer, PAreaL<S> inner, long offset)
inner along the X axis against the inside maximum-x edge
of outer. The area will be at least offset units from the
maximum-x edge.S - The coordinate space of the areasouter - The outer areainner - The inner areaoffset - The offset from the edgepublic static <S> PAreaL<S> alignOnYMinY(PAreaL<S> outer, PAreaL<S> inner)
alignOnYMinYOffset(PAreaL, PAreaL,
long) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaL<S> alignOnYMinYOffset(PAreaL<S> outer, PAreaL<S> inner, long offset)
inner along the Y axis against the inside minimum-y edge
of outer. The area will be at least offset units from the
minimum-y edge.S - The coordinate space of the areasouter - The outer areainner - The inner areaoffset - The offset from the edgepublic static <S> PAreaL<S> alignOnYMaxY(PAreaL<S> outer, PAreaL<S> inner)
alignOnYMaxYOffset(PAreaL, PAreaL,
long) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaL<S> alignOnYMaxYOffset(PAreaL<S> outer, PAreaL<S> inner, long offset)
inner along the Y axis against the inside maximum-y edge
of outer. The area will be at least offset units from the
maximum-y edge.S - The coordinate space of the areasouter - The outer areainner - The inner areaoffset - The offset from the edgepublic static <S> PAreaL<S> alignOnYCenter(PAreaL<S> outer, PAreaL<S> inner)
inner along the Y axis in the center of outer.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaL<S> alignMinYMinX(PAreaL<S> outer, PAreaL<S> inner)
alignMinYMinXOffset(PAreaL, PAreaL,
long, long) with zero offsets.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaL<S> alignMinYMinXOffset(PAreaL<S> outer, PAreaL<S> inner, long offset_x, long offset_y)
inner such that the minimum-y edge is at least
offset_y from the inside minimum-y edge of outer and the
minimum-x edge is at least offset_x from the inside minimum-x edge
of outer.S - The coordinate space of the areasouter - The outer areainner - The inner areaoffset_x - The offset from the minimum-x edgeoffset_y - The offset from the minimum-y edgepublic static <S> PAreaL<S> alignMinYMaxX(PAreaL<S> outer, PAreaL<S> inner)
alignMinYMaxXOffset(PAreaL, PAreaL,
long, long) with zero offsets.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaL<S> alignMinYMaxXOffset(PAreaL<S> outer, PAreaL<S> inner, long offset_x, long offset_y)
inner such that the minimum-y edge is at least
offset_y from the inside minimum-y edge of outer and the
maximum-x edge is at least offset_x from the inside maximum-x edge
of outer.S - The coordinate space of the areasouter - The outer areainner - The inner areaoffset_x - The offset from the maximum-x edgeoffset_y - The offset from the minimum-y edgepublic static <S> PAreaL<S> alignMaxYMinX(PAreaL<S> outer, PAreaL<S> inner)
alignMaxYMinXOffset(PAreaL, PAreaL,
long, long) with zero offsets.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaL<S> alignMaxYMinXOffset(PAreaL<S> outer, PAreaL<S> inner, long offset_x, long offset_y)
inner such that the maximum-y edge is at least
offset_y from the inside maximum-y edge of outer and the
minimum-x edge is at least offset_x from the inside minimum-x edge
of outer.S - The coordinate space of the areasouter - The outer areainner - The inner areaoffset_x - The offset from the minimum-x edgeoffset_y - The offset from the maximum-y edgepublic static <S> PAreaL<S> alignMaxYMaxX(PAreaL<S> outer, PAreaL<S> inner)
alignMaxYMaxXOffset(PAreaL, PAreaL,
long, long) with zero offsets.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaL<S> alignMaxYMaxXOffset(PAreaL<S> outer, PAreaL<S> inner, long offset_x, long offset_y)
inner such that the maximum-y edge is at least
offset_y from the inside maximum-y edge of outer and the
maximum-x edge is at least offset_x from the inside maximum-x edge
of outer.S - The coordinate space of the areasouter - The outer areainner - The inner areaoffset_x - The offset from the maximum-x edgeoffset_y - The offset from the maximum-y edgepublic static <S> PAreaL<S> alignCenter(PAreaL<S> outer, PAreaL<S> inner)
inner such that the center of the area is equal to
the center of outer.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaL<S> hollowOut(PAreaL<S> outer, long min_x_offset, long max_x_offset, long min_y_offset, long max_y_offset)
outer based on the given
offsets from each edge.S - The coordinate space of the areasouter - The containing areamin_x_offset - The offset from the minimum-x edge (must be
non-negative)max_x_offset - The offset from the maximum-x edge (must be
non-negative)min_y_offset - The offset from the minimum-y edge (must be
non-negative)max_y_offset - The offset from the maximum-y edge (must be
non-negative)public static <S> PAreaL<S> hollowOutEvenly(PAreaL<S> outer, long offset)
hollowOut(PAreaL, long, long,
long, long) with offset for all offset parameters.S - The coordinate space of the areasouter - The containing areaoffset - The offset from each edge (must be non-negative)public static <S> PAreaL<S> setSizeFromCenter(PAreaL<S> area, long sizeX, long sizeY)
Set the sizeX and sizeY of area to sizeX and
sizeY, respectively.
The area is resized from its own center.
S - The coordinate space of the areaarea - The areasizeX - The new sizeX (must be non-negative)sizeY - The new sizeY (must be non-negative)public static <S> PAreaL<S> setSizeFromMinYMinX(PAreaL<S> area, long sizeX, long sizeY)
Set the sizeX and sizeY of area to sizeX and
sizeY, respectively.
The area is resized by moving its minimum-y-minimum-x corner.
S - The coordinate space of the areaarea - The areasizeX - The new sizeX (must be non-negative)sizeY - The new sizeY (must be non-negative)public static <S> PAreaL<S> setSizeFromMinYMaxX(PAreaL<S> area, long sizeX, long sizeY)
Set the sizeX and sizeY of area to sizeX and
sizeY, respectively.
The area is resized by moving its minimum-y-maximum-x corner.
S - The coordinate space of the areaarea - The areasizeX - The new sizeX (must be non-negative)sizeY - The new sizeY (must be non-negative)public static <S> PAreaL<S> setSizeFromMaxYMaxX(PAreaL<S> area, long sizeX, long sizeY)
Set the sizeX and sizeY of area to sizeX and
sizeY, respectively.
The area is resized by moving its maximum-y-maximum-x corner.
S - The coordinate space of the areaarea - The areasizeX - The new sizeX (must be non-negative)sizeY - The new sizeY (must be non-negative)public static <S> PAreaL<S> setSizeFromMaxYMinX(PAreaL<S> area, long sizeX, long sizeY)
Set the sizeX and sizeY of area to sizeX and
sizeY, respectively.
The area is resized by moving its maximum-y-minimum-x corner.
S - The coordinate space of the areaarea - The areasizeX - The new sizeX (must be non-negative)sizeY - The new sizeY (must be non-negative)public static <S> PAreaL<S> scaleFromMinYMinX(PAreaL<S> area, long x_diff, long y_diff)
Scale area by adding x_diff to the sizeX, and
y_diff to the sizeY. The size of the resulting area is clamped so that
its sizeX and sizeY are always non-negative.
The area is resized by moving its minimum-y-minimum-x corner.
S - The coordinate space of the areaarea - The areax_diff - The X differencey_diff - The Y differencepublic static <S> PAreaL<S> scaleFromMinYMaxX(PAreaL<S> area, long x_diff, long y_diff)
Scale area by adding x_diff to the sizeX, and
y_diff to the sizeY. The size of the resulting area is clamped so that
its sizeX and sizeY are always non-negative.
The area is resized by moving its minimum-y-maximum-x corner.
S - The coordinate space of the areaarea - The areax_diff - The X differencey_diff - The Y differencepublic static <S> PAreaL<S> scaleFromMaxYMinX(PAreaL<S> area, long x_diff, long y_diff)
Scale area by adding x_diff to the sizeX, and
y_diff to the sizeY. The size of the resulting area is clamped so that
its sizeX and sizeY are always non-negative.
The area is resized by moving its maximum-y-minimum-x corner.
S - The coordinate space of the areaarea - The areax_diff - The X differencey_diff - The Y differencepublic static <S> PAreaL<S> scaleFromMaxYMaxX(PAreaL<S> area, long x_diff, long y_diff)
Scale area by adding x_diff to the sizeX, and
y_diff to the sizeY. The size of the resulting area is clamped so that
its sizeX and sizeY are always non-negative.
The area is resized by moving its maximum-y-maximum-x corner.
S - The coordinate space of the areaarea - The areax_diff - The X differencey_diff - The Y differencepublic static <S> PAreaL<S> scaleFromCenter(PAreaL<S> area, long x_diff, long y_diff)
Scale area by adding x_diff to the sizeX, and
y_diff to the sizeY. The size of the resulting area is clamped so that
its sizeX and sizeY are always non-negative.
The area is resized from its own center.
S - The coordinate space of the areaarea - The areax_diff - The X differencey_diff - The Y differencepublic static <S> boolean overlaps(PAreaL<S> a, PAreaL<S> b)
Determine whether or not two areas overlap.
Overlapping is reflexive: overlaps(a, a) == true.
Overlapping is symmetric: overlaps(a, b) == overlaps(b, a).
Overlapping is not necessarily transitive.
S - The coordinate space of the areasa - An areab - An areatrue iff a overlaps bpublic static <S> boolean couldFitInside(PAreaL<S> a, PAreaL<S> b)
Determine whether or not one area could fit inside another.
Fitting is reflexive: couldFitInside(a, a) == true.
Fitting is transitive: couldFitInside(a, b) \u2192 couldFitInside(b,
c) \u2192 couldFitInside(a, c).
Fitting is not necessarily symmetric.
S - The coordinate space of the areasa - An areab - An areatrue iff a could fit inside bpublic static <S> PAreaL<S> containing(PAreaL<S> a, PAreaL<S> b)
a and b.S - The coordinate space of the areasa - An areab - An areaa and bpublic static <S> boolean containsPoint(PAreaL<S> a, long x, long y)
Determine whether or not a area contains a given point.
S - The coordinate space of the areaa - An areax - The X coordinate of the pointy - The Y coordinate of the pointtrue iff a contains (x, y)@Deprecated public static <S> PAreaL<S> fitBetweenHorizontal(PAreaL<S> fit, PAreaL<S> a, PAreaL<S> b)
fitBetweenOnX(PAreaL, PAreaL, PAreaL)fit between a and b, horizontally.S - The coordinate space of the areasfit - The area to be fitteda - An areab - An area@Deprecated public static <S> PAreaL<S> fitBetweenVertical(PAreaL<S> fit, PAreaL<S> a, PAreaL<S> b)
fitBetweenOnY(PAreaL, PAreaL, PAreaL)fit between a and b, vertically.S - The coordinate space of the areasfit - The area to be fitteda - An areab - An areapublic static <S> PAreaL<S> fitBetweenOnX(PAreaL<S> fit, PAreaL<S> a, PAreaL<S> b)
fit between a and b, horizontally.S - The coordinate space of the areasfit - The area to be fitteda - An areab - An areapublic static <S> PAreaL<S> fitBetweenOnY(PAreaL<S> fit, PAreaL<S> a, PAreaL<S> b)
fit between a and b, vertically.S - The coordinate space of the areasfit - The area to be fitteda - An areab - An areapublic static <S> PAreaXSplitL<S,PAreaL<S>> splitAlongParallelToX(PAreaL<S> area, long y)
area along a line parallel to the X axis placed at
y units from its own minimum-y edge.S - The coordinate space of the areasarea - The area to be splity - The relative Y coordinate of the splitting edgepublic static <S> PAreaYSplitL<S,PAreaL<S>> splitAlongParallelToY(PAreaL<S> area, long x)
area along a line parallel to the Y axis placed at
x units from its own minimum-x edge.S - The coordinate space of the areasarea - The area to be splitx - The relative X coordinate of the splitting edgepublic static <S> PAreaXYSplitL<S,PAreaL<S>> splitAlongXY(PAreaL<S> area, long x, long y)
area along a two axis-aligned perpendicular lines that intercept at (x, y).S - The coordinate space of the areasarea - The area to be splitx - The relative X coordinate of the splitting edgey - The relative Y coordinate of the splitting edgepublic static <S> java.lang.String show(PAreaL<S> area)
S - The coordinate space of the areaarea - The areapublic static <S> PAreaSizeL<S> size(PAreaL<S> area)
S - The coordinate space of the areaarea - The areapublic static <S> java.lang.String showToBuilder(PAreaL<S> area, java.lang.StringBuilder sb)
S - The coordinate space of the areaarea - The areasb - A string builderCopyright © 2017 <code@io7m.com> http://io7m.com