Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Bounds

[15:7] extends: FxObj

Wraps JavaFX Bounds, an immutable rectangular (2D) or box (3D) region described by a minimum corner and a size. Bounds is returned by the Node bounds accessors (getBoundsInParent, getBoundsInLocal, getLayoutBounds) and the bounds-based coordinate transforms. New instances are backed by a BoundingBox; adopted instances keep whatever concrete Bounds they wrap.

Methods

  • Bounds (MinX = null, MinY = null, Width = null, Height = null)

    Creates a new 2D Bounds from a minimum corner and a size, or wraps an existing Bounds AJO passed as the first argument.

    • @p MinX is the minimum x, or a Bounds AJO to wrap.
    • @p MinY is the minimum y.
    • @p Width is the width.
    • @p Height is the height.
  • getMinX ()

    Returns the minimum x coordinate.

    • @r A double with the minimum x.
  • getMinY ()

    Returns the minimum y coordinate.

    • @r A double with the minimum y.
  • getMinZ ()

    Returns the minimum z coordinate (0.0 for a 2D bounds).

    • @r A double with the minimum z.
  • getWidth ()

    Returns the width of the bounds.

    • @r A double with the width.
  • getHeight ()

    Returns the height of the bounds.

    • @r A double with the height.
  • getDepth ()

    Returns the depth of the bounds (0.0 for a 2D bounds).

    • @r A double with the depth.
  • getMaxX ()

    Returns the maximum x coordinate.

    • @r A double with the maximum x.
  • getMaxY ()

    Returns the maximum y coordinate.

    • @r A double with the maximum y.
  • getMaxZ ()

    Returns the maximum z coordinate (0.0 for a 2D bounds).

    • @r A double with the maximum z.
  • isEmpty ()

    Returns true when the bounds are empty (width or height negative).

    • @r A bool that is true when empty.
  • contains (double X, double Y)

    Returns true when the point (X, Y) lies inside these bounds.

    • @p X is a double with the x coordinate to test.
    • @p Y is a double with the y coordinate to test.
    • @r A bool that is true when the point is contained.
  • intersects (object Other)

    Returns true when these bounds intersect Other.

    • @p Other is a Bounds to test against.
    • @r A bool that is true when the bounds intersect.