pivot.wtk
Class Bounds

java.lang.Object
  extended by pivot.wtk.Bounds

public class Bounds
extends java.lang.Object

Class representing the bounds of an object.

Author:
gbrown

Field Summary
 int height
           
static java.lang.String HEIGHT_KEY
           
 int width
           
static java.lang.String WIDTH_KEY
           
 int x
           
static java.lang.String X_KEY
           
 int y
           
static java.lang.String Y_KEY
           
 
Constructor Summary
Bounds()
           
Bounds(Bounds bounds)
           
Bounds(Dictionary<java.lang.String,?> bounds)
           
Bounds(int x, int y, int width, int height)
           
Bounds(Point origin, Dimensions size)
           
Bounds(java.awt.Rectangle rectangle)
           
 
Method Summary
 boolean contains(Bounds bounds)
           
 boolean contains(int x, int y)
           
 boolean contains(int x, int y, int width, int height)
           
 boolean contains(Point point)
           
 boolean equals(java.lang.Object object)
           
 Point getLocation()
           
 Dimensions getSize()
           
 void intersect(Bounds bounds)
           
 boolean intersects(Bounds bounds)
           
 boolean intersects(int x, int y, int width, int height)
           
 boolean isEmpty()
           
 java.awt.Rectangle toRectangle()
           
 java.lang.String toString()
           
 void translate(int dx, int dy)
           
 void union(Bounds bounds)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public int x

y

public int y

width

public int width

height

public int height

X_KEY

public static final java.lang.String X_KEY
See Also:
Constant Field Values

Y_KEY

public static final java.lang.String Y_KEY
See Also:
Constant Field Values

WIDTH_KEY

public static final java.lang.String WIDTH_KEY
See Also:
Constant Field Values

HEIGHT_KEY

public static final java.lang.String HEIGHT_KEY
See Also:
Constant Field Values
Constructor Detail

Bounds

public Bounds()

Bounds

public Bounds(Dictionary<java.lang.String,?> bounds)

Bounds

public Bounds(int x,
              int y,
              int width,
              int height)

Bounds

public Bounds(Point origin,
              Dimensions size)

Bounds

public Bounds(Bounds bounds)

Bounds

public Bounds(java.awt.Rectangle rectangle)
Method Detail

getLocation

public Point getLocation()

getSize

public Dimensions getSize()

union

public void union(Bounds bounds)

intersect

public void intersect(Bounds bounds)

translate

public void translate(int dx,
                      int dy)

contains

public boolean contains(Point point)

contains

public boolean contains(int x,
                        int y)

contains

public boolean contains(Bounds bounds)

contains

public boolean contains(int x,
                        int y,
                        int width,
                        int height)

intersects

public boolean intersects(Bounds bounds)

intersects

public boolean intersects(int x,
                          int y,
                          int width,
                          int height)

isEmpty

public boolean isEmpty()

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

toRectangle

public java.awt.Rectangle toRectangle()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object