java.awt.geom
Class RoundRectangle2D

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.geom.RectangularShape sample code for java.awt.geom.RectangularShape definition code for java.awt.geom.RectangularShape 
      extended by java.awt.geom.RoundRectangle2D
All Implemented Interfaces:
Shape sample code for java.awt.Shape definition code for java.awt.Shape , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable
Direct Known Subclasses:
RoundRectangle2D.Double sample code for java.awt.geom.RoundRectangle2D.Double definition code for java.awt.geom.RoundRectangle2D.Double , RoundRectangle2D.Float sample code for java.awt.geom.RoundRectangle2D.Float definition code for java.awt.geom.RoundRectangle2D.Float

public abstract class RoundRectangle2D
extends RectangularShape sample code for java.awt.geom.RectangularShape definition code for java.awt.geom.RectangularShape

The RoundRectangle2D class defines a rectangle with rounded corners defined by a location (x, y), a dimension (w x h), and the width and height of an arc with which to round the corners.

This class is the abstract superclass for all objects that store a 2D rounded rectangle. The actual storage representation of the coordinates is left to the subclass.


Nested Class Summary
static class RoundRectangle2D.Double sample code for java.awt.geom.RoundRectangle2D.Double definition code for java.awt.geom.RoundRectangle2D.Double
          The Double class defines a rectangle with rounded corners all specified in double coordinates.
static class RoundRectangle2D.Float sample code for java.awt.geom.RoundRectangle2D.Float definition code for java.awt.geom.RoundRectangle2D.Float
          The Float class defines a rectangle with rounded corners all specified in float coordinates.
 
Constructor Summary
protected RoundRectangle2D sample code for java.awt.geom.RoundRectangle2D.RoundRectangle2D() definition code for java.awt.geom.RoundRectangle2D.RoundRectangle2D() ()
          This is an abstract class that cannot be instantiated directly.
 
Method Summary
 boolean contains sample code for java.awt.geom.RoundRectangle2D.contains(double, double) definition code for java.awt.geom.RoundRectangle2D.contains(double, double) (double x, double y)
          Tests if the specified coordinates are inside the boundary of this RoundRectangle2D.
 boolean contains sample code for java.awt.geom.RoundRectangle2D.contains(double, double, double, double) definition code for java.awt.geom.RoundRectangle2D.contains(double, double, double, double) (double x, double y, double w, double h)
          Tests if the interior of this RoundRectangle2D entirely contains the specified set of rectangular coordinates.
abstract  double getArcHeight sample code for java.awt.geom.RoundRectangle2D.getArcHeight() definition code for java.awt.geom.RoundRectangle2D.getArcHeight() ()
          Gets the height of the arc that rounds off the corners.
abstract  double getArcWidth sample code for java.awt.geom.RoundRectangle2D.getArcWidth() definition code for java.awt.geom.RoundRectangle2D.getArcWidth() ()
          Gets the width of the arc that rounds off the corners.
 PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator getPathIterator sample code for java.awt.geom.RoundRectangle2D.getPathIterator(java.awt.geom.AffineTransform) definition code for java.awt.geom.RoundRectangle2D.getPathIterator(java.awt.geom.AffineTransform) (AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  at)
          Returns an iteration object that defines the boundary of this RoundRectangle2D.
 boolean intersects sample code for java.awt.geom.RoundRectangle2D.intersects(double, double, double, double) definition code for java.awt.geom.RoundRectangle2D.intersects(double, double, double, double) (double x, double y, double w, double h)
          Tests if the interior of this RoundRectangle2D intersects the interior of a specified set of rectangular coordinates.
 void setFrame sample code for java.awt.geom.RoundRectangle2D.setFrame(double, double, double, double) definition code for java.awt.geom.RoundRectangle2D.setFrame(double, double, double, double) (double x, double y, double w, double h)
          Sets the location and size of the outer bounds of this RoundRectangle2D to the specified rectangular values.
