com.google.gwt.maps.client.geom
Class Bounds

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.google.gwt.maps.client.geom.Bounds

public class Bounds
extends com.google.gwt.core.client.JavaScriptObject

Represents a rectangular bound. A Bounds is defined by minimum and maximum X and Y coordinates on a plane.


Constructor Summary
protected Bounds()
           
 
Method Summary
 boolean containsBounds(Bounds other)
          Returns true if the passed rectangular area is entirely contained in this rectangular area.
 boolean containsPoint(Point p)
          Returns true if the rectangular area (inclusively) contains the pixel coordinates.
 void extend(Point point)
          Enlarges this box so that the point is also contained in this box.
 Point getCenter()
          Returns the pixel coordinates of the center of the rectangular area.
 Point getLowerRight()
          Returns the pixel coordinates of the lower right corner of the rectangular area.
 int getMaxX()
          Returns the x coordinate of the right edge of the rectangle.
 int getMaxY()
          Returns the y coordinate of the bottom edge of the rectangle.
 int getMinX()
          Returns the x coordinate of the left edge of the rectangle.
 int getMinY()
          Returns the y coordinate of the top edge of the rectangle.
 Point getUpperLeft()
          Returns the pixel coordinates of the upper left corner of the rectangular area.
static Bounds newInstance(int minX, int minY, int maxX, int maxY)
           
static Bounds newInstance(com.google.gwt.core.client.JsArray<Point> points)
          A Bounds is defined by minimum and maximum X and Y coordinates on a plane.
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Bounds

protected Bounds()
Method Detail

newInstance

public static final Bounds newInstance(com.google.gwt.core.client.JsArray<Point> points)
A Bounds is defined by minimum and maximum X and Y coordinates on a plane.

Parameters:
points -

newInstance

public static final Bounds newInstance(int minX,
                                       int minY,
                                       int maxX,
                                       int maxY)

containsBounds

public final boolean containsBounds(Bounds other)
Returns true if the passed rectangular area is entirely contained in this rectangular area.

Parameters:
other - the bound to compare.
Returns:
true if the passed rectangular area is entirely contained in this rectangular area.

containsPoint

public final boolean containsPoint(Point p)
Returns true if the rectangular area (inclusively) contains the pixel coordinates.

Parameters:
p - the point to compare.
Returns:
true if the rectangular area (inclusively) contains the pixel coordinates.

extend

public final void extend(Point point)
Enlarges this box so that the point is also contained in this box.

Parameters:
point - the point to add to the bound.

getCenter

public final Point getCenter()
Returns the pixel coordinates of the center of the rectangular area.

Returns:
the pixel coordinates of the center of the rectangular area.

getLowerRight

public final Point getLowerRight()
Returns the pixel coordinates of the lower right corner of the rectangular area.

Returns:
the pixel coordinates of the lower right corner of the rectangular area.

getMaxX

public final int getMaxX()
Returns the x coordinate of the right edge of the rectangle.

Returns:
the x coordinate of the right edge of the rectangle.

getMaxY

public final int getMaxY()
Returns the y coordinate of the bottom edge of the rectangle.

Returns:
the y coordinate of the bottom edge of the rectangle.

getMinX

public final int getMinX()
Returns the x coordinate of the left edge of the rectangle.

Returns:
the x coordinate of the left edge of the rectangle.

getMinY

public final int getMinY()
Returns the y coordinate of the top edge of the rectangle.

Returns:
the y coordinate of the top edge of the rectangle.

getUpperLeft

public final Point getUpperLeft()
Returns the pixel coordinates of the upper left corner of the rectangular area.

Returns:
the pixel coordinates of the upper left corner of the rectangular area.