Skip to content

BoundingBox

final class BoundingBox
Package: dev.joid.lib.utils.geom · Module: core · Source: BoundingBox.java

Mutable rectangle stored by its minimum and maximum corners, in design pixels.

expand(...) and contract(...) change this box; copy() first to keep the original.

ReturnsSignatureSummary
BoundingBoxcreate(double x, double y, double width, double height) factoryReturns the box whose top-left corner is (x, y) and whose size is width × height.

ReturnsSignatureSummary
doublegetWidth()Returns the width, maxX - minX.
doublegetHeight()Returns the height, maxY - minY.
ReturnsSignatureSummary
doublegetMinX()Returns the left edge.
doublegetMinY()Returns the top edge.
doublegetMaxX()Returns the right edge.
doublegetMaxY()Returns the bottom edge.
ReturnsSignatureSummary
BoundingBoxcopy()Returns another box with the same corners.
thisexpand(double value) fluentMoves every side outward by value, then returns this box.
thiscontract(double value) fluentMoves every side inward by value, then returns this box.
voidsetMinX(double minX)Moves the left edge.
voidsetMinY(double minY)Moves the top edge.
voidsetMaxX(double maxX)Moves the right edge.
voidsetMaxY(double maxY)Moves the bottom edge.
booleanequals(Object other)If true, the other object is a box with the same four edges.
inthashCode()Returns a hash of the values that equals compares.

BoundingBox create(double x, double y, double width, double height) factory

Returns the box whose top-left corner is (x, y) and whose size is width × height.

double getWidth()

Returns the width, maxX - minX.

double getHeight()

Returns the height, maxY - minY.

double getMinX()

Returns the left edge.

double getMinY()

Returns the top edge.

double getMaxX()

Returns the right edge.

double getMaxY()

Returns the bottom edge.

BoundingBox copy()

Returns another box with the same corners.

this expand(double value) fluent

Moves every side outward by value, then returns this box.

this contract(double value) fluent

Moves every side inward by value, then returns this box.

void setMinX(double minX)

Moves the left edge.

void setMinY(double minY)

Moves the top edge.

void setMaxX(double maxX)

Moves the right edge.

void setMaxY(double maxY)

Moves the bottom edge.

boolean equals(Object other)

If true, the other object is a box with the same four edges.

int hashCode()

Returns a hash of the values that equals compares.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page