public final class PAreasD
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> PAreaD<S> |
alignCenter(PAreaD<S> outer,
PAreaD<S> inner) |
Align the area
inner such that the center of the area is equal to
the center of outer. |
static <S> PAreaD<S> |
alignHorizontallyCenter(PAreaD<S> outer,
PAreaD<S> inner) |
Deprecated.
|
static <S> PAreaD<S> |
alignHorizontallyMaxX(PAreaD<S> outer,
PAreaD<S> inner) |
Deprecated.
|
static <S> PAreaD<S> |
alignHorizontallyMaxXOffset(PAreaD<S> outer,
PAreaD<S> inner,
double offset) |
Deprecated.
|
static <S> PAreaD<S> |
alignHorizontallyMinX(PAreaD<S> outer,
PAreaD<S> inner) |
Deprecated.
|
static <S> PAreaD<S> |
alignHorizontallyMinXOffset(PAreaD<S> outer,
PAreaD<S> inner,
double offset) |
Deprecated.
|
static <S> PAreaD<S> |
alignMaxYMaxX(PAreaD<S> outer,
PAreaD<S> inner) |
Equivalent to calling
alignMaxYMaxXOffset(PAreaD, PAreaD,
double, double) with zero offsets. |
static <S> PAreaD<S> |
alignMaxYMaxXOffset(PAreaD<S> outer,
PAreaD<S> inner,
double offset_x,
double 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> PAreaD<S> |
alignMaxYMinX(PAreaD<S> outer,
PAreaD<S> inner) |
Equivalent to calling
alignMaxYMinXOffset(PAreaD, PAreaD,
double, double) with zero offsets. |
static <S> PAreaD<S> |
alignMaxYMinXOffset(PAreaD<S> outer,
PAreaD<S> inner,
double offset_x,
double 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> PAreaD<S> |
alignMinYMaxX(PAreaD<S> outer,
PAreaD<S> inner) |
Equivalent to calling
alignMinYMaxXOffset(PAreaD, PAreaD,
double, double) with zero offsets. |
static <S> PAreaD<S> |
alignMinYMaxXOffset(PAreaD<S> outer,
PAreaD<S> inner,
double offset_x,
double 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> PAreaD<S> |
alignMinYMinX(PAreaD<S> outer,
PAreaD<S> inner) |
Equivalent to calling
alignMinYMinXOffset(PAreaD, PAreaD,
double, double) with zero offsets. |
static <S> PAreaD<S> |
alignMinYMinXOffset(PAreaD<S> outer,
PAreaD<S> inner,
double offset_x,
double 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> PAreaD<S> |
alignOnXCenter(PAreaD<S> outer,
PAreaD<S> inner) |
Align the area
inner along the X axis in the center of outer. |
static <S> PAreaD<S> |
alignOnXMaxX(PAreaD<S> outer,
PAreaD<S> inner) |
Equivalent to calling
alignOnXMaxXOffset(PAreaD,
PAreaD, double) with a zero offset. |
static <S> PAreaD<S> |
alignOnXMaxXOffset(PAreaD<S> outer,
PAreaD<S> inner,
double offset) |
Align the area
inner along the X axis against the inside maximum-x edge
of outer. |
static <S> PAreaD<S> |
alignOnXMinX(PAreaD<S> outer,
PAreaD<S> inner) |
Equivalent to calling
alignOnXMinXOffset(PAreaD, PAreaD,
double) with a zero offset. |
static <S> PAreaD<S> |
alignOnXMinXOffset(PAreaD<S> outer,
PAreaD<S> inner,
double offset) |
Align the area
inner along the X axis against the inside minimum-x edge
of outer. |
static <S> PAreaD<S> |
alignOnYCenter(PAreaD<S> outer,
PAreaD<S> inner) |
Align the area
inner along the Y axis in the center of outer. |
static <S> PAreaD<S> |
alignOnYMaxY(PAreaD<S> outer,
PAreaD<S> inner) |
Equivalent to calling
alignOnYMaxYOffset(PAreaD, PAreaD,
double) with a zero offset. |
static <S> PAreaD<S> |
alignOnYMaxYOffset(PAreaD<S> outer,
PAreaD<S> inner,
double offset) |
Align the area
inner along the Y axis against the inside maximum-y edge
of outer. |
static <S> PAreaD<S> |
alignOnYMinY(PAreaD<S> outer,
PAreaD<S> inner) |
Equivalent to calling
alignOnYMinYOffset(PAreaD, PAreaD,
double) with a zero offset. |
static <S> PAreaD<S> |
alignOnYMinYOffset(PAreaD<S> outer,
PAreaD<S> inner,
double offset) |
Align the area
inner along the Y axis against the inside minimum-y edge
of outer. |
static <S> PAreaD<S> |
alignVerticallyCenter(PAreaD<S> outer,
PAreaD<S> inner) |
Deprecated.
|
static <S> PAreaD<S> |
alignVerticallyMaxY(PAreaD<S> outer,
PAreaD<S> inner) |
Deprecated.
|
static <S> PAreaD<S> |
alignVerticallyMaxYOffset(PAreaD<S> outer,
PAreaD<S> inner,
double offset) |
Deprecated.
|
static <S> PAreaD<S> |
alignVerticallyMinY(PAreaD<S> outer,
PAreaD<S> inner) |
Deprecated.
|
static <S> PAreaD<S> |
alignVerticallyMinYOffset(PAreaD<S> outer,
PAreaD<S> inner,
double offset) |
Deprecated.
|
static <S,T> PAreaD<T> |
cast(PAreaD<S> area) |
Brand a given area as belonging to a different coordinate space.
|
static <S> PAreaD<S> |
containing(PAreaD<S> a,
PAreaD<S> b) |
Construct a area that will contain both
a and b. |
static <S> boolean |
contains(PAreaD<S> a,
PAreaD<S> b) |
Determine whether or not one area contains another.
|
static <S> boolean |
containsPoint(PAreaD<S> a,
double x,
double y) |
Determine whether or not a area contains a given point.
|
static <S> boolean |
couldFitInside(PAreaD<S> a,
PAreaD<S> b) |
Determine whether or not one area could fit inside another.
|
static <S> PAreaD<S> |
create(double x,
double y,
double size_x,
double 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> PAreaD<S> |
fitBetweenHorizontal(PAreaD<S> fit,
PAreaD<S> a,
PAreaD<S> b) |
Deprecated.
|
static <S> PAreaD<S> |
fitBetweenOnX(PAreaD<S> fit,
PAreaD<S> a,
PAreaD<S> b) |
Attempt to fit
fit between a and b, horizontally. |
static <S> PAreaD<S> |
fitBetweenOnY(PAreaD<S> fit,
PAreaD<S> a,
PAreaD<S> b) |
Attempt to fit
fit between a and b, vertically. |
static <S> PAreaD<S> |
fitBetweenVertical(PAreaD<S> fit,
PAreaD<S> a,
PAreaD<S> b) |
Deprecated.
|
static <S> PAreaD<S> |
hollowOut(PAreaD<S> outer,
double min_x_offset,
double max_x_offset,
double min_y_offset,
double max_y_offset) |
Construct a new area that fits inside
outer based on the given
offsets from each edge. |
static <S> PAreaD<S> |
hollowOutEvenly(PAreaD<S> outer,
double offset) |
Equivalent to calling
hollowOut(PAreaD, double, double,
double, double) with offset for all offset parameters. |
static <S> PAreaD<S> |
moveAbsolute(PAreaD<S> area,
double x,
double y) |
Move the given area to
(x, y). |
static <S> PAreaD<S> |
moveRelative(PAreaD<S> area,
double x,
double y) |
Move the given area by
(x, y). |
static <S> PAreaD<S> |
moveToOrigin(PAreaD<S> area) |
Move the given area to
(0, 0). |
static <S> boolean |
overlaps(PAreaD<S> a,
PAreaD<S> b) |
Determine whether or not two areas overlap.
|
static <S> PAreaD<S> |
scaleFromCenter(PAreaD<S> area,
double x_diff,
double y_diff) |
Scale
area by adding x_diff to the sizeX, and
y_diff to the sizeY. |
static <S> PAreaD<S> |
scaleFromMaxYMaxX(PAreaD<S> area,
double x_diff,
double y_diff) |
Scale
area by adding x_diff to the sizeX, and
y_diff to the sizeY. |
static <S> PAreaD<S> |
scaleFromMaxYMinX(PAreaD<S> area,
double x_diff,
double y_diff) |
Scale
area by adding x_diff to the sizeX, and
y_diff to the sizeY. |
static <S> PAreaD<S> |
scaleFromMinYMaxX(PAreaD<S> area,
double x_diff,
double y_diff) |
Scale
area by adding x_diff to the sizeX, and
y_diff to the sizeY. |
static <S> PAreaD<S> |
scaleFromMinYMinX(PAreaD<S> area,
double x_diff,
double y_diff) |
Scale
area by adding x_diff to the sizeX, and
y_diff to the sizeY. |
static <S> PAreaD<S> |
setSizeFromCenter(PAreaD<S> area,
double sizeX,
double sizeY) |
Set the sizeX and sizeY of
area to sizeX and
sizeY, respectively. |
static <S> PAreaD<S> |
setSizeFromMaxYMaxX(PAreaD<S> area,
double sizeX,
double sizeY) |
Set the sizeX and sizeY of
area to sizeX and
sizeY, respectively. |
static <S> PAreaD<S> |
setSizeFromMaxYMinX(PAreaD<S> area,
double sizeX,
double sizeY) |
Set the sizeX and sizeY of
area to sizeX and
sizeY, respectively. |
static <S> PAreaD<S> |
setSizeFromMinYMaxX(PAreaD<S> area,
double sizeX,
double sizeY) |
Set the sizeX and sizeY of
area to sizeX and
sizeY, respectively. |
static <S> PAreaD<S> |
setSizeFromMinYMinX(PAreaD<S> area,
double sizeX,
double sizeY) |
Set the sizeX and sizeY of
area to sizeX and
sizeY, respectively. |
static <S> java.lang.String |
show(PAreaD<S> area) |
|
static <S> java.lang.String |
showToBuilder(PAreaD<S> area,
java.lang.StringBuilder sb) |
|
static <S> PAreaSizeD<S> |
size(PAreaD<S> area) |
|
static <S> PAreaXSplitD<S,PAreaD<S>> |
splitAlongParallelToX(PAreaD<S> area,
double y) |
Split
area along a line parallel to the X axis placed at
y units from its own minimum-y edge. |
static <S> PAreaYSplitD<S,PAreaD<S>> |
splitAlongParallelToY(PAreaD<S> area,
double x) |
Split
area along a line parallel to the Y axis placed at
x units from its own minimum-x edge. |
static <S> PAreaXYSplitD<S,PAreaD<S>> |
splitAlongXY(PAreaD<S> area,
double x,
double y) |
Split
area along a two axis-aligned perpendicular lines that intercept at (x, y). |
public static <S> PAreaD<S> create(double x, double y, double size_x, double 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(PAreaD<S> a, PAreaD<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> PAreaD<S> moveRelative(PAreaD<S> area, double x, double 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> PAreaD<S> moveAbsolute(PAreaD<S> area, double x, double 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> PAreaD<S> moveToOrigin(PAreaD<S> area)
(0, 0).S - The coordinate space of the areaarea - The areapublic static <S,T> PAreaD<T> cast(PAreaD<S> area)
S - The starting coordinate spaceT - The resulting coordinate spacearea - An areaarea@Deprecated public static <S> PAreaD<S> alignHorizontallyCenter(PAreaD<S> outer, PAreaD<S> inner)
alignOnXCenter(PAreaD, PAreaD)inner horizontally in the center of outer.S - The coordinate space of the areasouter - The outer areainner - The inner area@Deprecated public static <S> PAreaD<S> alignHorizontallyMinX(PAreaD<S> outer, PAreaD<S> inner)
alignOnXMinX(PAreaD, PAreaD)alignHorizontallyMinXOffset(PAreaD, PAreaD,
double) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner area@Deprecated public static <S> PAreaD<S> alignHorizontallyMinXOffset(PAreaD<S> outer, PAreaD<S> inner, double offset)
alignOnXMinXOffset(PAreaD, PAreaD, double)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> PAreaD<S> alignHorizontallyMaxX(PAreaD<S> outer, PAreaD<S> inner)
alignOnXMaxX(PAreaD, PAreaD)alignHorizontallyMaxXOffset(PAreaD,
PAreaD, double) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner area@Deprecated public static <S> PAreaD<S> alignHorizontallyMaxXOffset(PAreaD<S> outer, PAreaD<S> inner, double offset)
alignOnXMaxXOffset(PAreaD, PAreaD, double)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> PAreaD<S> alignVerticallyMinY(PAreaD<S> outer, PAreaD<S> inner)
alignOnYMinY(PAreaD, PAreaD)alignVerticallyMinYOffset(PAreaD, PAreaD,
double) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner area@Deprecated public static <S> PAreaD<S> alignVerticallyMinYOffset(PAreaD<S> outer, PAreaD<S> inner, double offset)
alignOnYMinYOffset(PAreaD, PAreaD, double)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> PAreaD<S> alignVerticallyMaxY(PAreaD<S> outer, PAreaD<S> inner)
alignOnYMaxY(PAreaD, PAreaD)alignVerticallyMaxYOffset(PAreaD, PAreaD,
double) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner area@Deprecated public static <S> PAreaD<S> alignVerticallyMaxYOffset(PAreaD<S> outer, PAreaD<S> inner, double offset)
alignOnYMaxYOffset(PAreaD, PAreaD, double)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> PAreaD<S> alignVerticallyCenter(PAreaD<S> outer, PAreaD<S> inner)
alignOnYCenter(PAreaD, PAreaD)inner vertically in the center of outer.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaD<S> alignOnXCenter(PAreaD<S> outer, PAreaD<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> PAreaD<S> alignOnXMinX(PAreaD<S> outer, PAreaD<S> inner)
alignOnXMinXOffset(PAreaD, PAreaD,
double) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaD<S> alignOnXMinXOffset(PAreaD<S> outer, PAreaD<S> inner, double 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> PAreaD<S> alignOnXMaxX(PAreaD<S> outer, PAreaD<S> inner)
alignOnXMaxXOffset(PAreaD,
PAreaD, double) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaD<S> alignOnXMaxXOffset(PAreaD<S> outer, PAreaD<S> inner, double 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> PAreaD<S> alignOnYMinY(PAreaD<S> outer, PAreaD<S> inner)
alignOnYMinYOffset(PAreaD, PAreaD,
double) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaD<S> alignOnYMinYOffset(PAreaD<S> outer, PAreaD<S> inner, double 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> PAreaD<S> alignOnYMaxY(PAreaD<S> outer, PAreaD<S> inner)
alignOnYMaxYOffset(PAreaD, PAreaD,
double) with a zero offset.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaD<S> alignOnYMaxYOffset(PAreaD<S> outer, PAreaD<S> inner, double 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> PAreaD<S> alignOnYCenter(PAreaD<S> outer, PAreaD<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> PAreaD<S> alignMinYMinX(PAreaD<S> outer, PAreaD<S> inner)
alignMinYMinXOffset(PAreaD, PAreaD,
double, double) with zero offsets.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaD<S> alignMinYMinXOffset(PAreaD<S> outer, PAreaD<S> inner, double offset_x, double 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> PAreaD<S> alignMinYMaxX(PAreaD<S> outer, PAreaD<S> inner)
alignMinYMaxXOffset(PAreaD, PAreaD,
double, double) with zero offsets.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaD<S> alignMinYMaxXOffset(PAreaD<S> outer, PAreaD<S> inner, double offset_x, double 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> PAreaD<S> alignMaxYMinX(PAreaD<S> outer, PAreaD<S> inner)
alignMaxYMinXOffset(PAreaD, PAreaD,
double, double) with zero offsets.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaD<S> alignMaxYMinXOffset(PAreaD<S> outer, PAreaD<S> inner, double offset_x, double 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> PAreaD<S> alignMaxYMaxX(PAreaD<S> outer, PAreaD<S> inner)
alignMaxYMaxXOffset(PAreaD, PAreaD,
double, double) with zero offsets.S - The coordinate space of the areasouter - The outer areainner - The inner areapublic static <S> PAreaD<S> alignMaxYMaxXOffset(PAreaD<S> outer, PAreaD<S> inner, double offset_x, double 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> PAreaD<S> alignCenter(PAreaD<S> outer, PAreaD<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> PAreaD<S> hollowOut(PAreaD<S> outer, double min_x_offset, double max_x_offset, double min_y_offset, double 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> PAreaD<S> hollowOutEvenly(PAreaD<S> outer, double offset)
hollowOut(PAreaD, double, double,
double, double) 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> PAreaD<S> setSizeFromCenter(PAreaD<S> area, double sizeX, double 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> PAreaD<S> setSizeFromMinYMinX(PAreaD<S> area, double sizeX, double 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> PAreaD<S> setSizeFromMinYMaxX(PAreaD<S> area, double sizeX, double 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> PAreaD<S> setSizeFromMaxYMaxX(PAreaD<S> area, double sizeX, double 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> PAreaD<S> setSizeFromMaxYMinX(PAreaD<S> area, double sizeX, double 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> PAreaD<S> scaleFromMinYMinX(PAreaD<S> area, double x_diff, double 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> PAreaD<S> scaleFromMinYMaxX(PAreaD<S> area, double x_diff, double 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> PAreaD<S> scaleFromMaxYMinX(PAreaD<S> area, double x_diff, double 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> PAreaD<S> scaleFromMaxYMaxX(PAreaD<S> area, double x_diff, double 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> PAreaD<S> scaleFromCenter(PAreaD<S> area, double x_diff, double 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(PAreaD<S> a, PAreaD<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(PAreaD<S> a, PAreaD<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> PAreaD<S> containing(PAreaD<S> a, PAreaD<S> b)
a and b.S - The coordinate space of the areasa - An areab - An areaa and bpublic static <S> boolean containsPoint(PAreaD<S> a, double x, double 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> PAreaD<S> fitBetweenHorizontal(PAreaD<S> fit, PAreaD<S> a, PAreaD<S> b)
fitBetweenOnX(PAreaD, PAreaD, PAreaD)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> PAreaD<S> fitBetweenVertical(PAreaD<S> fit, PAreaD<S> a, PAreaD<S> b)
fitBetweenOnY(PAreaD, PAreaD, PAreaD)fit between a and b, vertically.S - The coordinate space of the areasfit - The area to be fitteda - An areab - An areapublic static <S> PAreaD<S> fitBetweenOnX(PAreaD<S> fit, PAreaD<S> a, PAreaD<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> PAreaD<S> fitBetweenOnY(PAreaD<S> fit, PAreaD<S> a, PAreaD<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> PAreaXSplitD<S,PAreaD<S>> splitAlongParallelToX(PAreaD<S> area, double 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> PAreaYSplitD<S,PAreaD<S>> splitAlongParallelToY(PAreaD<S> area, double 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> PAreaXYSplitD<S,PAreaD<S>> splitAlongXY(PAreaD<S> area, double x, double 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(PAreaD<S> area)
S - The coordinate space of the areaarea - The areapublic static <S> PAreaSizeD<S> size(PAreaD<S> area)
S - The coordinate space of the areaarea - The areapublic static <S> java.lang.String showToBuilder(PAreaD<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