ucar.unidata.geoloc
Class ProjectionRect

java.lang.Object
  extended by java.awt.geom.RectangularShape
      extended by java.awt.geom.Rectangle2D
          extended by java.awt.geom.Rectangle2D.Double
              extended by ucar.unidata.geoloc.ProjectionRect
All Implemented Interfaces:
java.awt.Shape, java.io.Serializable, java.lang.Cloneable

public class ProjectionRect
extends java.awt.geom.Rectangle2D.Double
implements java.io.Serializable

Bounding box for ProjectionPoint's. This is a subclass of java.awt.geom.Rectangle2D.Double. Note that getX() getY() really means getMinX(), getMinY(), rather than "upper left point" of the rectangle.

Author:
John Caron
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float
 
Field Summary
 
Fields inherited from class java.awt.geom.Rectangle2D.Double
height, width, x, y
 
Fields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
 
Constructor Summary
ProjectionRect()
          default constructor, initialized to center (0,0) and width (10000, 10000)
ProjectionRect(double x1, double y1, double x2, double y2)
          construct a MapArea from any two opposite corner points
ProjectionRect(java.awt.geom.Rectangle2D r)
          Copy Constructor
 
Method Summary
 ProjectionPoint getLowerLeftPoint()
          Get the Lower Right Point (same as getMinPoint)
 ProjectionPoint getLowerRightPoint()
          Get the Lower Right Point
 ProjectionPoint getMaxPoint()
          Get the maximum corner of the bounding box.
 ProjectionPoint getMinPoint()
          Get the minimum corner of the bounding box.
 ProjectionPoint getUpperLeftPoint()
          Get the Upper Left Point
 ProjectionPoint getUpperRightPoint()
          Get the Upper Left Point (same as getMaxPoint)
 void setHeight(double h)
          set Y height
 void setWidth(double w)
          set X width
 void setX(double x)
          set minimum X
 void setY(double y)
          set minimum Y
 java.lang.String toString()
          Get a String representation of this object.
 
Methods inherited from class java.awt.geom.Rectangle2D.Double
createIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, isEmpty, outcode, setRect, setRect
 
Methods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union
 
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProjectionRect

public ProjectionRect()
default constructor, initialized to center (0,0) and width (10000, 10000)


ProjectionRect

public ProjectionRect(java.awt.geom.Rectangle2D r)
Copy Constructor

Parameters:
r - rectangle to copy

ProjectionRect

public ProjectionRect(double x1,
                      double y1,
                      double x2,
                      double y2)
construct a MapArea from any two opposite corner points

Parameters:
x1 - x coord of any corner of the bounding box
y1 - y coord of the same corner as x1
x2 - x coord of opposite corner from x1,y1
y2 - y coord of same corner as x2
Method Detail

getLowerRightPoint

public ProjectionPoint getLowerRightPoint()
Get the Lower Right Point

Returns:
the Lower Right Point

getUpperRightPoint

public ProjectionPoint getUpperRightPoint()
Get the Upper Left Point (same as getMaxPoint)

Returns:
the Upper Left Point

getLowerLeftPoint

public ProjectionPoint getLowerLeftPoint()
Get the Lower Right Point (same as getMinPoint)

Returns:
the Lower Right Point

getUpperLeftPoint

public ProjectionPoint getUpperLeftPoint()
Get the Upper Left Point

Returns:
the Upper Left Point

getMinPoint

public ProjectionPoint getMinPoint()
Get the minimum corner of the bounding box.

Returns:
minimum corner of the bounding box

getMaxPoint

public ProjectionPoint getMaxPoint()
Get the maximum corner of the bounding box.

Returns:
maximum corner of the bounding box

toString

public java.lang.String toString()
Get a String representation of this object.

Overrides:
toString in class java.awt.geom.Rectangle2D.Double
Returns:
a String representation of this object.

setX

public void setX(double x)
set minimum X

Parameters:
x - minimum x

setY

public void setY(double y)
set minimum Y

Parameters:
y - minimum y

setWidth

public void setWidth(double w)
set X width

Parameters:
w - x width

setHeight

public void setHeight(double h)
set Y height

Parameters:
h - Y height