JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.nativewindow.util.Rectangle Class Reference
Inheritance diagram for com.jogamp.nativewindow.util.Rectangle:
Collaboration diagram for com.jogamp.nativewindow.util.Rectangle:

Public Member Functions

 Rectangle ()
 
 Rectangle (final int x, final int y, final int width, final int height)
 
 Rectangle (final RectangleImmutable s)
 
Object cloneMutable ()
 
final int getX ()
 x-position, left of rectangle. More...
 
final int getY ()
 y-position, top of rectangle. More...
 
final int getWidth ()
 
final int getHeight ()
 
final Rectangle set (final int x, final int y, final int width, final int height)
 
final Rectangle set (final RectangleImmutable s)
 
final Rectangle setX (final int x)
 
final Rectangle setY (final int y)
 
final Rectangle setWidth (final int width)
 
final Rectangle setHeight (final int height)
 
final Rectangle union (final RectangleImmutable r)
 Returns a new Rectangle instance containing the union of this rectangle and the given rectangle. More...
 
final Rectangle union (final int rx1, final int ry1, final int rx2, final int ry2)
 Returns a new Rectangle instance containing the union of this rectangle and the given coordinates. More...
 
final Rectangle union (final List< RectangleImmutable > rectangles)
 Calculates the union of the given rectangles, stores it in this instance and returns this instance. More...
 
final Rectangle intersection (final RectangleImmutable r)
 Returns a new Rectangle instance containing the intersection of this rectangle and the given rectangle. More...
 
final Rectangle intersection (final int rx1, final int ry1, final int rx2, final int ry2)
 Returns a new Rectangle instance containing the intersection of this rectangle and the given coordinates. More...
 
final float coverage (final RectangleImmutable r)
 Returns the coverage of given rectangle w/ this this one, i.e. More...
 
final boolean contains (final RectangleImmutable r)
 
final Rectangle scale (final int sx, final int sy)
 Scale this instance's components, i.e. More...
 
final Rectangle scale (final float sx, final float sy)
 Scale this instance's components, i.e. More...
 
final Rectangle scaleInv (final int sx, final int sy)
 Inverse scale this instance's components, i.e. More...
 
final Rectangle scaleInv (final float sx, final float sy)
 Inverse scale this instance's components, i.e. More...
 
int compareTo (final RectangleImmutable d)
 
boolean equals (final Object obj)
 Checks whether two rect objects are equal. More...
 
int hashCode ()
 
String toString ()
 
int getHeight ()
 
int getWidth ()
 
int getX ()
 x-position, left of rectangle. More...
 
int getY ()
 y-position, top of rectangle. More...
 
Rectangle union (final RectangleImmutable r)
 Returns a new Rectangle instance containing the union of this rectangle and the given rectangle. More...
 
Rectangle union (final int rx1, final int ry1, final int rx2, final int ry2)
 Returns a new Rectangle instance containing the union of this rectangle and the given coordinates. More...
 
Rectangle union (final List< RectangleImmutable > rectangles)
 Calculates the union of the given rectangles, stores it in this instance and returns this instance. More...
 
Rectangle intersection (RectangleImmutable r)
 Returns a new Rectangle instance containing the intersection of this rectangle and the given rectangle. More...
 
Rectangle intersection (final int rx1, final int ry1, final int rx2, final int ry2)
 Returns a new Rectangle instance containing the intersection of this rectangle and the given coordinates. More...
 
float coverage (RectangleImmutable r)
 Returns the coverage of given rectangle w/ this this one, i.e. More...
 
boolean contains (RectangleImmutable r)
 
int compareTo (final RectangleImmutable d)
 
boolean equals (Object obj)
 Checks whether two rect objects are equal. More...
 
int hashCode ()
 

Protected Member Functions

Object clone ()
 

Detailed Description

Definition at line 33 of file Rectangle.java.

Constructor & Destructor Documentation

◆ Rectangle() [1/3]

com.jogamp.nativewindow.util.Rectangle.Rectangle ( )

Definition at line 39 of file Rectangle.java.

Here is the caller graph for this function:

◆ Rectangle() [2/3]

