Class AreasBD
public final class AreasBD
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.
-
Method Summary
Modifier and Type Method Description static AreaBDalignCenter(AreaBD outer, AreaBD inner)Align the areainnersuch that the center of the area is equal to the center ofouter.static AreaBDalignHorizontallyCenter(AreaBD outer, AreaBD inner)Deprecated.static AreaBDalignHorizontallyMaxX(AreaBD outer, AreaBD inner)Deprecated.static AreaBDalignHorizontallyMaxXOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset)Deprecated.static AreaBDalignHorizontallyMinX(AreaBD outer, AreaBD inner)Deprecated.static AreaBDalignHorizontallyMinXOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset)Deprecated.static AreaBDalignMaxYMaxX(AreaBD outer, AreaBD inner)Equivalent to callingalignMaxYMaxXOffset(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)with zero offsets.static AreaBDalignMaxYMaxXOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset_x, java.math.BigDecimal 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 AreaBDalignMaxYMinX(AreaBD outer, AreaBD inner)Equivalent to callingalignMaxYMinXOffset(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)with zero offsets.static AreaBDalignMaxYMinXOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset_x, java.math.BigDecimal 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 AreaBDalignMinYMaxX(AreaBD outer, AreaBD inner)Equivalent to callingalignMinYMaxXOffset(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)with zero offsets.static AreaBDalignMinYMaxXOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset_x, java.math.BigDecimal 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 AreaBDalignMinYMinX(AreaBD outer, AreaBD inner)Equivalent to callingalignMinYMinXOffset(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)with zero offsets.static AreaBDalignMinYMinXOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset_x, java.math.BigDecimal 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 AreaBDalignOnXCenter(AreaBD outer, AreaBD inner)Align the areainneralong the X axis in the center ofouter.static AreaBDalignOnXMaxX(AreaBD outer, AreaBD inner)Equivalent to callingalignOnXMaxXOffset(AreaBD, AreaBD, java.math.BigDecimal)with a zero offset.static AreaBDalignOnXMaxXOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset)Align the areainneralong the X axis against the inside maximum-x edge ofouter.static AreaBDalignOnXMinX(AreaBD outer, AreaBD inner)Equivalent to callingalignOnXMinXOffset(AreaBD, AreaBD, java.math.BigDecimal)with a zero offset.static AreaBDalignOnXMinXOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset)Align the areainneralong the X axis against the inside minimum-x edge ofouter.static AreaBDalignOnYCenter(AreaBD outer, AreaBD inner)Align the areainneralong the Y axis in the center ofouter.static AreaBDalignOnYMaxY(AreaBD outer, AreaBD inner)Equivalent to callingalignOnYMaxYOffset(AreaBD, AreaBD, java.math.BigDecimal)with a zero offset.static AreaBDalignOnYMaxYOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset)Align the areainneralong the Y axis against the inside maximum-y edge ofouter.static AreaBDalignOnYMinY(AreaBD outer, AreaBD inner)Equivalent to callingalignOnYMinYOffset(AreaBD, AreaBD, java.math.BigDecimal)with a zero offset.static AreaBDalignOnYMinYOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset)Align the areainneralong the Y axis against the inside minimum-y edge ofouter.static AreaBDalignVerticallyCenter(AreaBD outer, AreaBD inner)Deprecated.static AreaBDalignVerticallyMaxY(AreaBD outer, AreaBD inner)Deprecated.static AreaBDalignVerticallyMaxYOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset)Deprecated.static AreaBDalignVerticallyMinY(AreaBD outer, AreaBD inner)Deprecated.static AreaBDalignVerticallyMinYOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset)Deprecated.static AreaBDcontaining(AreaBD a, AreaBD b)Construct a area that will contain bothaandb.static booleancontains(AreaBD a, AreaBD b)Determine whether or not one area contains another.static booleancontainsPoint(AreaBD a, java.math.BigDecimal x, java.math.BigDecimal y)Determine whether or not a area contains a given point.static booleancouldFitInside(AreaBD a, AreaBD b)Determine whether or not one area could fit inside another.static AreaBDcreate(java.math.BigDecimal x, java.math.BigDecimal y, java.math.BigDecimal size_x, java.math.BigDecimal 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 AreaBDfitBetweenHorizontal(AreaBD fit, AreaBD a, AreaBD b)Deprecated.static AreaBDfitBetweenOnX(AreaBD fit, AreaBD a, AreaBD b)Attempt to fitfitbetweenaandb, horizontally.static AreaBDfitBetweenOnY(AreaBD fit, AreaBD a, AreaBD b)Attempt to fitfitbetweenaandb, vertically.static AreaBDfitBetweenVertical(AreaBD fit, AreaBD a, AreaBD b)Deprecated.static AreaBDhollowOut(AreaBD outer, java.math.BigDecimal min_x_offset, java.math.BigDecimal max_x_offset, java.math.BigDecimal min_y_offset, java.math.BigDecimal max_y_offset)Construct a new area that fits insideouterbased on the given offsets from each edge.static AreaBDhollowOutEvenly(AreaBD outer, java.math.BigDecimal offset)Equivalent to callinghollowOut(AreaBD, java.math.BigDecimal, java.math.BigDecimal, java.math.BigDecimal, java.math.BigDecimal)withoffsetfor all offset parameters.static AreaBDmoveAbsolute(AreaBD area, java.math.BigDecimal x, java.math.BigDecimal y)Move the given area to(x, y).static AreaBDmoveRelative(AreaBD area, java.math.BigDecimal x, java.math.BigDecimal y)Move the given area by(x, y).static AreaBDmoveRelativeClamped(AreaBD container, AreaBD area, java.math.BigDecimal x, java.math.BigDecimal y)Move the given area by(x, y), without allowingareato leavecontainer.static AreaBDmoveRelativeClampedX(AreaBD container, AreaBD area, java.math.BigDecimal x)Move the given area byx, without allowingareato leavecontainer.static AreaBDmoveRelativeClampedY(AreaBD container, AreaBD area, java.math.BigDecimal y)Move the given area byy, without allowingareato leavecontainer.static AreaBDmoveToOrigin(AreaBD area)Move the given area to(0, 0).static booleanoverlaps(AreaBD a, AreaBD b)Determine whether or not two areas overlap.static AreaBDscaleFromCenter(AreaBD area, java.math.BigDecimal x_diff, java.math.BigDecimal y_diff)Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static AreaBDscaleFromMaxYMaxX(AreaBD area, java.math.BigDecimal x_diff, java.math.BigDecimal y_diff)Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static AreaBDscaleFromMaxYMinX(AreaBD area, java.math.BigDecimal x_diff, java.math.BigDecimal y_diff)Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static AreaBDscaleFromMinYMaxX(AreaBD area, java.math.BigDecimal x_diff, java.math.BigDecimal y_diff)Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static AreaBDscaleFromMinYMinX(AreaBD area, java.math.BigDecimal x_diff, java.math.BigDecimal y_diff)Scaleareaby addingx_diffto the sizeX, andy_diffto the sizeY.static AreaBDsetSizeFromCenter(AreaBD area, java.math.BigDecimal sizeX, java.math.BigDecimal sizeY)Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static AreaBDsetSizeFromMaxYMaxX(AreaBD area, java.math.BigDecimal sizeX, java.math.BigDecimal sizeY)Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static AreaBDsetSizeFromMaxYMinX(AreaBD area, java.math.BigDecimal sizeX, java.math.BigDecimal sizeY)Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static AreaBDsetSizeFromMinYMaxX(AreaBD area, java.math.BigDecimal sizeX, java.math.BigDecimal sizeY)Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static AreaBDsetSizeFromMinYMinX(AreaBD area, java.math.BigDecimal sizeX, java.math.BigDecimal sizeY)Set the sizeX and sizeY ofareatosizeXandsizeY, respectively.static java.lang.Stringshow(AreaBD area)static java.lang.StringshowToBuilder(AreaBD area, java.lang.StringBuilder sb)static AreaSizeBDsize(AreaBD area)static AreaXSplitBD<AreaBD>splitAlongParallelToX(AreaBD area, java.math.BigDecimal y)Splitareaalong a line parallel to the X axis placed atyunits from its own minimum-y edge.static AreaYSplitBD<AreaBD>splitAlongParallelToY(AreaBD area, java.math.BigDecimal x)Splitareaalong a line parallel to the Y axis placed atxunits from its own minimum-x edge.static AreaXYSplitBD<AreaBD>splitAlongXY(AreaBD area, java.math.BigDecimal x, java.math.BigDecimal y)Splitareaalong a two axis-aligned perpendicular lines that intercept at(x, y).
-
Method Details
-
create
public static AreaBD create(java.math.BigDecimal x, java.math.BigDecimal y, java.math.BigDecimal size_x, java.math.BigDecimal size_y)Create an area of sizesize_xon the X axis and sizesize_yon the Y axis, placing the minimum corner at(x, y).- 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.
- Parameters:
a- Area Ab- Area B- Returns:
trueiffacontainsb
-
moveRelative
Move the given area by(x, y).- 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.- 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.- 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 AreaBD moveRelativeClamped(AreaBD container, AreaBD area, java.math.BigDecimal x, java.math.BigDecimal y)Move the given area by(x, y), without allowingareato leavecontainer.- 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).- 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).- Parameters:
area- The area- Returns:
- A moved area
-
alignOnXCenter
Align the areainneralong the X axis in the center ofouter.- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnXMinX
Equivalent to callingalignOnXMinXOffset(AreaBD, AreaBD, java.math.BigDecimal)with a zero offset.- 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.- 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(AreaBD, AreaBD, java.math.BigDecimal)with a zero offset.- 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.- 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(AreaBD, AreaBD, java.math.BigDecimal)with a zero offset.- 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.- 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(AreaBD, AreaBD, java.math.BigDecimal)with a zero offset.- 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.- 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.- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignHorizontallyCenter
Deprecated.Align the areainnerhorizontally in the center ofouter.- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignHorizontallyMinX
Deprecated.Equivalent to callingalignHorizontallyMinXOffset(AreaBD, AreaBD, java.math.BigDecimal)with a zero offset.- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignHorizontallyMinXOffset
@Deprecated public static AreaBD alignHorizontallyMinXOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset)Deprecated.Align the areainnerhorizontally against the inside minimum-x edge ofouter. The area will be at leastoffsetunits from the minimum-x edge.- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
-
alignHorizontallyMaxX
Deprecated.Equivalent to callingalignHorizontallyMaxXOffset(AreaBD, AreaBD, java.math.BigDecimal)with a zero offset.- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignHorizontallyMaxXOffset
@Deprecated public static AreaBD alignHorizontallyMaxXOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset)Deprecated.Align the areainnerhorizontally against the inside maximum-x edge ofouter. The area will be at leastoffsetunits from the maximum-x edge.- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
-
alignVerticallyMinY
Deprecated.Equivalent to callingalignVerticallyMinYOffset(AreaBD, AreaBD, java.math.BigDecimal)with a zero offset.- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignVerticallyMinYOffset
@Deprecated public static AreaBD alignVerticallyMinYOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset)Deprecated.Align the areainnervertically against the inside minimum-y edge ofouter. The area will be at leastoffsetunits from the minimum-y edge.- Parameters:
outer- The outer areainner- The inner areaoffset- The offset from the edge- Returns:
- An aligned area
-
alignVerticallyMaxY
Deprecated.Equivalent to callingalignVerticallyMaxYOffset(AreaBD, AreaBD, java.math.BigDecimal)with a zero offset.- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignVerticallyMaxYOffset
@Deprecated public static AreaBD alignVerticallyMaxYOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset)Deprecated.Align the areainnervertically against the inside maximum-y edge ofouter. The area will be at leastoffsetunits from the maximum-y edge.- 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.- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignMinYMinX
Equivalent to callingalignMinYMinXOffset(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)with zero offsets.- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignMinYMinXOffset
public static AreaBD alignMinYMinXOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset_x, java.math.BigDecimal 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.- 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(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)with zero offsets.- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignMinYMaxXOffset
public static AreaBD alignMinYMaxXOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset_x, java.math.BigDecimal 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.- 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(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)with zero offsets.- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignMaxYMinXOffset
public static AreaBD alignMaxYMinXOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset_x, java.math.BigDecimal 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.- 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(AreaBD, AreaBD, java.math.BigDecimal, java.math.BigDecimal)with zero offsets.- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
alignMaxYMaxXOffset
public static AreaBD alignMaxYMaxXOffset(AreaBD outer, AreaBD inner, java.math.BigDecimal offset_x, java.math.BigDecimal 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.- 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.- Parameters:
outer- The outer areainner- The inner area- Returns:
- An aligned area
-
hollowOut
public static AreaBD hollowOut(AreaBD outer, java.math.BigDecimal min_x_offset, java.math.BigDecimal max_x_offset, java.math.BigDecimal min_y_offset, java.math.BigDecimal max_y_offset)Construct a new area that fits insideouterbased on the given offsets from each edge.- 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(AreaBD, java.math.BigDecimal, java.math.BigDecimal, java.math.BigDecimal, java.math.BigDecimal)withoffsetfor all offset parameters.- Parameters:
outer- The containing areaoffset- The offset from each edge (must be non-negative)- Returns:
- A new area
-
setSizeFromCenter
public static AreaBD setSizeFromCenter(AreaBD area, java.math.BigDecimal sizeX, java.math.BigDecimal sizeY)Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized from its own center.
- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMinYMinX
public static AreaBD setSizeFromMinYMinX(AreaBD area, java.math.BigDecimal sizeX, java.math.BigDecimal sizeY)Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized by moving its minimum-y-minimum-x corner.
- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMinYMaxX
public static AreaBD setSizeFromMinYMaxX(AreaBD area, java.math.BigDecimal sizeX, java.math.BigDecimal sizeY)Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized by moving its minimum-y-maximum-x corner.
- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMaxYMaxX
public static AreaBD setSizeFromMaxYMaxX(AreaBD area, java.math.BigDecimal sizeX, java.math.BigDecimal sizeY)Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized by moving its maximum-y-maximum-x corner.
- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMaxYMinX
public static AreaBD setSizeFromMaxYMinX(AreaBD area, java.math.BigDecimal sizeX, java.math.BigDecimal sizeY)Set the sizeX and sizeY of
areatosizeXandsizeY, respectively.The area is resized by moving its maximum-y-minimum-x corner.
- Parameters:
area- The areasizeX- The new sizeX (must be non-negative)sizeY- The new sizeY (must be non-negative)- Returns:
- A resized area
-
scaleFromMinYMinX
public static AreaBD scaleFromMinYMinX(AreaBD area, java.math.BigDecimal x_diff, java.math.BigDecimal y_diff)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.
- Parameters:
area- The areax_diff- The X differencey_diff- The Y difference- Returns:
- A resized area
-
scaleFromMinYMaxX
public static AreaBD scaleFromMinYMaxX(AreaBD area, java.math.BigDecimal x_diff, java.math.BigDecimal y_diff)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.
- Parameters:
area- The areax_diff- The X differencey_diff- The Y difference- Returns:
- A resized area
-
scaleFromMaxYMinX
public static AreaBD scaleFromMaxYMinX(AreaBD area, java.math.BigDecimal x_diff, java.math.BigDecimal y_diff)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.
- Parameters:
area- The areax_diff- The X differencey_diff- The Y difference- Returns:
- A resized area
-
scaleFromMaxYMaxX
public static AreaBD scaleFromMaxYMaxX(AreaBD area, java.math.BigDecimal x_diff, java.math.BigDecimal y_diff)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.
- Parameters:
area- The areax_diff- The X differencey_diff- The Y difference- Returns:
- A resized area
-
scaleFromCenter
public static AreaBD scaleFromCenter(AreaBD area, java.math.BigDecimal x_diff, java.math.BigDecimal y_diff)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.
- 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.
- 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.
- Parameters:
a- An areab- An area- Returns:
trueiffacould fit insideb
-
containing
Construct a area that will contain bothaandb.- Parameters:
a- An areab- An area- Returns:
- An area containing
aandb
-
containsPoint
Determine whether or not a area contains a given point.
- Parameters:
a- An areax- The X coordinate of the pointy- The Y coordinate of the point- Returns:
trueiffacontains(x, y)
-
fitBetweenHorizontal
Deprecated.Attempt to fitfitbetweenaandb, horizontally.- Parameters:
fit- The area to be fitteda- An areab- An area- Returns:
- A fitted area
-
fitBetweenVertical
Deprecated.Attempt to fitfitbetweenaandb, vertically.- Parameters:
fit- The area to be fitteda- An areab- An area- Returns:
- A fitted area
-
fitBetweenOnX
Attempt to fitfitbetweenaandb, horizontally.- Parameters:
fit- The area to be fitteda- An areab- An area- Returns:
- A fitted area
-
fitBetweenOnY
Attempt to fitfitbetweenaandb, vertically.- 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.- 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.- Parameters:
area- The area to be splitx- The relative X coordinate of the splitting edge- Returns:
- A pair of areas
-
splitAlongXY
public static AreaXYSplitBD<AreaBD> splitAlongXY(AreaBD area, java.math.BigDecimal x, java.math.BigDecimal y)Splitareaalong a two axis-aligned perpendicular lines that intercept at(x, y).- 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
- Parameters:
area- The area- Returns:
- A terse string describing the position and size of the area
-
size
- Parameters:
area- The area- Returns:
- The size of the area
-
showToBuilder
- Parameters:
area- The areasb- A string builder- Returns:
- A terse string describing the position and size of the area
-