org.apache.pivot.wtk
Class Bounds

java.lang.Object
  extended by org.apache.pivot.wtk.Bounds
All Implemented Interfaces:
Serializable

public final class Bounds
extends Object
implements Serializable

Class representing the bounds of an object.

See Also:
Serialized Form

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 xArgument, int yArgument)
           
 boolean contains(int xArgument, int yArgument, int widthArgument, int heightArgument)
           
 boolean contains(Point point)
           
static Bounds decode(String value)
           
 boolean equals(Object object)
           
 Point getLocation()
           
 Dimensions getSize()
           
 int hashCode()
           
 Bounds intersect(Bounds bounds)
           
 Bounds intersect(int xArgument, int yArgument, int widthArgument, int heightArgument)
           
 Bounds intersect(Rectangle rect)
           
 boolean intersects(Bounds bounds)
           
 boolean intersects(int xArgument, int yArgument, int widthArgument, int heightArgument)
           
 boolean isEmpty()
           
 Rectangle toRectangle()
           
 String toString()
           
 Bounds translate(int dx, int dy)
           
 Bounds translate(Point offset)
           
 Bounds union(Bounds bounds)
           
 Bounds union(int xArgument, int yArgument, int widthArgument, int heightArgument)
           
 
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(int xArgument,
                    int yArgument,
                    int widthArgument,
                    int heightArgument)

union

public Bounds union(Bounds bounds)

intersect

public Bounds intersect(int xArgument,
                        int yArgument,
                        int widthArgument,
                        int heightArgument)

intersect

public Bounds intersect(Bounds bounds)

intersect

public Bounds intersect(Rectangle rect)

translate

public Bounds translate(int dx,
                        int dy)

translate

public Bounds translate(Point offset)

contains

public boolean contains(Point point)

contains

public boolean contains(int xArgument,
                        int yArgument)

contains

public boolean contains(Bounds bounds)

contains

public boolean contains(int xArgument,
                        int yArgument,
                        int widthArgument,
                        int heightArgument)

intersects

public boolean intersects(Bounds bounds)

intersects

public boolean intersects(int xArgument,
                          int yArgument,
                          int widthArgument,
                          int heightArgument)

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

decode

public static Bounds decode(String value)