com.jogamp.nativewindow.util.Rectangle.Rectangle ( final int  x,
final int  y,
final int  width,
final int  height 
)

Definition at line 43 of file Rectangle.java.

◆ Rectangle() [3/3]

com.jogamp.nativewindow.util.Rectangle.Rectangle ( final RectangleImmutable  s)

Definition at line 49 of file Rectangle.java.

Member Function Documentation

◆ clone()

Object com.jogamp.nativewindow.util.Rectangle.clone ( )
protected

Definition at line 59 of file Rectangle.java.

Here is the caller graph for this function:

◆ cloneMutable()

Object com.jogamp.nativewindow.util.Rectangle.cloneMutable ( )

Definition at line 54 of file Rectangle.java.

Here is the call graph for this function:

◆ compareTo()

int com.jogamp.nativewindow.util.Rectangle.compareTo ( final RectangleImmutable  d)

Compares square of size 1st, if equal the square of position.

Compares square of size 1st, if equal the square of position.

Implements com.jogamp.nativewindow.util.RectangleImmutable.

Definition at line 232 of file Rectangle.java.

Here is the call graph for this function:

◆ contains()

final boolean com.jogamp.nativewindow.util.Rectangle.contains ( final RectangleImmutable  r)

Implements com.jogamp.nativewindow.util.RectangleImmutable.

Definition at line 157 of file Rectangle.java.

Here is the call graph for this function:

◆ coverage()

final float com.jogamp.nativewindow.util.Rectangle.coverage ( final RectangleImmutable  r)

Returns the coverage of given rectangle w/ this this one, i.e.

between 0.0 and 1.0.

Coverage is computed by:

   isect = this.intersection(r);
   coverage = area( isect ) / area( this ) ;

Implements com.jogamp.nativewindow.util.RectangleImmutable.

Definition at line 149 of file Rectangle.java.

Here is the call graph for this function:

◆ equals()

boolean com.jogamp.nativewindow.util.Rectangle.equals ( final Object  obj)

Checks whether two rect objects are equal.

Two instances of Rectangle are equal if the four integer values of the fields y, x, height, and width are all equal.

Returns
true if the two rectangles are equal; otherwise false.

Implements com.jogamp.nativewindow.util.RectangleImmutable.

Definition at line 258 of file Rectangle.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getHeight()

final int com.jogamp.nativewindow.util.Rectangle.getHeight ( )

Implements com.jogamp.nativewindow.util.RectangleImmutable.

Definition at line 74 of file Rectangle.java.

Here is the caller graph for this function:

◆ getWidth()

final int com.jogamp.nativewindow.util.Rectangle.getWidth ( )

Implements com.jogamp.nativewindow.util.RectangleImmutable.

Definition at line 72 of file Rectangle.java.

Here is the caller graph for this function:

◆ getX()

final int com.jogamp.nativewindow.util.Rectangle.getX ( )

x-position, left of rectangle.

Implements com.jogamp.nativewindow.util.RectangleImmutable.

Definition at line 68 of file Rectangle.java.

Here is the caller graph for this function:

◆ getY()

final int com.jogamp.nativewindow.util.Rectangle.getY ( )

y-position, top of rectangle.

Implements com.jogamp.nativewindow.util.RectangleImmutable.

Definition at line 70 of file Rectangle.java.

Here is the caller graph for this function:

◆ hashCode()

int com.jogamp.nativewindow.util.Rectangle.hashCode ( )

Implements com.jogamp.nativewindow.util.RectangleImmutable.

Definition at line 269 of file Rectangle.java.

◆ intersection() [1/2]

final Rectangle com.jogamp.nativewindow.util.Rectangle.intersection ( final int  rx1,
final int  ry1,
final int  rx2,
final int  ry2 
)

Returns a new Rectangle instance containing the intersection of this rectangle and the given coordinates.

Implements com.jogamp.nativewindow.util.RectangleImmutable.

Definition at line 126 of file Rectangle.java.

Here is the call graph for this function:

◆ intersection() [2/2]

final Rectangle com.jogamp.nativewindow.util.Rectangle.intersection ( final RectangleImmutable  r)

