Area
object stores and manipulates a resolutionindependent description of an enclosed area of 2dimensional space. Area
objects can be transformed and can perform various Constructive Area Geometry (CAG) operations when combined with other Area
objects. The CAG operations include area {@link #add addition}, {@link #subtract subtraction}, {@link #intersect intersection}, and {@link #exclusiveOr exclusive or}. See the linked method documentation for examples of the various operations. The Area
class implements the Shape
interface and provides full support for all of its hittesting and path iteration facilities, but an Area
is more specific than a generalized path in a number of ways:
Area
objects constructed from unclosed paths are implicitly closed during construction as if those paths had been filled by the Graphics2D.fill
method. Area
resembles the path from which it was constructed only in that it describes the same enclosed 2dimensional area, but may use entirely different types and ordering of the path segments to do so. Area
include: Area
from an unclosed (open) Shape
results in a closed outline in the Area
object. Area
from a Shape
which encloses no area (even when "closed") produces an empty Area
. A common example of this issue is that producing an Area
from a line will be empty since the line encloses no area. An empty Area
will iterate no geometry in its PathIterator
objects. Shape
may be split into two (or more) subpaths each enclosing one of the nonintersecting portions of the original path. Area
may take more path segments to describe the same geometry even when the original outline is simple and obvious. The analysis that the Area
class must perform on the path may not reflect the same concepts of "simple and obvious" as a human being perceives. Area
object stores and manipulates a resolutionindependent description of an enclosed area of 2dimensional space. Area
objects can be transformed and can perform various Constructive Area Geometry (CAG) operations when combined with other Area
objects. The CAG operations include area {@link #add addition}, {@link #subtract subtraction}, {@link #intersect intersection}, and {@link #exclusiveOr exclusive or}. See the linked method documentation for examples of the various operations. The Area
class implements the Shape
interface and provides full support for all of its hittesting and path iteration facilities, but an Area
is more specific than a generalized path in a number of ways:
Area
objects constructed from unclosed paths are implicitly closed during construction as if those paths had been filled by the Graphics2D.fill
method. Area
resembles the path from which it was constructed only in that it describes the same enclosed 2dimensional area, but may use entirely different types and ordering of the path segments to do so. Area
include: Area
from an unclosed (open) Shape
results in a closed outline in the Area
object. Area
from a Shape
which encloses no area (even when "closed") produces an empty Area
. A common example of this issue is that producing an Area
from a line will be empty since the line encloses no area. An empty Area
will iterate no geometry in its PathIterator
objects. Shape
may be split into two (or more) subpaths each enclosing one of the nonintersecting portions of the original path. Area
may take more path segments to describe the same geometry even when the original outline is simple and obvious. The analysis that the Area
class must perform on the path may not reflect the same concepts of "simple and obvious" as a human being perceives.



















