Class PAreasF
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.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <S> PAreaF<S>alignCenter(PAreaF<S> outer, PAreaF<S> inner) Align the areainnersuch that the center of the area is equal to the center ofouter.static <S> PAreaF<S>alignHorizontallyCenter(PAreaF<S> outer, PAreaF<S> inner) Deprecated.static <S> PAreaF<S>alignHorizontallyMaxX(PAreaF<S> outer, PAreaF<S> inner) Deprecated.static <S> PAreaF<S>alignHorizontallyMaxXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset) Deprecated.static <S> PAreaF<S>alignHorizontallyMinX(PAreaF<S> outer, PAreaF<S> inner) Deprecated.static <S> PAreaF<S>alignHorizontallyMinXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset) Deprecated.static <S> PAreaF<S>alignMaxYMaxX(PAreaF<S> outer, PAreaF<S> inner) Equivalent to callingalignMaxYMaxXOffset(PAreaF, PAreaF, float, float)with zero offsets.static <S> PAreaF<S>alignMaxYMaxXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset_x, float offset_y) Align the areainnersuch that the maximum-y edge is at leastoffset_yfrom the inside maximum-y edge ofouterand the maximum-x edge is at leastoffset_xfrom the inside maximum-x edge ofouter.static <S> PAreaF<S>alignMaxYMinX(PAreaF<S> outer, PAreaF<S> inner) Equivalent to callingalignMaxYMinXOffset(PAreaF, PAreaF, float, float)with zero offsets.static <S> PAreaF<S>alignMaxYMinXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset_x, float offset_y) Align the areainnersuch that the maximum-y edge is at leastoffset_yfrom the inside maximum-y edge ofouterand the minimum-x edge is at leastoffset_xfrom the inside minimum-x edge ofouter.static <S> PAreaF<S>alignMinYMaxX(PAreaF<S> outer, PAreaF<S> inner) Equivalent to callingalignMinYMaxXOffset(PAreaF, PAreaF, float, float)with zero offsets.static <S> PAreaF<S>alignMinYMaxXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset_x, float offset_y) Align the areainnersuch that the minimum-y edge is at leastoffset_yfrom the inside minimum-y edge ofouterand the maximum-x edge is at leastoffset_xfrom the inside maximum-x edge ofouter.static <S> PAreaF<S>alignMinYMinX(PAreaF<S> outer, PAreaF<S> inner) Equivalent to callingalignMinYMinXOffset(PAreaF, PAreaF, float, float)with zero offsets.static <S> PAreaF<S>alignMinYMinXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset_x, float offset_y) Align the areainnersuch that the minimum-y edge is at leastoffset_yfrom the inside minimum-y edge ofouterand the minimum-x edge is at leastoffset_xfrom the inside minimum-x edge ofouter.static <S> PAreaF<S>alignOnXCenter(PAreaF<S> outer, PAreaF<S> inner) Align the areainneralong the X axis in the center ofouter.static <S> PAreaF<S>alignOnXMaxX(PAreaF<S> outer, PAreaF<S> inner) Equivalent to callingalignOnXMaxXOffset(PAreaF, PAreaF, float)with a zero offset.static <S> PAreaF<S>alignOnXMaxXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset) Align the areainneralong the X axis against the inside maximum-x edge ofouter.static <S> PAreaF<S>alignOnXMinX(PAreaF<S> outer, PAreaF<S> inner) Equivalent to callingalignOnXMinXOffset(PAreaF, PAreaF, float)with a zero offset.static <S> PAreaF<S>alignOnXMinXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset) Align the areainneralong the X axis against the inside minimum-x edge ofouter.static <S> PAreaF<S>alignOnYCenter(PAreaF<S> outer, PAreaF<S> inner) Align the areainneralong the Y axis in the center ofouter.static <S> PAreaF<S>alignOnYMaxY(PAreaF<S> outer, PAreaF<S> inner) Equivalent to callingalignOnYMaxYOffset(PAreaF, PAreaF, float)with a zero offset.static <S> PAreaF<S>alignOnYMaxYOffset(PAreaF<S> outer, PAreaF<S> inner, float offset) Align the areainneralong the Y axis against the inside maximum-y edge ofouter.static <S> PAreaF<S>alignOnYMinY(PAreaF<S> outer, PAreaF<S> inner) Equivalent to callingalignOnYMinYOffset(PAreaF, PAreaF, float)with a zero offset.static <S> PAreaF<S>alignOnYMinYOffset(PAreaF<S> outer, PAreaF<S> inner, float offset) Align the areainneralong the Y axis against the inside minimum-y edge ofouter.static <S> PAreaF<S>alignVerticallyCenter(PAreaF<S> outer, PAreaF<S> inner) Deprecated.static <S> PAreaF<S>alignVerticallyMaxY(PAreaF<S> outer, PAreaF<S> inner) Deprecated.static <S> PAreaF<S>alignVerticallyMaxYOffset(PAreaF<S> outer, PAreaF<S> inner, float offset) Deprecated.static <S> PAreaF<S>alignVerticallyMinY(PAreaF<S> outer, PAreaF<S> inner) Deprecated.static <S> PAreaF<S>alignVerticallyMinYOffset(PAreaF<S> outer, PAreaF<S> inner, float offset) Deprecated.static <S,T> PAreaF<T> Brand a given area as belonging to a different coordinate space.static <S> PAreaF<S>containing(PAreaF<S> a, PAreaF<S> b) Construct a area that will contain bothaandb.static <S> booleanDetermine whether or not one area contains another.static <S> booleancontainsPoint(PAreaF<S> a, float x, float y) Determine whether or not a area contains a given point.static <S> booleancouldFitInside(PAreaF<S> a, PAreaF<S> b) Determine whether or not one area could fit inside another.static <S> PAreaF<S>create(float x, float y, float size_x, float size_y) Create an area of sizesize_xon the X axis and sizesize_yon the Y axis, placing the minimum corner at(x, y).static <S> PAreaF<S>fitBetweenHorizontal(PAreaF<S> fit, PAreaF<S> a, PAreaF<S> b) Deprecated.static <S> PAreaF<S>fitBetweenOnX(PAreaF<S> fit, PAreaF<S> a, PAreaF<S> b) Attempt to fitfitbetweenaandb, horizontally.static <S> PAreaF<S>fitBetweenOnY(PAreaF<S> fit, PAreaF<S> a, PAreaF<S> b) Attempt to fitfitbetweenaandb, vertically.static <S> PAreaF<S>fitBetweenVertical(PAreaF<S> fit, PAreaF<S> a, PAreaF<S> b) Deprecated.static <S> PAreaF<S>hollowOut(PAreaF<S> outer, float min_x_offset, float max_x_offset, float min_y_offset, float max_y_offset) Construct a new area that fits insideouterbased on the given offsets from each edge.static <S> PAreaF<S>hollowOutEvenly(PAreaF<S> outer, float offset) Equivalent to callinghollowOut(PAreaF, float, float, float, float)withoffsetfor all offset parameters.static <S> PAreaF<S>moveAbsolute(PAreaF<S> area, float x, float y) Move the given area to(x, y).static <S> PAreaF<S>moveRelative(PAreaF<S> area, float x, float y) Move the given area by(x, y).static <S> PAreaF<S>moveRelativeClamped(PAreaF<S> container, PAreaF<S> area, float x, float y) Move the given area by(x, y), without allowingareato leavecontainer.static <S> PAreaF<S>moveRelativeClampedX(PAreaF<S> container, PAreaF<S> area, float x) Move the given area byx, without allowingareato leavecontainer.static <S> PAreaF<S>moveRelativeClampedY(PAreaF<S> container, PAreaF<S> area, float y) Move the given area byy, without allowingareato leavecontainer.static <S> PAreaF<S>moveToOrigin(PAreaF<S> area) Move the given area to(0, 0).static <S> booleanDetermine whether or not two areas overlap.static <S> PAreaF<S>scaleFromCenter(PAreaF<S> area, float x_diff, float y_diff) Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static <S> PAreaF<S>scaleFromMaxYMaxX(PAreaF<S> area, float x_diff, float y_diff) Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static <S> PAreaF<S>scaleFromMaxYMinX(PAreaF<S> area, float x_diff, float y_diff) Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static <S> PAreaF<S>scaleFromMinYMaxX(PAreaF<S> area, float x_diff, float y_diff) Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static <S> PAreaF<S>scaleFromMinYMinX(PAreaF<S> area, float x_diff, float y_diff) Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static <S> PAreaF<S>setSizeFromCenter(PAreaF<S> area, float sizeX, float sizeY) Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static <S> PAreaF<S>setSizeFromMaxYMaxX(PAreaF<S> area, float sizeX, float sizeY) Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static <S> PAreaF<S>setSizeFromMaxYMinX(PAreaF<S> area, float sizeX, float sizeY) Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static <S> PAreaF<S>setSizeFromMinYMaxX(PAreaF<S> area, float sizeX, float sizeY) Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static <S> PAreaF<S>setSizeFromMinYMinX(PAreaF<S> area, float sizeX, float sizeY) Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static <S> Stringstatic <S> StringshowToBuilder(PAreaF<S> area, StringBuilder sb) static <S> PAreaSizeF<S>static <S> PAreaXSplitF<S,PAreaF<S>> splitAlongParallelToX(PAreaF<S> area, float y) Splitareaalong a line parallel to the X axis placed atyunits from its own minimum-y edge.static <S> PAreaYSplitF<S,PAreaF<S>> splitAlongParallelToY(PAreaF<S> area, float x) Splitareaalong a line parallel to the Y axis placed atxunits from its own minimum-x edge.static <S> PAreaXYSplitF<S,PAreaF<S>> splitAlongXY(PAreaF<S> area, float x, float y) Splitareaalong a two axis-aligned perpendicular lines that intercept at(x, y).
-
Method Details
-
create
Create an area of sizesize_xon the X axis and sizesize_yon the Y axis, placing the minimum corner at(x, y).- Type Parameters:
S- The coordinate space of the areas- Parameters:
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 axis- Returns:
- An area
-
contains
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.
- Type Parameters:
S- The coordinate space of the areas- Parameters:
a- Area Ab- Area B- Returns:
trueiffacontainsb
-
moveRelative
Move the given area by(x, y).- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areax- The amount to move on the X axisy- The amount to move on the Y axis- Returns:
- A moved area
-
moveRelativeClampedX
Move the given area byx, without allowingareato leavecontainer.- Type Parameters:
S- The coordinate space of the area- Parameters:
container- The container areaarea- The areax- The amount to move on the X axis- Returns:
- A moved area
- Since:
- 3.0.0
-
moveRelativeClampedY
Move the given area byy, without allowingareato leavecontainer.- Type Parameters:
S- The coordinate space of the area- Parameters:
container- The container areaarea- The areay- The amount to move on the Y axis- Returns:
- A moved area
- Since:
- 3.0.0
-
moveRelativeClamped
public static <S> PAreaF<S> moveRelativeClamped(PAreaF<S> container, PAreaF<S> area, float x, float y) Move the given area by(x, y), without allowingareato leavecontainer.- Type Parameters:
S- The coordinate space of the area- Parameters:
container- The container areaarea- The areax- The amount to move on the X axisy- The amount to move on the Y axis- Returns:
- A moved area
- Since:
- 3.0.0
-
moveAbsolute
Move the given area to(x, y).- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areax- The position to which to move on the X axisy- The position to which to move on the Y axis- Returns:
- A moved area
-
moveToOrigin
Move the given area to(0, 0).- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The area- Returns:
- A moved area
-
cast
Brand a given area as belonging to a different coordinate space. Mixing up coordinate spaces is a common source of difficult-to-locate bugs. Use at your own risk.- Type Parameters:
S- The starting coordinate spaceT- The resulting coordinate space- Parameters:
area- An area- Returns:
area
-
alignHorizontallyCenter
Deprecated.Align the areainnerhorizontally in the center ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignHorizontallyMinX
Deprecated.Equivalent to callingalignHorizontallyMinXOffset(PAreaF, PAreaF, float)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignHorizontallyMinXOffset
@Deprecated public static <S> PAreaF<S> alignHorizontallyMinXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset) Deprecated.Align the areainnerhorizontally against the inside minimum-x edge ofouter. The area will be at leastoffsetunits from the minimum-x edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
-
alignHorizontallyMaxX
Deprecated.Equivalent to callingalignHorizontallyMaxXOffset(PAreaF, PAreaF, float)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignHorizontallyMaxXOffset
@Deprecated public static <S> PAreaF<S> alignHorizontallyMaxXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset) Deprecated.Align the areainnerhorizontally against the inside maximum-x edge ofouter. The area will be at leastoffsetunits from the maximum-x edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
-
alignVerticallyMinY
Deprecated.Equivalent to callingalignVerticallyMinYOffset(PAreaF, PAreaF, float)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignVerticallyMinYOffset
@Deprecated public static <S> PAreaF<S> alignVerticallyMinYOffset(PAreaF<S> outer, PAreaF<S> inner, float offset) Deprecated.Align the areainnervertically against the inside minimum-y edge ofouter. The area will be at leastoffsetunits from the minimum-y edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
-
alignVerticallyMaxY
Deprecated.Equivalent to callingalignVerticallyMaxYOffset(PAreaF, PAreaF, float)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignVerticallyMaxYOffset
@Deprecated public static <S> PAreaF<S> alignVerticallyMaxYOffset(PAreaF<S> outer, PAreaF<S> inner, float offset) Deprecated.Align the areainnervertically against the inside maximum-y edge ofouter. The area will be at leastoffsetunits from the maximum-y edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
-
alignVerticallyCenter
Deprecated.Align the areainnervertically in the center ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignOnXCenter
Align the areainneralong the X axis in the center ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnXMinX
Equivalent to callingalignOnXMinXOffset(PAreaF, PAreaF, float)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnXMinXOffset
Align the areainneralong the X axis against the inside minimum-x edge ofouter. The area will be at leastoffsetunits from the minimum-x edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnXMaxX
Equivalent to callingalignOnXMaxXOffset(PAreaF, PAreaF, float)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnXMaxXOffset
Align the areainneralong the X axis against the inside maximum-x edge ofouter. The area will be at leastoffsetunits from the maximum-x edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYMinY
Equivalent to callingalignOnYMinYOffset(PAreaF, PAreaF, float)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYMinYOffset
Align the areainneralong the Y axis against the inside minimum-y edge ofouter. The area will be at leastoffsetunits from the minimum-y edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYMaxY
Equivalent to callingalignOnYMaxYOffset(PAreaF, PAreaF, float)with a zero offset.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYMaxYOffset
Align the areainneralong the Y axis against the inside maximum-y edge ofouter. The area will be at leastoffsetunits from the maximum-y edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYCenter
Align the areainneralong the Y axis in the center ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignMinYMinX
Equivalent to callingalignMinYMinXOffset(PAreaF, PAreaF, float, float)with zero offsets.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignMinYMinXOffset
public static <S> PAreaF<S> alignMinYMinXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset_x, float offset_y) Align the areainnersuch that the minimum-y edge is at leastoffset_yfrom the inside minimum-y edge ofouterand the minimum-x edge is at leastoffset_xfrom the inside minimum-x edge ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset_x- The offset from the minimum-x edgeoffset_y- The offset from the minimum-y edge- Returns:
- An aligned area
-
alignMinYMaxX
Equivalent to callingalignMinYMaxXOffset(PAreaF, PAreaF, float, float)with zero offsets.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignMinYMaxXOffset
public static <S> PAreaF<S> alignMinYMaxXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset_x, float offset_y) Align the areainnersuch that the minimum-y edge is at leastoffset_yfrom the inside minimum-y edge ofouterand the maximum-x edge is at leastoffset_xfrom the inside maximum-x edge ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset_x- The offset from the maximum-x edgeoffset_y- The offset from the minimum-y edge- Returns:
- An aligned area
-
alignMaxYMinX
Equivalent to callingalignMaxYMinXOffset(PAreaF, PAreaF, float, float)with zero offsets.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignMaxYMinXOffset
public static <S> PAreaF<S> alignMaxYMinXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset_x, float offset_y) Align the areainnersuch that the maximum-y edge is at leastoffset_yfrom the inside maximum-y edge ofouterand the minimum-x edge is at leastoffset_xfrom the inside minimum-x edge ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset_x- The offset from the minimum-x edgeoffset_y- The offset from the maximum-y edge- Returns:
- An aligned area
-
alignMaxYMaxX
Equivalent to callingalignMaxYMaxXOffset(PAreaF, PAreaF, float, float)with zero offsets.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignMaxYMaxXOffset
public static <S> PAreaF<S> alignMaxYMaxXOffset(PAreaF<S> outer, PAreaF<S> inner, float offset_x, float offset_y) Align the areainnersuch that the maximum-y edge is at leastoffset_yfrom the inside maximum-y edge ofouterand the maximum-x edge is at leastoffset_xfrom the inside maximum-x edge ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner areaoffset_x- The offset from the maximum-x edgeoffset_y- The offset from the maximum-y edge- Returns:
- An aligned area
-
alignCenter
Align the areainnersuch that the center of the area is equal to the center ofouter.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
hollowOut
public static <S> PAreaF<S> hollowOut(PAreaF<S> outer, float min_x_offset, float max_x_offset, float min_y_offset, float max_y_offset) Construct a new area that fits insideouterbased on the given offsets from each edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
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)- Returns:
- A new area
-
hollowOutEvenly
Equivalent to callinghollowOut(PAreaF, float, float, float, float)withoffsetfor all offset parameters.- Type Parameters:
S- The coordinate space of the areas- Parameters:
outer- The containing areaoffset- The offset from each edge (must be non-negative)- Returns:
- A new area
-
setSizeFromCenter
Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized from its own center.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMinYMinX
Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized by moving its minimum-y-minimum-x corner.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMinYMaxX
Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized by moving its minimum-y-maximum-x corner.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMaxYMaxX
Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized by moving its maximum-y-maximum-x corner.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMaxYMinX
Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized by moving its maximum-y-minimum-x corner.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
scaleFromMinYMinX
Scale
areaby addingx_diffto the sizeX, andy_diffto 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.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areax_diff- The X differencey_diff- The Y difference- Returns:
- A resized area
-
scaleFromMinYMaxX
Scale
areaby addingx_diffto the sizeX, andy_diffto 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.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areax_diff- The X differencey_diff- The Y difference- Returns:
- A resized area
-
scaleFromMaxYMinX
Scale
areaby addingx_diffto the sizeX, andy_diffto 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.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areax_diff- The X differencey_diff- The Y difference- Returns:
- A resized area
-
scaleFromMaxYMaxX
Scale
areaby addingx_diffto the sizeX, andy_diffto 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.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areax_diff- The X differencey_diff- The Y difference- Returns:
- A resized area
-
scaleFromCenter
Scale
areaby addingx_diffto the sizeX, andy_diffto 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.
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areax_diff- The X differencey_diff- The Y difference- Returns:
- A resized area
-
overlaps
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.
- Type Parameters:
S- The coordinate space of the areas- Parameters:
a- An areab- An area- Returns:
trueiffaoverlapsb
-
couldFitInside
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.
- Type Parameters:
S- The coordinate space of the areas- Parameters:
a- An areab- An area- Returns:
trueiffacould fit insideb
-
containing
Construct a area that will contain bothaandb.- Type Parameters:
S- The coordinate space of the areas- Parameters:
a- An areab- An area- Returns:
- An area containing
aandb
-
containsPoint
Determine whether or not a area contains a given point.
- Type Parameters:
S- The coordinate space of the area- Parameters:
a- An areax- The X coordinate of the pointy- The Y coordinate of the point- Returns:
trueiffacontains(x, y)
-
fitBetweenHorizontal
@Deprecated public static <S> PAreaF<S> fitBetweenHorizontal(PAreaF<S> fit, PAreaF<S> a, PAreaF<S> b) Deprecated.Attempt to fitfitbetweenaandb, horizontally.- Type Parameters:
S- The coordinate space of the areas- Parameters:
fit- The area to be fitteda- An areab- An area- Returns:
- A fitted area
-
fitBetweenVertical
Deprecated.Attempt to fitfitbetweenaandb, vertically.- Type Parameters:
S- The coordinate space of the areas- Parameters:
fit- The area to be fitteda- An areab- An area- Returns:
- A fitted area
-
fitBetweenOnX
Attempt to fitfitbetweenaandb, horizontally.- Type Parameters:
S- The coordinate space of the areas- Parameters:
fit- The area to be fitteda- An areab- An area- Returns:
- A fitted area
-
fitBetweenOnY
Attempt to fitfitbetweenaandb, vertically.- Type Parameters:
S- The coordinate space of the areas- Parameters:
fit- The area to be fitteda- An areab- An area- Returns:
- A fitted area
-
splitAlongParallelToX
Splitareaalong a line parallel to the X axis placed atyunits from its own minimum-y edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
area- The area to be splity- The relative Y coordinate of the splitting edge- Returns:
- A pair of areas
-
splitAlongParallelToY
Splitareaalong a line parallel to the Y axis placed atxunits from its own minimum-x edge.- Type Parameters:
S- The coordinate space of the areas- Parameters:
area- The area to be splitx- The relative X coordinate of the splitting edge- Returns:
- A pair of areas
-
splitAlongXY
Splitareaalong a two axis-aligned perpendicular lines that intercept at(x, y).- Type Parameters:
S- The coordinate space of the areas- Parameters:
area- The area to be splitx- The relative X coordinate of the splitting edgey- The relative Y coordinate of the splitting edge- Returns:
- The four resulting quadrants
- Since:
- 1.1.0
-
show
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The area- Returns:
- A terse string describing the position and size of the area
-
size
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The area- Returns:
- The size of the area
-
showToBuilder
- Type Parameters:
S- The coordinate space of the area- Parameters:
area- The areasb- A string builder- Returns:
- A terse string describing the position and size of the area
-
alignOnXCenter(PAreaF, PAreaF)