Top Description Fields Constructors Methods
com.jogamp.opengl.util.packrect

public Class Rect

extends Object
Class Inheritance

Represents a rectangular region on the backing store. The edges of the rectangle are the infinitely thin region between adjacent pixels on the screen. The origin of the rectangle is its upper-left corner. It is inclusive of the pixels on the top and left edges and exclusive of the pixels on the bottom and right edges. For example, a rect at position (0, 0) and of size (1, 1) would include only the pixel at (0, 0).

Negative coordinates and sizes are not supported, since they make no sense in the context of the packer, which deals only with positively sized regions.

This class contains a user data field for efficient hookup to external data structures as well as enough other hooks to efficiently plug into the rectangle packer.

Field Summary

Modifier and TypeField and Description
private int
h

private Level
private Rect
private Object
private int
w

private int
x

private int
y

Constructor Summary

AccessConstructor and Description
public
Rect()

public
Rect(final Object userData)

public
Rect(final int x, final int y, final int w, final int h, final Object userData)

Method Summary

Modifier and TypeMethod and Description
public boolean
canContain(final Rect other)

public Rect
public Object
public int
h()

public int
maxX()

Returns the maximum x-coordinate contained within this rectangle.

public int
maxY()

Returns the maximum y-coordinate contained within this rectangle.

public void
setNextLocation(final Rect nextLocation)

public void
setPosition(final int x, final int y)

public void
setSize(final int w, final int h)

public void
setUserData(final Object obj)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public int
w()

public int
x()

public int
y()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

hback to summary
private int h
levelback to summary
private Level level
nextLocationback to summary
private Rect nextLocation
userDataback to summary
private Object userData
wback to summary
private int w
xback to summary
private int x
yback to summary
private int y

Constructor Detail

Rectback to summary
public Rect()
Rectback to summary
public Rect(final Object userData)
Rectback to summary
public Rect(final int x, final int y, final int w, final int h, final Object userData)

Method Detail

canContainback to summary
public boolean canContain(final Rect other)
getNextLocationback to summary
public Rect getNextLocation()
getUserDataback to summary
public Object getUserData()
hback to summary
public int h()
maxXback to summary
public int maxX()

Returns the maximum x-coordinate contained within this rectangle. Note that this returns a different result than Java 2D's rectangles; for a rectangle of position (0, 0) and size (1, 1) this will return 0, not 1. Returns -1 if the width of this rectangle is 0.

maxYback to summary
public int maxY()

Returns the maximum y-coordinate contained within this rectangle. Note that this returns a different result than Java 2D's rectangles; for a rectangle of position (0, 0) and size (1, 1) this will return 0, not 1. Returns -1 if the height of this rectangle is 0.

setNextLocationback to summary
public void setNextLocation(final Rect nextLocation)
setPositionback to summary
public void setPosition(final int x, final int y)
setSizeback to summary
public void setSize(final int w, final int h) throws IllegalArgumentException
setUserDataback to summary
public void setUserData(final Object obj)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
wback to summary
public int w()
xback to summary
public int x()
yback to summary
public int y()