pivot.wtk
Class Bounds

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

public final class Bounds
extends Object

Class representing the bounds of an object.

Author:
gbrown

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

Field Detail

x

public final int x

y

public final int y

width

public final int width

height

public final int height

X_KEY

public static final String X_KEY
See Also:
Constant Field Values

Y_KEY

public static final String Y_KEY
See Also:
Constant Field Values

WIDTH_KEY

public static final String WIDTH_KEY
See Also:
Constant Field Values

HEIGHT_KEY

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

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(Dictionary<String,?> bounds)

Bounds

public Bounds(Rectangle rectangle)
Method Detail

getLocation

public Point getLocation()

getSize

public Dimensions getSize()

union

public Bounds union(Bounds bounds)

intersect

public Bounds intersect(Bounds bounds)

translate

public Bounds 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(Object object)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toRectangle

public Rectangle toRectangle()

toString

public String toString()
Overrides:
toString in class Object