All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.geom.Area

java.lang.Object
    |
    +----sun.awt.Albert.Area
            |
            +----java.awt.geom.Area

public class Area
extends Area

Variable Index

 o EmptyArea
Constant area geometry that is empty.

Constructor Index

 o Area()
Default constructor which creates an empty area.
 o Area(Ellipse2D)
Creates an area geometry of a ellipse inside the specified rectangle.
 o Area(Polygon)
Creates an area geometry from the specified polygon.
 o Area(Rectangle2D)
Creates an area geometry from the specified rectangle.
 o Area(Shape)
Creates an area geometry from the specified Shape object.

Method Index

 o add(Area)
Adds the shape of the specified Area to the current shape.
 o contains(double, double)
Test if a given coordinate is inside the boundary of the shape.
 o contains(double, double, double, double)
Test if the interior of the Shape entirely contains the given set of rectangular coordinates.
 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 exclusiveOr(Area)
Sets the shape to the combined area of the current shape and the shape of the specified Area, minus their intersection.
 o getBounds()
Return the bounding box of the shape.
 o getBounds2D()
Return the high precision bounding box of the shape.
 o getPathIterator(AffineTransform)
Return an iterator object that iterates along the boundary of the shape and provides access to the geometry of the outline of the shape.
 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 intersect(Area)
Sets the shape to the intersection of the current shape with the shape of the specified Area.
 o intersects(double, double, double, double)
Test if the interior of the Shape intersects the interior of a given set of rectangular coordinates.
 o intersects(Rectangle2D)
Test if the interior of the Shape intersects the interior of a given Rectangle.
 o isEmpty()
Tests whether this area contains any geometries.
 o isPolygonal()
Tests whether the area comprises completely of horizontal and vertical edges.
 o isRectangular()
Tests whether the area is rectangular in shape.
 o isSingular()
Tests whether the area is comprised of a single basic geometry.
 o reset()
Removes all the basic geometries from this area and results in an empty area.
 o subtract(Area)
Subtracts the shape of the specified Area from the current shape.

Variables

 o EmptyArea
public static Area EmptyArea
Constant area geometry that is empty. Rendering such geometry will have no effect (NOP).

Constructors

 o Area
public Area()
Default constructor which creates an empty area.

 o Area
public Area(Shape g)
Creates an area geometry from the specified Shape object. The shape is explicitly closed, if it is not closed. The fill option (even-odd or winding) specified by the shape geometry is used to determined the resulting area.

Parameters:
g - The shape from which the area is to be constructed.
 o Area
public Area(Polygon p)
Creates an area geometry from the specified polygon. Even-odd fill option is assumed (because that is how awt Polygon is defined).

Parameters:
p - The polygon from which the area is to be constructed.
 o Area
public Area(Rectangle2D r)
Creates an area geometry from the specified rectangle.

Parameters:
r - The rectangle from which the area is to be constructed.
 o Area
public Area(Ellipse2D e)
Creates an area geometry of a ellipse inside the specified rectangle.

Parameters:
e - The ellipse geometry from which the area is to be constructed

Methods

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

Overrides:
getBounds in class Area
 o getBounds2D
public Rectangle2D getBounds2D()
Return the high precision bounding box of the shape.

Overrides:
getBounds2D in class Area
 o contains
public boolean contains(double x,
                        double y)
Test if a given coordinate is inside the boundary of the shape.

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

Overrides:
contains in class Area
 o intersects
public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Test if the interior of the Shape intersects the interior of a given set of rectangular coordinates.

Overrides:
intersects in class Area
 o intersects
public boolean intersects(Rectangle2D r)
Test if the interior of the Shape intersects the interior of a given Rectangle.

Overrides:
intersects in class Area
 o contains
public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Test if the interior of the Shape entirely contains the given set of rectangular coordinates.

Overrides:
contains in class Area
 o contains
public boolean contains(Rectangle2D r)
Test if the interior of the Shape entirely contains the given Rectangle.

Overrides:
contains in class Area
 o getPathIterator
public PathIterator getPathIterator(AffineTransform at)
Return an iterator object that iterates along the boundary of the shape and provides access to the geometry of the outline of the shape. 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.
Overrides:
getPathIterator in class Area
 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.
Overrides:
getPathIterator in class Area
 o reset
public void reset()
Removes all the basic geometries from this area and results in an empty area.

Overrides:
reset in class Area
 o isEmpty
public boolean isEmpty()
Tests whether this area contains any geometries.

Returns:
True if this area contains no basic geometries, or is an empty area.
Overrides:
isEmpty in class Area
 o isPolygonal
public boolean isPolygonal()
Tests whether the area comprises completely of horizontal and vertical edges.

Returns:
True if the area comprises completely of horizontal and vertical edges.
Overrides:
isPolygonal in class Area
 o isRectangular
public boolean isRectangular()
Tests whether the area is rectangular in shape.

Returns:
True if the area is rectangular in shape.
Overrides:
isRectangular in class Area
 o isSingular
public boolean isSingular()
Tests whether the area is comprised of a single basic geometry.

Returns:
True if the area is comprised of a single basic geometry.
Overrides:
isSingular in class Area
 o add
public void add(Area rhs)
Adds the shape of the specified Area to the current shape. Addition is achieved through union.

Parameters:
rhs - The shape to be added to the current area.
 o subtract
public void subtract(Area rhs)
Subtracts the shape of the specified Area from the current shape.

Parameters:
rhs - The shape to be subtracted from the current area.
 o intersect
public void intersect(Area rhs)
Sets the shape to the intersection of the current shape with the shape of the specified Area.

Parameters:
rhs - The area to be intersected with this one.
 o exclusiveOr
public void exclusiveOr(Area rhs)
Sets the shape to the combined area of the current shape and the shape of the specified Area, minus their intersection.

Parameters:
rhs - The area to be exclusive ORed with this one.

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature