40package com.jogamp.opengl.util.packrect;
69 private Object userData;
74 private Rect nextLocation;
80 public Rect(
final Object userData) {
81 this(0, 0, 0, 0, userData);
84 public Rect(
final int x,
final int y,
final int w,
final int h,
final Object userData) {
90 public int x() {
return x; }
91 public int y() {
return y; }
92 public int w() {
return w; }
93 public int h() {
return h; }
99 throw new IllegalArgumentException(
"Negative x");
101 throw new IllegalArgumentException(
"Negative y");
106 public void setSize(
final int w,
final int h)
throws IllegalArgumentException {
108 throw new IllegalArgumentException(
"Negative width");
110 throw new IllegalArgumentException(
"Negative height");
128 return x() + w() - 1;
139 return y() + h() - 1;
143 return (w() >= other.w() &&
149 return "[Rect x: " + x() +
" y: " + y() +
" w: " + w() +
" h: " + h() +
"]";
Represents a rectangular region on the backing store.
void setPosition(final int x, final int y)
boolean canContain(final Rect other)
int maxX()
Returns the maximum x-coordinate contained within this rectangle.
void setUserData(final Object obj)
int maxY()
Returns the maximum y-coordinate contained within this rectangle.
Rect(final Object userData)
void setNextLocation(final Rect nextLocation)
Rect(final int x, final int y, final int w, final int h, final Object userData)
void setSize(final int w, final int h)