Class BoundingBox
- javafx.geometry.Bounds
-
- javafx.geometry.BoundingBox
public class BoundingBox extends Bounds
Since:
JavaFX 2.0
-
Constructor Summary
Constructors Constructor and Description BoundingBox(double minX, double minY, double width, double height)Creates a new instance of 2DBoundingBox.BoundingBox(double minX, double minY, double minZ, double width, double height, double depth)Creates a new instance of 3DBoundingBox.
-
Method Summary
All MethodsInstance MethodsConcrete Methods Modifier and Type Method and Description booleancontains(Bounds b)Tests if the interior of thisBoundsentirely contains the specified Bounds,b.booleancontains(double x, double y)Tests if the specified(x, y)coordinates are inside the boundary ofBounds.booleancontains(double x, double y, double z)Tests if the specified(x, y, z)coordinates are inside the boundary ofBounds.booleancontains(double x, double y, double w, double h)Tests if the interior of thisBoundsentirely contains the specified rectangular area.booleancontains(double x, double y, double z, double w, double h, double d)Tests if the interior of thisBoundsentirely contains the specified rectangular area.booleancontains(Point2D p)Tests if the specified point is inside the boundary ofBounds.booleancontains(Point3D p)Tests if the specified point is inside the boundary ofBounds.booleanequals(Object obj)Indicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for the object.booleanintersects(Bounds b)Tests if the interior of thisBoundsintersects the interior of a specified Bounds,b.booleanintersects(double x, double y, double w, double h)Tests if the interior of thisBoundsintersects the interior of a specified rectangular area.booleanintersects(double x, double y, double z, double w, double h, double d)Tests if the interior of thisBoundsintersects the interior of a specified rectangular area.booleanisEmpty()Indicates whether any of the dimensions(width, height or depth) of this bounds is less than zero.StringtoString()Returns a string representation of thisBoundingBox.
-
Constructor Detail
-
BoundingBox
public BoundingBox(double minX, double minY, double minZ, double width, double height, double depth)Creates a new instance of 3DBoundingBox.Parameters:
minX- the X coordinate of the upper-left corner
-
BoundingBox
public BoundingBox(double minX, double minY, double width, double height)Creates a new instance of 2DBoundingBox.Parameters:
minX- the X coordinate of the upper-left corner
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Indicates whether any of the dimensions(width, height or depth) of this bounds is less than zero.
-
contains
public boolean contains(Point2D p)
Tests if the specified point is inside the boundary ofBounds. The points on the boundary are considered to lie inside theBoundingBox.
-
contains
public boolean contains(Point3D p)
Tests if the specified point is inside the boundary ofBounds. The points on the boundary are considered to lie inside theBoundingBox.
-
contains
public boolean contains(double x, double y)Tests if the specified(x, y)coordinates are inside the boundary ofBounds. The points on the boundary are considered to lie inside theBoundingBox.
-
contains
public boolean contains(double x, double y, double z)Tests if the specified(x, y, z)coordinates are inside the boundary ofBounds. The points on the boundary are considered to lie inside theBoundingBox.
-
contains
public boolean contains(Bounds b)
Tests if the interior of thisBoundsentirely contains the specified Bounds,b. The points on the boundary are considered to lie inside theBoundingBox.
-
contains
public boolean contains(double x, double y, double w, double h)Tests if the interior of thisBoundsentirely contains the specified rectangular area. The points on the boundary are considered to lie inside theBoundingBox.
-
contains
public boolean contains(double x, double y, double z, double w, double h, double d)Tests if the interior of thisBoundsentirely contains the specified rectangular area. The points on the boundary are considered to lie inside theBoundingBox.
-
intersects
public boolean intersects(Bounds b)
Tests if the interior of thisBoundsintersects the interior of a specified Bounds,b.Specified by:
intersectsin classBoundsParameters:
b- The specified BoundsReturns:
true if the interior of this
Boundsand the interior of the specified Bounds,b, intersect.
-
intersects
public boolean intersects(double x, double y, double w, double h)Tests if the interior of thisBoundsintersects the interior of a specified rectangular area.Specified by:
intersectsin classBoundsParameters:
x- the x coordinate of the upper-left corner of the specified rectangular areaReturns:
true if the interior of this
Boundsand the interior of the rectangular area intersect.
-
intersects
public boolean intersects(double x, double y, double z, double w, double h, double d)Tests if the interior of thisBoundsintersects the interior of a specified rectangular area.Specified by:
intersectsin classBoundsParameters:
x- the x coordinate of the upper-left corner of the specified rectangular volumeReturns:
true if the interior of this
Boundsand the interior of the rectangular area intersect.
-
equals
public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.
-
hashCode
public int hashCode()
Returns a hash code value for the object.
-
toString
public String toString()
Returns a string representation of thisBoundingBox. This method is intended to be used only for informational purposes. The content and format of the returned string might getMary between implementations. The returned string might be empty but cannot benull.
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.