abstract  void setRoundRect sample code for java.awt.geom.RoundRectangle2D.setRoundRect(double, double, double, double, double, double) definition code for java.awt.geom.RoundRectangle2D.setRoundRect(double, double, double, double, double, double) (double x, double y, double w, double h, double arcWidth, double arcHeight)
          Sets the location, size, and corner radii of this RoundRectangle2D to the specified double values.
 void setRoundRect sample code for java.awt.geom.RoundRectangle2D.setRoundRect(java.awt.geom.RoundRectangle2D) definition code for java.awt.geom.RoundRectangle2D.setRoundRect(java.awt.geom.RoundRectangle2D) (RoundRectangle2D sample code for java.awt.geom.RoundRectangle2D definition code for java.awt.geom.RoundRectangle2D  rr)
          Sets this RoundRectangle2D to be the same as the specified RoundRectangle2D.
 
Methods inherited from class java.awt.geom.RectangularShape sample code for java.awt.geom.RectangularShape definition code for java.awt.geom.RectangularShape
clone sample code for java.awt.geom.RectangularShape.clone() definition code for java.awt.geom.RectangularShape.clone() , contains sample code for java.awt.geom.RectangularShape.contains(java.awt.geom.Point2D) definition code for java.awt.geom.RectangularShape.contains(java.awt.geom.Point2D) , contains sample code for java.awt.geom.RectangularShape.contains(java.awt.geom.Rectangle2D) definition code for java.awt.geom.RectangularShape.contains(java.awt.geom.Rectangle2D) , getBounds sample code for java.awt.geom.RectangularShape.getBounds() definition code for java.awt.geom.RectangularShape.getBounds() , getCenterX sample code for java.awt.geom.RectangularShape.getCenterX() definition code for java.awt.geom.RectangularShape.getCenterX() , getCenterY sample code for java.awt.geom.RectangularShape.getCenterY() definition code for java.awt.geom.RectangularShape.getCenterY() , getFrame sample code for java.awt.geom.RectangularShape.getFrame() definition code for java.awt.geom.RectangularShape.getFrame() , getHeight sample code for java.awt.geom.RectangularShape.getHeight() definition code for java.awt.geom.RectangularShape.getHeight() , getMaxX sample code for java.awt.geom.RectangularShape.getMaxX() definition code for java.awt.geom.RectangularShape.getMaxX() , getMaxY sample code for java.awt.geom.RectangularShape.getMaxY() definition code for java.awt.geom.RectangularShape.getMaxY() , getMinX sample code for java.awt.geom.RectangularShape.getMinX() definition code for java.awt.geom.RectangularShape.getMinX() , getMinY sample code for java.awt.geom.RectangularShape.getMinY() definition code for java.awt.geom.RectangularShape.getMinY() , getPathIterator sample code for java.awt.geom.RectangularShape.getPathIterator(java.awt.geom.AffineTransform, double) definition code for java.awt.geom.RectangularShape.getPathIterator(java.awt.geom.AffineTransform, double) , getWidth sample code for java.awt.geom.RectangularShape.getWidth() definition code for java.awt.geom.RectangularShape.getWidth() , getX sample code for java.awt.geom.RectangularShape.getX() definition code for java.awt.geom.RectangularShape.getX() , getY sample code for java.awt.geom.RectangularShape.getY() definition code for java.awt.geom.RectangularShape.getY() , intersects sample code for java.awt.geom.RectangularShape.intersects(java.awt.geom.Rectangle2D) definition code for java.awt.geom.RectangularShape.intersects(java.awt.geom.Rectangle2D) , isEmpty sample code for java.awt.geom.RectangularShape.isEmpty() definition code for java.awt.geom.RectangularShape.isEmpty() , setFrame sample code for java.awt.geom.RectangularShape.setFrame(java.awt.geom.Point2D, java.awt.geom.Dimension2D) definition code for java.awt.geom.RectangularShape.setFrame(java.awt.geom.Point2D, java.awt.geom.Dimension2D) , setFrame sample code for java.awt.geom.RectangularShape.setFrame(java.awt.geom.Rectangle2D) definition code for java.awt.geom.RectangularShape.setFrame(java.awt.geom.Rectangle2D) , setFrameFromCenter sample code for java.awt.geom.RectangularShape.setFrameFromCenter(double, double, double, double) definition code for java.awt.geom.RectangularShape.setFrameFromCenter(double, double, double, double) , setFrameFromCenter sample code for java.awt.geom.RectangularShape.setFrameFromCenter(java.awt.geom.Point2D, java.awt.geom.Point2D) definition code for java.awt.geom.RectangularShape.setFrameFromCenter(java.awt.geom.Point2D, java.awt.geom.Point2D) , setFrameFromDiagonal sample code for java.awt.geom.RectangularShape.setFrameFromDiagonal(double, double, double, double) definition code for java.awt.geom.RectangularShape.setFrameFromDiagonal(double, double, double, double) , setFrameFromDiagonal sample code for java.awt.geom.RectangularShape.setFrameFromDiagonal(java.awt.geom.Point2D, java.awt.geom.Point2D) definition code for java.awt.geom.RectangularShape.setFrameFromDiagonal(java.awt.geom.Point2D, java.awt.geom.Point2D)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 
Methods inherited from interface java.awt.Shape sample code for java.awt.Shape definition code for java.awt.Shape
getBounds2D sample code for java.awt.Shape.getBounds2D() definition code for java.awt.Shape.getBounds2D()
 

