com.maryanovsky.gwtutils.client.geom
Interface RectangleView

All Known Implementing Classes:
Rectangle

public interface RectangleView

Provides a view of a Rectangle without allowing modifications.

Author:
Maryanovsky Alexander

Method Summary
 boolean contains(PointView point)
          Returns whether this rectangle contains the specified point.
 boolean contains(RectangleView rectangle)
          Returns whether this rectangle contains the specified one.
 int getBottom()
          Same as getY() + getHeight().
 PointView getBottomLeft()
          Returns the location of the bottom-left point of the rectangle.
 Point getBottomLeft(Point reusable)
          Returns the location of the bottom-left point of the rectangle.
 PointView getBottomRight()
          Returns the location of the bottom-right point of the rectangle.
 Point getBottomRight(Point reusable)
          Returns the location of the bottom-right point of the rectangle.
 PointView getCenter()
          Returns the location of the center of the rectangle.
 Point getCenter(Point reusable)
          Returns the location of the center of the rectangle, in the same manner as the getCenter() method.
 int getHeight()
          Returns the height of the rectangle.
 RectangleView getIntersection(RectangleView rectangle)
          Returns the intersection between this rectangle and the specified one.
 Rectangle getIntersection(RectangleView rectangle, Rectangle reusable)
          Returns the intersection between this rectangle and the specified one.
 int getLeft()
          Same as getX().
 int getRight()
          Same as getX() + getWidth().
 SizeView getSize()
          Returns the size of the rectangle.
 Size getSize(Size reusable)
          Returns the size of the rectangle.
 int getTop()
          Same as getY().
 PointView getTopLeft()
          Returns the location of the top-left point of the rectangle.
 Point getTopLeft(Point reusable)
          Returns the location of the top-left point of the rectangle.
 PointView getTopRight()
          Returns the location of the top-right point of the rectangle.
 Point getTopRight(Point reusable)
          Returns the location of the top-right point of the rectangle.
 int getWidth()
          Returns the width of the rectangle.
 int getX()
          Returns the X coordinate of the top-left point.
 int getY()
          Returns the Y coordinate of the top-left point.
 boolean intersects(RectangleView rectangle)
          Returns whether this rectangle intersects with the specified one.
 

Method Detail

getX

int getX()
Returns the X coordinate of the top-left point.


getY

int getY()
Returns the Y coordinate of the top-left point.


getWidth

int getWidth()
Returns the width of the rectangle.


getHeight

int getHeight()
Returns the height of the rectangle.


getLeft

int getLeft()
Same as getX().


getTop

int getTop()
Same as getY().


getRight

int getRight()
Same as getX() + getWidth().


getBottom

int getBottom()
Same as getY() + getHeight().


getSize

SizeView getSize()
Returns the size of the rectangle.


getSize

Size getSize(Size reusable)
Returns the size of the rectangle. If the specified Size object is not null, it is reused and returned.


getTopLeft

PointView getTopLeft()
Returns the location of the top-left point of the rectangle.


getTopLeft

Point getTopLeft(Point reusable)
Returns the location of the top-left point of the rectangle. If the specified Point object is not null, it is reused and returned.


getTopRight

PointView getTopRight()
Returns the location of the top-right point of the rectangle.


getTopRight

Point getTopRight(Point reusable)
Returns the location of the top-right point of the rectangle. If the specified Point object is not null, it is reused and returned.


getBottomLeft

PointView getBottomLeft()
Returns the location of the bottom-left point of the rectangle.


getBottomLeft

Point getBottomLeft(Point reusable)
Returns the location of the bottom-left point of the rectangle. If the specified Point object is not null, it is reused and returned.


getBottomRight

PointView getBottomRight()
Returns the location of the bottom-right point of the rectangle.


getBottomRight

Point getBottomRight(Point reusable)
Returns the location of the bottom-right point of the rectangle. If the specified Point object is not null, it is reused and returned.


getCenter

PointView getCenter()
Returns the location of the center of the rectangle. If the rectangle's width and/or height are even (so that the center point's coordinates are not integers), one of the closest integer points is returned, but which is unspecified.


getCenter

Point getCenter(Point reusable)
Returns the location of the center of the rectangle, in the same manner as the getCenter() method. If the specified Point object is not null, it is reused and returned.


contains

boolean contains(PointView point)
Returns whether this rectangle contains the specified point.


contains

boolean contains(RectangleView rectangle)
Returns whether this rectangle contains the specified one.


intersects

boolean intersects(RectangleView rectangle)
Returns whether this rectangle intersects with the specified one.


getIntersection

RectangleView getIntersection(RectangleView rectangle)
Returns the intersection between this rectangle and the specified one. Returns null if the two rectangles do not intersect and do not even "touch". Returns an empty rectangle if the two rectangles "touch".


getIntersection

Rectangle getIntersection(RectangleView rectangle,
                          Rectangle reusable)
Returns the intersection between this rectangle and the specified one. Returns null if the two rectangles do not intersect and do not even "touch". Returns an empty rectangle if the two rectangles "touch". If the specified Rectangle object is not null, it is reused and returned.