Returns a new Rectangle instance containing the intersection of this rectangle and the given rectangle.

Implements com.jogamp.nativewindow.util.RectangleImmutable.

Definition at line 122 of file Rectangle.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scale() [1/2]

final Rectangle com.jogamp.nativewindow.util.Rectangle.scale ( final float  sx,
final float  sy 
)

Scale this instance's components, i.e.

multiply them by the given scale factors (rounded).

Parameters
sxscale factor for x
syscale factor for y
Returns
this instance for scaling

Definition at line 193 of file Rectangle.java.

◆ scale() [2/2]

final Rectangle com.jogamp.nativewindow.util.Rectangle.scale ( final int  sx,
final int  sy 
)

Scale this instance's components, i.e.

multiply them by the given scale factors.

Parameters
sxscale factor for x
syscale factor for y
Returns
this instance for scaling

Definition at line 178 of file Rectangle.java.

◆ scaleInv() [1/2]

final Rectangle com.jogamp.nativewindow.util.Rectangle.scaleInv ( final float  sx,
final float  sy 
)

Inverse scale this instance's components, i.e.

divide them by the given scale factors (rounded).

Parameters
sxinverse scale factor for x
syinverse scale factor for y
Returns
this instance for scaling

Definition at line 223 of file Rectangle.java.

◆ scaleInv() [2/2]

final Rectangle com.jogamp.nativewindow.util.Rectangle.scaleInv ( final int  sx,
final int  sy 
)

Inverse scale this instance's components, i.e.

divide them by the given scale factors.

Parameters
sxinverse scale factor for x
syinverse scale factor for y
Returns
this instance for scaling

Definition at line 208 of file Rectangle.java.

◆ set() [1/2]

final Rectangle com.jogamp.nativewindow.util.Rectangle.set ( final int  x,
final int  y,
final int  width,
final int  height 
)

Definition at line 76 of file Rectangle.java.

Here is the caller graph for this function:

◆ set() [2/2]

final Rectangle com.jogamp.nativewindow.util.Rectangle.set ( final RectangleImmutable  s)

Definition at line 83 of file Rectangle.java.

Here is the call graph for this function:

◆ setHeight()

final Rectangle com.jogamp.nativewindow.util.Rectangle.setHeight ( final int  height)

Definition at line 93 of file Rectangle.java.

◆ setWidth()

final Rectangle com.jogamp.nativewindow.util.Rectangle.setWidth ( final int  width)

Definition at line 92 of file Rectangle.java.

◆ setX()

final Rectangle com.jogamp.nativewindow.util.Rectangle.setX ( final int  x)

Definition at line 90 of file Rectangle.java.

◆ setY()

final Rectangle com.jogamp.nativewindow.util.Rectangle.setY ( final int  y)

Definition at line 91 of file Rectangle.java.

◆ toString()

String com.jogamp.nativewindow.util.Rectangle.toString ( )

Definition at line 279 of file Rectangle.java.

◆ union() [1/3]

final Rectangle com.jogamp.nativewindow.util.Rectangle.union ( final int  rx1,
final int  ry1,
final int  rx2,
final int  ry2 
)

Returns a new Rectangle instance containing the union of this rectangle and the given coordinates.

Implements com.jogamp.nativewindow.util.RectangleImmutable.

Definition at line 100 of file Rectangle.java.

Here is the call graph for this function:

◆ union() [2/3]

final Rectangle com.jogamp.nativewindow.util.Rectangle.union ( final List< RectangleImmutable rectangles)

Calculates the union of the given rectangles, stores it in this instance and returns this instance.

Parameters
rectanglesgiven list of rectangles
Returns
this instance holding the union of given rectangles.

Implements com.jogamp.nativewindow.util.RectangleImmutable.

Definition at line 108 of file Rectangle.java.

Here is the call graph for this function:

◆ union() [3/3]

final Rectangle com.jogamp.nativewindow.util.Rectangle.union ( final RectangleImmutable  r)

Returns a new Rectangle instance containing the union of this rectangle and the given rectangle.

Implements com.jogamp.nativewindow.util.RectangleImmutable.

Definition at line 96 of file Rectangle.java.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: