Package com.sun.javafx.geom
Class RectBounds
java.lang.Object
com.sun.javafx.geom.BaseBounds
com.sun.javafx.geom.RectBounds
A simple object which carries bounds information as floats, and
 has no Z components.
- 
Nested Class SummaryNested classes/interfaces inherited from class com.sun.javafx.geom.BaseBoundsBaseBounds.BoundsType
- 
Constructor SummaryConstructorsConstructorDescriptionCreate an axis aligned bounding rectangle object, with an empty bounds where maxX invalid input: '<' minX and maxY invalid input: '<' minY.RectBounds(float minX, float minY, float maxX, float maxY) Creates a RectBounds based on the minX, minY, maxX, and maxY values specified.RectBounds(RectBounds other) Creates a RectBounds object as a copy of the specified RectBounds object.
- 
Method SummaryModifier and TypeMethodDescriptionvoidadd(float x, float y) voidadd(float x, float y, float z) voidbooleancontains(float x, float y) booleanbooleancontains(RectBounds other) Determines whether the givenotherRectBounds is completely contained within this RectBounds.copy()Duplicates this instance.deriveWithNewBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) deriveWithNewBounds(BaseBounds other) deriveWithNewBoundsAndSort(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) deriveWithPadding(float h, float v, float d) deriveWithUnion(BaseBounds other) booleandisjoint(float x, float y, float width, float height) booleandisjoint(RectBounds other) booleanflattenInto(RectBounds bounds) Sets the given RectBounds (or creates a new instance of bounds is null) to have the minX, minY, maxX, and maxY of this BoxBounds, dropping the Z values.Creates a RectBounds object as a copy of the specified RECTANGLE.floatgetDepth()Convenience function for getting the depth of this RectBounds The dimension along the Z-Axis, since this is a 2D bounds the return value is always 0f.floatConvenience function for getting the height of this RectBounds The dimension along the Y-Axis.floatgetMaxX()floatgetMaxY()floatgetMaxZ()floatgetMinX()floatgetMinY()floatgetMinZ()floatgetWidth()Convenience function for getting the width of this RectBounds.voidgrow(float h, float v) inthashCode()booleanintersects(float x, float y, float width, float height) booleanintersects(BaseBounds other) voidintersectWith(float minX, float minY, float maxX, float maxY) voidintersectWith(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) voidintersectWith(BaseBounds other) booleanis2D()Return true if this bounds is of a 2D BoundsType, else false.booleanisEmpty()voidroundOut()Adjusts the edges of this RectBounds "outward" toward integral boundaries, such that the rounded bounding box will always full enclose the original bounding box.final voidsetBounds(float minX, float minY, float maxX, float maxY) Set the bounds to the given values.final voidsetBounds(RectBounds other) Set the bounds to match that of the RectBounds object specified.voidsetBoundsAndSort(float minX, float minY, float maxX, float maxY) Sets the bounds based on the given coords, and also ensures that after having done so that this RectBounds instance is normalized.voidsetBoundsAndSort(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) voidsetBoundsAndSort(Point2D p1, Point2D p2) Sets the bounds based on the given points, and also ensures that after having done so that this bounds instance is sorted (x1invalid input: '<'=x2 and y1invalid input: '<'=y2).voidsetMaxX(float maxX) voidsetMaxY(float maxY) voidsetMinX(float minX) voidsetMinY(float minY) protected voidtoString()voidtranslate(float x, float y, float z) voidunionWith(float minX, float minY, float maxX, float maxY) voidunionWith(RectBounds other) Methods inherited from class com.sun.javafx.geom.BaseBoundsgetInstance, getInstance
- 
Constructor Details- 
RectBoundspublic RectBounds()Create an axis aligned bounding rectangle object, with an empty bounds where maxX invalid input: '<' minX and maxY invalid input: '<' minY.
- 
RectBoundspublic RectBounds(float minX, float minY, float maxX, float maxY) Creates a RectBounds based on the minX, minY, maxX, and maxY values specified.
- 
RectBoundsCreates a RectBounds object as a copy of the specified RectBounds object.
 
- 
- 
Method Details- 
copyDescription copied from class:BaseBoundsDuplicates this instance. This differs from deriveWithNewBounds(other) where "other" would be this, in that derive methods may return the same instance, whereas copy will always return a new instance.- Specified by:
- copyin class- BaseBounds
 
- 
getBoundsTypeCreates a RectBounds object as a copy of the specified RECTANGLE.- Specified by:
- getBoundsTypein class- BaseBounds
 
- 
is2Dpublic boolean is2D()Description copied from class:BaseBoundsReturn true if this bounds is of a 2D BoundsType, else false.- Specified by:
- is2Din class- BaseBounds
 
- 
getWidthpublic float getWidth()Convenience function for getting the width of this RectBounds. The dimension along the X-Axis.- Specified by:
- getWidthin class- BaseBounds
 
- 
getHeightpublic float getHeight()Convenience function for getting the height of this RectBounds The dimension along the Y-Axis.- Specified by:
- getHeightin class- BaseBounds
 
- 
getDepthpublic float getDepth()Convenience function for getting the depth of this RectBounds The dimension along the Z-Axis, since this is a 2D bounds the return value is always 0f.- Specified by:
- getDepthin class- BaseBounds
 
- 
getMinXpublic float getMinX()- Specified by:
- getMinXin class- BaseBounds
 
- 
setMinXpublic void setMinX(float minX) 
- 
getMinYpublic float getMinY()- Specified by:
- getMinYin class- BaseBounds
 
- 
setMinYpublic void setMinY(float minY) 
- 
getMinZpublic float getMinZ()- Specified by:
- getMinZin class- BaseBounds
 
- 
getMaxXpublic float getMaxX()- Specified by:
- getMaxXin class- BaseBounds
 
- 
setMaxXpublic void setMaxX(float maxX) 
- 
getMaxYpublic float getMaxY()- Specified by:
- getMaxYin class- BaseBounds
 
- 
setMaxYpublic void setMaxY(float maxY) 
- 
getMaxZpublic float getMaxZ()- Specified by:
- getMaxZin class- BaseBounds
 
- 
deriveWithUnion- Specified by:
- deriveWithUnionin class- BaseBounds
 
- 
deriveWithNewBounds- Specified by:
- deriveWithNewBoundsin class- BaseBounds
 
- 
deriveWithNewBoundspublic BaseBounds deriveWithNewBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) - Specified by:
- deriveWithNewBoundsin class- BaseBounds
 
- 
deriveWithNewBoundsAndSortpublic BaseBounds deriveWithNewBoundsAndSort(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) - Specified by:
- deriveWithNewBoundsAndSortin class- BaseBounds
 
- 
setBoundsSet the bounds to match that of the RectBounds object specified. The specified bounds object must not be null.
- 
setBoundspublic final void setBounds(float minX, float minY, float maxX, float maxY) Set the bounds to the given values.
- 
setBoundsAndSortpublic void setBoundsAndSort(float minX, float minY, float maxX, float maxY) Sets the bounds based on the given coords, and also ensures that after having done so that this RectBounds instance is normalized.
- 
setBoundsAndSortpublic void setBoundsAndSort(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) - Specified by:
- setBoundsAndSortin class- BaseBounds
 
- 
setBoundsAndSortDescription copied from class:BaseBoundsSets the bounds based on the given points, and also ensures that after having done so that this bounds instance is sorted (x1invalid input: '<'=x2 and y1invalid input: '<'=y2).- Specified by:
- setBoundsAndSortin class- BaseBounds
 
- 
flattenIntoDescription copied from class:BaseBoundsSets the given RectBounds (or creates a new instance of bounds is null) to have the minX, minY, maxX, and maxY of this BoxBounds, dropping the Z values.- Specified by:
- flattenIntoin class- BaseBounds
- Parameters:
- bounds- The bounds to fill with values, or null. If null, a new RectBounds is returned. If not null, the given bounds will be populated and then returned
- Returns:
- a non-null reference to a RectBounds containing the minX, minY, maxX, and maxY of this BoxBounds.
 
- 
unionWith
- 
unionWithpublic void unionWith(float minX, float minY, float maxX, float maxY) 
- 
addpublic void add(float x, float y, float z) - Specified by:
- addin class- BaseBounds
 
- 
addpublic void add(float x, float y) 
- 
add- Specified by:
- addin class- BaseBounds
 
- 
intersectWith- Specified by:
- intersectWithin class- BaseBounds
 
- 
intersectWithpublic void intersectWith(float minX, float minY, float maxX, float maxY) 
- 
intersectWithpublic void intersectWith(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) - Specified by:
- intersectWithin class- BaseBounds
 
- 
contains- Specified by:
- containsin class- BaseBounds
 
- 
containspublic boolean contains(float x, float y) - Specified by:
- containsin class- BaseBounds
 
- 
containsDetermines whether the givenotherRectBounds is completely contained within this RectBounds. Equivalent RectBounds will return true.- Parameters:
- other- The other rect bounds to check against.
- Returns:
- Whether the other rect bounds is contained within this one, which also includes equivalence.
 
- 
intersectspublic boolean intersects(float x, float y, float width, float height) - Specified by:
- intersectsin class- BaseBounds
 
- 
intersects
- 
disjointpublic boolean disjoint(float x, float y, float width, float height) - Specified by:
- disjointin class- BaseBounds
 
- 
disjoint
- 
isEmptypublic boolean isEmpty()- Specified by:
- isEmptyin class- BaseBounds
 
- 
roundOutpublic void roundOut()Adjusts the edges of this RectBounds "outward" toward integral boundaries, such that the rounded bounding box will always full enclose the original bounding box.- Specified by:
- roundOutin class- BaseBounds
 
- 
growpublic void grow(float h, float v) 
- 
deriveWithPadding- Specified by:
- deriveWithPaddingin class- BaseBounds
 
- 
makeEmpty- Specified by:
- makeEmptyin class- BaseBounds
 
- 
sortMinMaxprotected void sortMinMax()- Specified by:
- sortMinMaxin class- BaseBounds
 
- 
translatepublic void translate(float x, float y, float z) - Specified by:
- translatein class- BaseBounds
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-