Constructor Detail

RoundRectangle2D sample code for java.awt.geom.RoundRectangle2D() definition code for java.awt.geom.RoundRectangle2D()

protected RoundRectangle2D()
This is an abstract class that cannot be instantiated directly. Type-specific implementation subclasses are available for instantiation and provide a number of formats for storing the information necessary to satisfy the various accessor methods below.

See Also:
RoundRectangle2D.Float sample code for java.awt.geom.RoundRectangle2D.Float definition code for java.awt.geom.RoundRectangle2D.Float , RoundRectangle2D.Double sample code for java.awt.geom.RoundRectangle2D.Double definition code for java.awt.geom.RoundRectangle2D.Double
Method Detail

getArcWidth sample code for java.awt.geom.RoundRectangle2D.getArcWidth() definition code for java.awt.geom.RoundRectangle2D.getArcWidth()

public abstract double getArcWidth()
Gets the width of the arc that rounds off the corners.

Returns:
the width of the arc that rounds off the corners of this RoundRectangle2D.

getArcHeight sample code for java.awt.geom.RoundRectangle2D.getArcHeight() definition code for java.awt.geom.RoundRectangle2D.getArcHeight()

public abstract double getArcHeight()
Gets the height of the arc that rounds off the corners.

Returns:
the height of the arc that rounds off the corners of this RoundRectangle2D.

setRoundRect sample code for java.awt.geom.RoundRectangle2D.setRoundRect(double, double, double, double, double, double) definition code for java.awt.geom.RoundRectangle2D.setRoundRect(double, double, double, double, double, double)

public abstract void setRoundRect(double x,
                                  double y,
                                  double w,
                                  double h,
                                  double arcWidth,
                                  double arcHeight)
Sets the location, size, and corner radii of this RoundRectangle2D to the specified double values.

Parameters:
x, y - the coordinates to which to set the location of this RoundRectangle2D
w - the width to which to set this RoundRectangle2D
h - the height to which to set this RoundRectangle2D
arcWidth - the width to which to set the arc of this RoundRectangle2D
arcHeight - the height to which to set the arc of this RoundRectangle2D

setRoundRect sample code for java.awt.geom.RoundRectangle2D.setRoundRect(java.awt.geom.RoundRectangle2D) definition code for java.awt.geom.RoundRectangle2D.setRoundRect(java.awt.geom.RoundRectangle2D)

public void setRoundRect(RoundRectangle2D sample code for java.awt.geom.RoundRectangle2D definition code for java.awt.geom.RoundRectangle2D  rr)
Sets this RoundRectangle2D to be the same as the specified RoundRectangle2D.

