public final class AreasL extends 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 and Description |
|---|---|
static AreaL |
alignCenter(AreaL outer,
AreaL inner)
Align the area
inner such that the center of the area is equal to
the center of outer. |
static AreaL |
alignHorizontallyCenter(AreaL outer,
AreaL inner)
Deprecated.
|
static AreaL |
alignHorizontallyMaxX(AreaL outer,
AreaL inner)
Deprecated.
|
static AreaL |
alignHorizontallyMaxXOffset(AreaL outer,
AreaL inner,
long offset)
Deprecated.
|
static AreaL |
alignHorizontallyMinX(AreaL outer,
AreaL inner)
Deprecated.
|
static AreaL |
alignHorizontallyMinXOffset(AreaL outer,
AreaL inner,
long offset)
Deprecated.
|
static AreaL |
alignMaxYMaxX(AreaL outer,
AreaL inner)
Equivalent to calling
alignMaxYMaxXOffset(AreaL, AreaL,
long, long) with zero offsets. |
static AreaL |
alignMaxYMaxXOffset(AreaL outer,
AreaL 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 AreaL |
alignMaxYMinX(AreaL outer,
AreaL inner)
Equivalent to calling
alignMaxYMinXOffset(AreaL, AreaL,
long, long) with zero offsets. |
static AreaL |
alignMaxYMinXOffset(AreaL outer,
AreaL 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 AreaL |
alignMinYMaxX(AreaL outer,
AreaL inner)
Equivalent to calling
alignMinYMaxXOffset(AreaL, AreaL,
long, long) with zero offsets. |
static AreaL |
alignMinYMaxXOffset(AreaL outer,
AreaL 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 AreaL |
alignMinYMinX(AreaL outer,
AreaL inner)
Equivalent to calling
alignMinYMinXOffset(AreaL, AreaL,
long, long) with zero offsets. |
static AreaL |
alignMinYMinXOffset(AreaL outer,
AreaL 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 AreaL |
alignOnXCenter(AreaL outer,
AreaL inner)
Align the area
inner along the X axis in the center of outer. |
static AreaL |
alignOnXMaxX(AreaL outer,
AreaL inner)
Equivalent to calling
alignOnXMaxXOffset(AreaL,
AreaL, long) with a zero offset. |
static AreaL |
alignOnXMaxXOffset(AreaL outer,
AreaL inner,
long offset)
Align the area
inner along the X axis against the inside maximum-x edge
of outer. |
static AreaL |
alignOnXMinX(AreaL outer,
AreaL inner)
Equivalent to calling
alignOnXMinXOffset(AreaL, AreaL,
long) with a zero offset. |
static AreaL |
alignOnXMinXOffset(AreaL outer,
AreaL inner,
long offset)
Align the area
inner along the X axis against the inside minimum-x edge
of outer. |
static AreaL |
alignOnYCenter(AreaL outer,
AreaL inner)
Align the area
inner along the Y axis in the center of outer. |
static AreaL |
alignOnYMaxY(AreaL outer,
AreaL inner)
Equivalent to calling
alignOnYMaxYOffset(AreaL, AreaL,
long) with a zero offset. |
static AreaL |
alignOnYMaxYOffset(AreaL outer,
AreaL inner,
long offset)
Align the area
inner along the Y axis against the inside maximum-y edge
of outer. |
static AreaL |
alignOnYMinY(AreaL outer,
AreaL inner)
Equivalent to calling
alignOnYMinYOffset(AreaL, AreaL,
long) with a zero offset. |
static AreaL |
alignOnYMinYOffset(AreaL outer,
AreaL inner,
long offset)
Align the area
inner along the Y axis against the inside minimum-y edge
of outer. |
static AreaL |
alignVerticallyCenter(AreaL outer,
AreaL inner)
Deprecated.
|
static AreaL |
alignVerticallyMaxY(AreaL outer,
AreaL inner)
Deprecated.
|
static AreaL |
alignVerticallyMaxYOffset(AreaL outer,
AreaL inner,
long offset)
Deprecated.
|
static AreaL |
alignVerticallyMinY(AreaL outer,
AreaL inner)
Deprecated.
|
static AreaL |
alignVerticallyMinYOffset(AreaL outer,
AreaL inner,
long offset)
Deprecated.
|
static AreaL |
containing(AreaL a,
AreaL b)
Construct a area that will contain both
a and b. |
static boolean |
contains(AreaL a,
AreaL b)
Determine whether or not one area contains another.
|
static boolean |
containsPoint(AreaL a,
long x,
long y)
Determine whether or not a area contains a given point.
|
static boolean |
couldFitInside(AreaL a,
AreaL b)
Determine whether or not one area could fit inside another.
|
static AreaL |
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 AreaL |
fitBetweenHorizontal(AreaL fit,
AreaL a,
AreaL b)
Deprecated.
|
static AreaL |
fitBetweenOnX(AreaL fit,
AreaL a,
AreaL b)
Attempt to fit
fit between a and b, horizontally. |
static AreaL |
fitBetweenOnY(AreaL fit,
AreaL a,
AreaL b)
Attempt to fit
fit between a and b, vertically. |
static AreaL |
fitBetweenVertical(AreaL fit,
AreaL a,
AreaL b)
Deprecated.
|
static AreaL |
hollowOut(AreaL 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 AreaL |
hollowOutEvenly(AreaL outer,
long offset)
Equivalent to calling
hollowOut(AreaL, long, long,
long, long) with offset for all offset parameters. |
static AreaL |
moveAbsolute(AreaL area,
long x,
long y)
Move the given area to
(x, y). |
static AreaL |
moveRelative(AreaL area,
long x,
long y)
Move the given area by
(x, y). |
static AreaL |
moveToOrigin(AreaL area)
Move the given area to
(0, 0). |
static boolean |
overlaps(AreaL a,
AreaL b)
Determine whether or not two areas overlap.
|
static AreaL |
scaleFromCenter(AreaL area,
long x_diff,
long y_diff)
Scale
area by adding x_diff to the sizeX, and y_diff to the sizeY. |
static AreaL |
scaleFromMaxYMaxX(AreaL area,
long x_diff,
long y_diff)
Scale
area by adding x_diff to the sizeX, and y_diff to the sizeY. |
static AreaL |
scaleFromMaxYMinX(AreaL area,
long x_diff,
long y_diff)
Scale
area by adding x_diff to the sizeX, and y_diff to the sizeY. |
static AreaL |
scaleFromMinYMaxX(AreaL area,
long x_diff,
long y_diff)
Scale
area by adding x_diff to the sizeX, and y_diff to the sizeY. |
static AreaL |
scaleFromMinYMinX(AreaL area,
long x_diff,
long y_diff)
Scale
area by adding x_diff to the sizeX, and y_diff to the sizeY. |
static AreaL |
setSizeFromCenter(AreaL area,
long sizeX,
long sizeY)
Set the sizeX and sizeY of
area to sizeX and sizeY, respectively. |
static AreaL |
setSizeFromMaxYMaxX(AreaL area,
long sizeX,
long sizeY)
Set the sizeX and sizeY of
area to sizeX and sizeY, respectively. |
static AreaL |
setSizeFromMaxYMinX(AreaL area,
long sizeX,
long sizeY)
Set the sizeX and sizeY of
area to sizeX and sizeY, respectively. |
static AreaL |
setSizeFromMinYMaxX(AreaL area,
long sizeX,
long sizeY)
Set the sizeX and sizeY of
area to sizeX and sizeY, respectively. |
static AreaL |
setSizeFromMinYMinX(AreaL area,
long sizeX,
long sizeY)
Set the sizeX and sizeY of
area to sizeX and sizeY, respectively. |
static String |
show(AreaL area) |
static String |
showToBuilder(AreaL area,
StringBuilder sb) |
static AreaSizeL |
size(AreaL area) |
static AreaXSplitL<AreaL> |
splitAlongParallelToX(AreaL area,
long y)
Split
area along a line parallel to the X axis placed at
y units from its own minimum-y edge. |
static AreaYSplitL<AreaL> |
splitAlongParallelToY(AreaL area,
long x)
Split
area along a line parallel to the Y axis placed at
x units from its own minimum-x edge. |
static AreaXYSplitL<AreaL> |
splitAlongXY(AreaL area,
long x,
long y)
Split
area along a two axis-aligned perpendicular lines that intercept at (x, y). |
public static AreaL 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).x - 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 boolean contains(AreaL a, AreaL b)
Determine whether or not one area contains another.
Containing is reflexive: contains(a, a) == true.
Containing is transitive: contains(a, b) → contains(b, c) →
contains(a, c).
Containing is not necessarily symmetric.
a - Area Ab - Area Btrue iff a contains bpublic static AreaL moveRelative(AreaL area, long x, long y)
(x, y).area - The areax - The amount to move on the X axisy - The amount to move on the Y axispublic static AreaL moveAbsolute(AreaL area, long x, long y)
(x, y).area - The areax - The position to which to move on the X axisy - The position to which to move on the Y axispublic static AreaL moveToOrigin(AreaL area)
(0, 0).area - The areapublic static AreaL alignOnXCenter(AreaL outer, AreaL inner)
inner along the X axis in the center of outer.outer - The outer areainner - The inner areapublic static AreaL alignOnXMinX(AreaL outer, AreaL inner)
alignOnXMinXOffset(AreaL, AreaL,
long) with a zero offset.outer - The outer areainner - The inner areapublic static AreaL alignOnXMinXOffset(AreaL outer, AreaL 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.outer - The outer areainner - The inner areaoffset - The offset from the edgepublic static AreaL alignOnXMaxX(AreaL outer, AreaL inner)
alignOnXMaxXOffset(AreaL,
AreaL, long) with a zero offset.outer - The outer areainner - The inner areapublic static AreaL alignOnXMaxXOffset(AreaL outer, AreaL 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.outer - The outer areainner - The inner areaoffset - The offset from the edgepublic static AreaL alignOnYMinY(AreaL outer, AreaL inner)
alignOnYMinYOffset(AreaL, AreaL,
long) with a zero offset.outer - The outer areainner - The inner areapublic static AreaL alignOnYMinYOffset(AreaL outer, AreaL 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.outer - The outer areainner - The inner areaoffset - The offset from the edgepublic static AreaL alignOnYMaxY(AreaL outer, AreaL inner)
alignOnYMaxYOffset(AreaL, AreaL,
long) with a zero offset.outer - The outer areainner - The inner areapublic static AreaL alignOnYMaxYOffset(AreaL outer, AreaL 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.outer - The outer areainner - The inner areaoffset - The offset from the edgepublic static AreaL alignOnYCenter(AreaL outer, AreaL inner)
inner along the Y axis in the center of outer.outer - The outer areainner - The inner area@Deprecated public static AreaL alignHorizontallyCenter(AreaL outer, AreaL inner)
alignOnXCenter(AreaL, AreaL)inner horizontally in the center of outer.outer - The outer areainner - The inner area@Deprecated public static AreaL alignHorizontallyMinX(AreaL outer, AreaL inner)
alignOnXMinX(AreaL, AreaL)alignHorizontallyMinXOffset(AreaL, AreaL,
long) with a zero offset.outer - The outer areainner - The inner area@Deprecated public static AreaL alignHorizontallyMinXOffset(AreaL outer, AreaL inner, long offset)
alignOnXMinXOffset(AreaL, AreaL, long)inner horizontally against the inside minimum-x edge
of outer. The area will be at least offset units from the
minimum-x edge.outer - The outer areainner - The inner areaoffset - The offset from the edge@Deprecated public static AreaL alignHorizontallyMaxX(AreaL outer, AreaL inner)
alignOnXMaxX(AreaL, AreaL)alignHorizontallyMaxXOffset(AreaL,
AreaL, long) with a zero offset.outer - The outer areainner - The inner area@Deprecated public static AreaL alignHorizontallyMaxXOffset(AreaL outer, AreaL inner, long offset)
alignOnXMaxXOffset(AreaL, AreaL, long)inner horizontally against the inside maximum-x edge
of outer. The area will be at least offset units from the
maximum-x edge.outer - The outer areainner - The inner areaoffset - The offset from the edge@Deprecated public static AreaL alignVerticallyMinY(AreaL outer, AreaL inner)
alignOnYMinY(AreaL, AreaL)alignVerticallyMinYOffset(AreaL, AreaL,
long) with a zero offset.outer - The outer areainner - The inner area@Deprecated public static AreaL alignVerticallyMinYOffset(AreaL outer, AreaL inner, long offset)
alignOnYMinYOffset(AreaL, AreaL, long)inner vertically against the inside minimum-y edge
of outer. The area will be at least offset units from the
minimum-y edge.outer - The outer areainner - The inner areaoffset - The offset from the edge@Deprecated public static AreaL alignVerticallyMaxY(AreaL outer, AreaL inner)
alignOnYMaxY(AreaL, AreaL)alignVerticallyMaxYOffset(AreaL, AreaL,
long) with a zero offset.outer - The outer areainner - The inner area@Deprecated public static AreaL alignVerticallyMaxYOffset(AreaL outer, AreaL inner, long offset)
alignOnYMaxYOffset(AreaL, AreaL, long)inner vertically against the inside maximum-y edge
of outer. The area will be at least offset units from the
maximum-y edge.outer - The outer areainner - The inner areaoffset - The offset from the edge@Deprecated public static AreaL alignVerticallyCenter(AreaL outer, AreaL inner)
alignOnYCenter(AreaL, AreaL)inner vertically in the center of outer.outer - The outer areainner - The inner areapublic static AreaL alignMinYMinX(AreaL outer, AreaL inner)
alignMinYMinXOffset(AreaL, AreaL,
long, long) with zero offsets.outer - The outer areainner - The inner areapublic static AreaL alignMinYMinXOffset(AreaL outer, AreaL 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.outer - The outer areainner - The inner areaoffset_x - The offset from the minimum-x edgeoffset_y - The offset from the minimum-y edgepublic static AreaL alignMinYMaxX(AreaL outer, AreaL inner)
alignMinYMaxXOffset(AreaL, AreaL,
long, long) with zero offsets.outer - The outer areainner - The inner areapublic static AreaL alignMinYMaxXOffset(AreaL outer, AreaL 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.outer - The outer areainner - The inner areaoffset_x - The offset from the maximum-x edgeoffset_y - The offset from the minimum-y edgepublic static AreaL alignMaxYMinX(AreaL outer, AreaL inner)
alignMaxYMinXOffset(AreaL, AreaL,
long, long) with zero offsets.outer - The outer areainner - The inner areapublic static AreaL alignMaxYMinXOffset(AreaL outer, AreaL 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.outer - The outer areainner - The inner areaoffset_x - The offset from the minimum-x edgeoffset_y - The offset from the maximum-y edgepublic static AreaL alignMaxYMaxX(AreaL outer, AreaL inner)
alignMaxYMaxXOffset(AreaL, AreaL,
long, long) with zero offsets.outer - The outer areainner - The inner areapublic static AreaL alignMaxYMaxXOffset(AreaL outer, AreaL 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.outer - The outer areainner - The inner areaoffset_x - The offset from the maximum-x edgeoffset_y - The offset from the maximum-y edgepublic static AreaL alignCenter(AreaL outer, AreaL inner)
inner such that the center of the area is equal to
the center of outer.outer - The outer areainner - The inner areapublic static AreaL hollowOut(AreaL 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.outer - 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 AreaL hollowOutEvenly(AreaL outer, long offset)
hollowOut(AreaL, long, long,
long, long) with offset for all offset parameters.outer - The containing areaoffset - The offset from each edge (must be non-negative)public static AreaL setSizeFromCenter(AreaL 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.
area - The areasizeX - The new sizeX (must be non-negative)sizeY - The new sizeY (must be non-negative)public static AreaL setSizeFromMinYMinX(AreaL 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.
area - The areasizeX - The new sizeX (must be non-negative)sizeY - The new sizeY (must be non-negative)public static AreaL setSizeFromMinYMaxX(AreaL 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.
area - The areasizeX - The new sizeX (must be non-negative)sizeY - The new sizeY (must be non-negative)public static AreaL setSizeFromMaxYMaxX(AreaL 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.
area - The areasizeX - The new sizeX (must be non-negative)sizeY - The new sizeY (must be non-negative)public static AreaL setSizeFromMaxYMinX(AreaL 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.
area - The areasizeX - The new sizeX (must be non-negative)sizeY - The new sizeY (must be non-negative)public static AreaL scaleFromMinYMinX(AreaL 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.
area - The areax_diff - The X differencey_diff - The Y differencepublic static AreaL scaleFromMinYMaxX(AreaL 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.
area - The areax_diff - The X differencey_diff - The Y differencepublic static AreaL scaleFromMaxYMinX(AreaL 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.
area - The areax_diff - The X differencey_diff - The Y differencepublic static AreaL scaleFromMaxYMaxX(AreaL 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.
area - The areax_diff - The X differencey_diff - The Y differencepublic static AreaL scaleFromCenter(AreaL 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.
area - The areax_diff - The X differencey_diff - The Y differencepublic static boolean overlaps(AreaL a, AreaL 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.
a - An areab - An areatrue iff a overlaps bpublic static boolean couldFitInside(AreaL a, AreaL b)
Determine whether or not one area could fit inside another.
Fitting is reflexive: couldFitInside(a, a) == true.
Fitting is transitive: couldFitInside(a, b) → couldFitInside(b,
c) → couldFitInside(a, c).
Fitting is not necessarily symmetric.
a - An areab - An areatrue iff a could fit inside bpublic static AreaL containing(AreaL a, AreaL b)
a and b.a - An areab - An areaa and bpublic static boolean containsPoint(AreaL a, long x, long y)
Determine whether or not a area contains a given point.
a - An areax - The X coordinate of the pointy - The Y coordinate of the pointtrue iff a contains (x, y)@Deprecated public static AreaL fitBetweenHorizontal(AreaL fit, AreaL a, AreaL b)
fitBetweenOnX(AreaL, AreaL, AreaL)fit between a and b, horizontally.fit - The area to be fitteda - An areab - An area@Deprecated public static AreaL fitBetweenVertical(AreaL fit, AreaL a, AreaL b)
fitBetweenOnY(AreaL, AreaL, AreaL)fit between a and b, vertically.fit - The area to be fitteda - An areab - An areapublic static AreaL fitBetweenOnX(AreaL fit, AreaL a, AreaL b)
fit between a and b, horizontally.fit - The area to be fitteda - An areab - An areapublic static AreaL fitBetweenOnY(AreaL fit, AreaL a, AreaL b)
fit between a and b, vertically.fit - The area to be fitteda - An areab - An areapublic static AreaXSplitL<AreaL> splitAlongParallelToX(AreaL area, long y)
area along a line parallel to the X axis placed at
y units from its own minimum-y edge.area - The area to be splity - The relative Y coordinate of the splitting edgepublic static AreaYSplitL<AreaL> splitAlongParallelToY(AreaL area, long x)
area along a line parallel to the Y axis placed at
x units from its own minimum-x edge.area - The area to be splitx - The relative X coordinate of the splitting edgepublic static AreaXYSplitL<AreaL> splitAlongXY(AreaL area, long x, long y)
area along a two axis-aligned perpendicular lines that intercept at (x, y).area - The area to be splitx - The relative X coordinate of the splitting edgey - The relative Y coordinate of the splitting edgepublic static String show(AreaL area)
area - The areapublic static AreaSizeL size(AreaL area)
area - The areapublic static String showToBuilder(AreaL area, StringBuilder sb)
area - The areasb - A string builderCopyright © 2017 <code@io7m.com> http://io7m.com