Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.opengl.util.packrect
Class Rect

    java.lang.Object
      com.sun.opengl.util.packrect.Rect

    public class Rect

extends Object

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.

Constructor Summary
`Rect()`
`Rect(int x, int y, int w, int h, Object userData)`
`Rect(Object userData)`

Method Summary
`boolean` | `canContain(Rect other)`
`Rect` | `getNextLocation()`
`Object` | `getUserData()`
`int` | `h()`
`int` | `maxX()` Returns the maximum x-coordinate contained within this rectangle.
`int` | `maxY()` Returns the maximum y-coordinate contained within this rectangle.
`void` | `setNextLocation(Rect nextLocation)`
`void` | `setPosition(int x, int y)`
`void` | `setSize(int w, int h)`
`void` | `setUserData(Object obj)`
`String` | `toString()`
`int` | `w()`
`int` | `x()`
`int` | `y()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Rect

    public Rect()

### Rect

    public Rect(Object userData)

### Rect

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

Method Detail

### x

    public int x()

### y

    public int y()

### w

    public int w()

### h

    public int h()

### getUserData

    public Object getUserData()

### getNextLocation

    public Rect getNextLocation()

### setPosition

    public void setPosition(int x,
                            int y)

### setSize

    public void setSize(int w,
                        int h)
                 throws IllegalArgumentException

  Throws:
    `IllegalArgumentException`

### setUserData

    public void setUserData(Object obj)

### setNextLocation

    public void setNextLocation(Rect nextLocation)

### maxX

    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.

### maxY

    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.

### canContain

    public boolean canContain(Rect other)

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.