Parameters:
rr - the specified RoundRectangle2D

setFrame sample code for java.awt.geom.RoundRectangle2D.setFrame(double, double, double, double) definition code for java.awt.geom.RoundRectangle2D.setFrame(double, double, double, double)

public void setFrame(double x,
                     double y,
                     double w,
                     double h)
Sets the location and size of the outer bounds of this RoundRectangle2D to the specified rectangular values.

Specified by:
setFrame sample code for java.awt.geom.RectangularShape.setFrame(double, double, double, double) definition code for java.awt.geom.RectangularShape.setFrame(double, double, double, double) in class RectangularShape sample code for java.awt.geom.RectangularShape definition code for java.awt.geom.RectangularShape
Parameters:
x, y - the coordinates to which to set the location of this RoundRectangle2D
w - the width to which to set this RoundRectangle2D
h - the height to which to set this RoundRectangle2D
See Also:
RectangularShape.getFrame() sample code for java.awt.geom.RectangularShape.getFrame() definition code for java.awt.geom.RectangularShape.getFrame()

contains sample code for java.awt.geom.RoundRectangle2D.contains(double, double) definition code for java.awt.geom.RoundRectangle2D.contains(double, double)

public boolean contains(double x,
                        double y)
Tests if the specified coordinates are inside the boundary of this RoundRectangle2D.

Parameters:
x, y - the coordinates to test
Returns:
true if the specified coordinates are inside the boundary of this RoundRectangle2D; false otherwise.

intersects sample code for java.awt.geom.RoundRectangle2D.intersects(double, double, double, double) definition code for java.awt.geom.RoundRectangle2D.intersects(double, double, double, double)

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Tests if the interior of this RoundRectangle2D intersects the interior of a specified set of rectangular coordinates.

Parameters:
x, y - the coordinates of the upper left corner of the specified set of rectangular coordinates
w - the width of the specified set of rectangular coordinates
h - the height of the specified set of rectangular coordinates
Returns:
true if the interior of this RoundRectangle2D intersects the interior of the specified set of rectangular coordinates.
See Also:
Area sample code for java.awt.geom.Area definition code for java.awt.geom.Area

contains sample code for java.awt.geom.RoundRectangle2D.contains(double, double, double, double) definition code for java.awt.geom.RoundRectangle2D.contains(double, double, double, double)

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Tests if the interior of this RoundRectangle2D entirely contains the specified set of rectangular coordinates.

Parameters:
x, y - the coordinates of the specified set of rectangular coordinates
w - the width of the specified set of rectangular coordinates
h - the height of the specified set of rectangular coordinates
Returns:
true if the interior of this RoundRectangle2D entirely contains the specified set of rectangular coordinates; false otherwise.
See Also:
Area sample code for java.awt.geom.Area definition code for java.awt.geom.Area , Shape.intersects(double, double, double, double) sample code for java.awt.Shape.intersects(double, double, double, double) definition code for java.awt.Shape.intersects(double, double, double, double)

getPathIterator sample code for java.awt.geom.RoundRectangle2D.getPathIterator(java.awt.geom.AffineTransform) definition code for java.awt.geom.RoundRectangle2D.getPathIterator(java.awt.geom.AffineTransform)

public PathIterator sample code for java.awt.geom.PathIterator definition code for java.awt.geom.PathIterator  getPathIterator(AffineTransform sample code for java.awt.geom.AffineTransform definition code for java.awt.geom.AffineTransform  at)
Returns an iteration object that defines the boundary of this RoundRectangle2D. The iterator for this class is multi-threaded safe, which means that this RoundRectangle2D class guarantees that modifications to the geometry of this RoundRectangle2D object do not affect any iterations of that geometry that are already in process.

Parameters:
at - an optional AffineTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired
Returns:
the PathIterator object that returns the geometry of the outline of this RoundRectangle2D, one segment at a time.