All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.geom.RectangularShape

java.lang.Object
    |
    +----java.awt.geom.RectangularShape

public abstract class RectangularShape
extends Object
implements Shape
The base class for a number of shapes which inscribe a rectangular set of outer bounds. This class provides common manipulation routines for operating on a shape by querying and modifying its bounding rectangle.


Constructor Index

 o RectangularShape()

Method Index

 o contains(Point2D)
Test if a given Point is inside the boundary of the shape.
 o contains(Rectangle2D)
Test if the interior of the Shape entirely contains the given Rectangle.
 o getBottom()
Returns the Y coordinate of the bottom edge of the shape in double precision.
 o getBounds()
Return the bounding box of the shape.
 o getCenterX()
Returns the X coordinate of the center of the shape in double precision.
 o getCenterY()
Returns the Y coordinate of the center of the shape in double precision.
 o getHeight()
Returns the height of the bounding rectangle in double precision.
 o getLeft()
Returns the X coordinate of the left edge of the shape in double precision.
 o getPathIterator(AffineTransform, double)
Return an iterator object that iterates along the boundary of the shape and provides access to a flattened view of the geometry of the outline of the shape.
 o getRight()
Returns the X coordinate of the right edge of the shape in double precision.
 o getTop()
Returns the Y coordinate of the top edge of the shape in double precision.
 o getWidth()
Returns the width of the bounding rectangle in double precision.
 o getX()
Returns the X coordinate of the bounding rectangle in double precision.
 o getY()
Returns the Y coordinate of the bounding rectangle in double precision.
 o intersects(Rectangle2D)
Test if the interior of the Shape intersects the interior of a given Rectangle.
 o isEmpty()
Determines whether the rectangular shape is empty.
 o setBounds(double, double, double, double)
Sets the location and size of the outer bounds of this shape to the specified rectangular values.
 o setBounds(Point2D, Dimension2D)
Sets the outer bounds of this shape to be the same as the specified Point and Dimension objects.
 o setBounds(Rectangle2D)
Sets the outer bounds of this shape to be the same as the specified Rectangle.
 o setBoundsFromCenter(double, double, double, double)
Sets the outer bounds of this shape based on a center point and a corner point.
 o setBoundsFromCenter(Point2D, Point2D)
Sets the outer bounds of this shape based on a center point and a corner point.
 o setBoundsFromDiagonal(double, double, double, double)
Sets the outer bounds of this shape based on two points along one of its diagonals.
 o setBoundsFromDiagonal(Point2D, Point2D)
Sets the outer bounds of this shape based on two Point objects along one of its diagonals.

Constructors

 o RectangularShape
protected RectangularShape()

Methods

 o getX
public abstract double getX()
Returns the X coordinate of the bounding rectangle in double precision.

 o getY
public abstract double getY()
Returns the Y coordinate of the bounding rectangle in double precision.

 o getWidth
public abstract double getWidth()
Returns the width of the bounding rectangle in double precision.

 o getHeight
public abstract double getHeight()
Returns the height of the bounding rectangle in double precision.

 o getLeft
public double getLeft()
Returns the X coordinate of the left edge of the shape in double precision.

 o getTop
public double getTop()
Returns the Y coordinate of the top edge of the shape in double precision.

 o getRight
public double getRight()
Returns the X coordinate of the right edge of the shape in double precision.

 o getBottom
public double getBottom()
Returns the Y coordinate of the bottom edge of the shape in double precision.

 o getCenterX
public double getCenterX()
Returns the X coordinate of the center of the shape in double precision.

 o getCenterY
public double getCenterY()
Returns the Y coordinate of the center of the shape in double precision.

 o isEmpty
public abstract boolean isEmpty()
Determines whether the rectangular shape is empty.

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

 o setBounds
public void setBounds(Point2D loc,
                      Dimension2D size)
Sets the outer bounds of this shape to be the same as the specified Point and Dimension objects.

 o setBounds
public void setBounds(Rectangle2D r)
Sets the outer bounds of this shape to be the same as the specified Rectangle.

 o setBoundsFromDiagonal
public void setBoundsFromDiagonal(double x1,
                                  double y1,
                                  double x2,
                                  double y2)
Sets the outer bounds of this shape based on two points along one of its diagonals.

 o setBoundsFromDiagonal
public void setBoundsFromDiagonal(Point2D p1,
                                  Point2D p2)
Sets the outer bounds of this shape based on two Point objects along one of its diagonals.

 o setBoundsFromCenter
public void setBoundsFromCenter(double centerX,
                                double centerY,
                                double cornerX,
                                double cornerY)
Sets the outer bounds of this shape based on a center point and a corner point.

 o setBoundsFromCenter
public void setBoundsFromCenter(Point2D center,
                                Point2D corner)
Sets the outer bounds of this shape based on a center point and a corner point.

 o contains
public boolean contains(Point2D p)
Test if a given Point is inside the boundary of the shape.

 o intersects
public boolean intersects(Rectangle2D r)
Test if the interior of the Shape intersects the interior of a given Rectangle.

 o contains
public boolean contains(Rectangle2D r)
Test if the interior of the Shape entirely contains the given Rectangle.

 o getBounds
public Rectangle getBounds()
Return the bounding box of the shape.

 o getPathIterator
public PathIterator getPathIterator(AffineTransform at,
                                    double flatness)
Return an iterator object that iterates along the boundary of the shape and provides access to a flattened view of the geometry of the outline of the shape. Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE point types will be returned by the iterator. The amount of subdivision of the curved segments is controlled by the flatness parameter which specifies ?REMIND?. An optional affine transform can be specified in which case the coordinates returned in the iteration will be transformed accordingly.

Parameters:
at - an optional AffineTransform to be applied to the coordinates as they are returned in the iteration, or null if the untransformed coordinates are desired.
flatness - the maximum amount that the control points for a given curve can vary from colinear before a subdivided curve is replaced by a straight line connecting the endpoints.

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature