java.awt.geom

Class Area

Implemented Interfaces:
Cloneable, Shape

public class Area
extends Object
implements Shape, Cloneable

The Area class is a device-independent specification of an arbitrarily-shaped area. The Area object is defined as an object that performs certain binary CAG (Constructive Area Geometry) operations on other area-enclosing geometries, such as rectangles, ellipses, and polygons. The CAG operations are Add(union), Subtract, Intersect, and ExclusiveOR. For example, an Area can be made up of the area of a rectangle minus the area of an ellipse.

Constructor Summary

Area()
Default constructor which creates an empty area.
Area(Shape s)
The Area class creates an area geometry from the specified Shape object.

Method Summary

void
add(Area rhs)
Adds the shape of the specified Area to the shape of this Area.
Object
clone()
Returns an exact copy of this Area object.
boolean
contains(double x, double y)
Tests if a specifed point lies inside the boundary of this Area object.
boolean
contains(double x, double y, double w, double h)
Tests whether or not the interior of this Area object completely contains the specified rectangular area.
boolean
contains(Point2D p)
Tests if a specified Point2D lies inside the boundary of the this Area object.
boolean
contains(Rectangle2D p)
Tests whether or not the interior of this Area object completely contains the specified Rectangle2D.
Area
createTransformedArea(AffineTransform t)
Creates a new Area object that contains the same geometry as this Area transformed by the specified AffineTransform.
boolean
equals(Area other)
Tests whether the geometries of the two Area objects are equal.
void
exclusiveOr(Area rhs)
Sets the shape of this Area to be the combined area of its current shape and the shape of the specified Area, minus their intersection.
Rectangle
getBounds()
Returns a bounding Rectangle that completely encloses this Area.
Rectangle2D
getBounds2D()
Returns a high precision bounding Rectangle2D that completely encloses this Area.
PathIterator
getPathIterator(AffineTransform at)
Creates a PathIterator for the outline of this Area object.
PathIterator
getPathIterator(AffineTransform at, double flatness)
Creates a PathIterator for the flattened outline of this Area object.
void
intersect(Area rhs)
Sets the shape of this Area to the intersection of its current shape and the shape of the specified Area.
boolean
intersects(double x, double y, double w, double h)
Tests whether the interior of this Area object intersects the interior of the specified rectangular area.
boolean
intersects(Rectangle2D p)
Tests whether the interior of this Area object intersects the interior of the specified Rectangle2D.
boolean
isEmpty()
Tests whether this Area object encloses any area.
boolean
isPolygonal()
Tests whether this Area consists entirely of straight edged polygonal geometry.
boolean
isRectangular()
Tests whether this Area is rectangular in shape.
boolean
isSingular()
Tests whether this Area is comprised of a single closed subpath.
void
reset()
Removes all of the geometry from this Area and restores it to an empty area.
void
subtract(Area rhs)
Subtracts the shape of the specified Area from the shape of this Area.
void
transform(AffineTransform t)
Transforms the geometry of this Area using the specified AffineTransform.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

Area

public Area()
Default constructor which creates an empty area.
Usages and Demos :

View More Examples of Area()
   1:             {
   2:                area = new Area();
   3:                area.add(area1);
   4:         ...
   5:             {
   6:                area = new Area();
   7:                area.add(area1);
   8:         ...
   9:             {
  10:                area = new Area();
  11:                area.add(area1);

View Full Code Here
   1:    int w, int h, MouseEvent e) {
   2:     Area resizeArea= new Area();
   3:     resizeArea.add(new Area(new Rectangle(0,0,m_w,m_h)));
   4:     resizeArea.add(new Area(new Rectangle(w-m_w,0,m_w,m_h)));
   5:     resizeArea.add(new Area(new Rectangle(0,h-m_h,m_w,m_h)));

View Full Code Here
   1:             return null;
   2:         Area paintedArea = new Area();
   3:         for (int i=0; i < count; ++i) {
   4:         ...
   5:             return null;
   6:         Area paintedArea = new Area();
   7:         for (int i=0; i < count; ++i) {
   8:             Shape s = painters[i].getSensitiveArea();
   9:             if (s != null) {

View Full Code Here
   1: 
   2:         Area clipPath = new Area();
   3:         GVTBuilder builder = ctx.getGVTBuilder();
   4:         boolean hasChildren = false;
   5:         for(Node node = clipElement.getFirstChild();

View Full Code Here

Area

public Area(Shape s)
The Area class creates an area geometry from the specified Shape object. The geometry is explicitly closed, if the Shape is not already closed. The fill rule (even-odd or winding) specified by the geometry of the Shape is used to determine the resulting enclosed area.
Parameters:
s - the Shape from which the area is constructed
Usages and Demos :

View More Examples of Area(Shape s)
   1: 
   2:         Area tick = new Area(body);
   3:         ...
   4:         tick.add(new Area(head));
   5:         ...
   6:         tick.add(new Area(tail));
   7:         return tick;

View Full Code Here
   1: 
   2:     s = new Area(s);
   3:         ...
   4:     ((Area) s).intersect(new Area(bounds));
   5:     }
   6: 
   7:     if(fill != null) {

View Full Code Here
   1:                 shapes[1] = new Ellipse2D.Double(10,20,30,40);
   2:                 shapes[2] = new Area(ShapeUtilities.createSwatchShape());
   3:               
   4:         ...
   5:             public void init () throws Exception {
   6:                 shapes[0] = new Area(ShapeUtilities.createSwatchShape());
   7:                 shapes[1] = new Rectangle2D.Double(10,20,30,40);
   8:                 shapes[2] = new Ellipse2D.Double(10,20,30,40);
   9:               

View Full Code Here
   1: 
   2:         Area tick = new Area(body);
   3:         ...
   4:         tick.add(new Area(head));
   5:         ...
   6:         tick.add(new Area(tail));

View Full Code Here
   1:             if (area==userArea && area instanceof Area) {
   2:                 area = new Area(area);
   3:             }
   4:         ...
   5:             if (!(paintedArea instanceof Area)) {
   6:                 paintedArea = new Area(area);
   7:             }
   8:         ...
   9:             ((Area) paintedArea).add((area instanceof Area) ? (Area) area : new Area(area));
  10:         }

View Full Code Here

Method Details

add

public void add(Area rhs)
Adds the shape of the specified Area to the shape of this Area. Addition is achieved through union.
Parameters:
rhs - the Area to be added to the current shape
Usages and Demos :

View More Examples of add(Area rhs)
   1:     Ellipse2D.Double circle, oval, leaf, stem;
   2:     Area circ, ov, leaf1, leaf2, st1, st2;
   3: 
   4:         ...
   5:         stem = new Ellipse2D.Double();
   6:         circ = new Area(circle);
   7:         ...
   8:         ov = new Area(oval);
   9:         leaf1 = new Area(leaf);
  10:         ...
  11:         ov = new Area(oval);
  12:         circ.add(ov);

View Full Code Here
   1: 
   2:       area1 = new Area(new Ellipse2D.Double(100, 100, 150, 100));
   3:         ...
   4:       area2 = new Area(new Rectangle2D.Double(150, 150, 150, 100));
   5: 
   6:         ...
   7:                g2.draw(area2);
   8:                if (area != null) g2.fill(area);
   9:             }
  10:         ...
  11:       JRadioButton addButton = new JRadioButton("Add", false);
  12:       buttonPanel.add(addButton);

View Full Code Here
   1: import java.awt.Graphics2D;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Ellipse2D;
   4:         ...
   5:         Ellipse2D.Double circle, oval, leaf, stem;
   6:         Area circ, ov, leaf1, leaf2, st1, st2;
   7:         circle = new Ellipse2D.Double();
   8:         ...
   9:         stem = new Ellipse2D.Double();
  10:         circ = new Area(circle);
  11:         ov = new Area(oval);
  12:         ...
  13:         ov = new Area(oval);
  14:         circ.add(ov);

View Full Code Here
   1: 
   2:     Area clipArea = null;
   3: 
   4:         ...
   5: 
   6:             Area childClipArea = new Area(path);
   7: 
   8:         ...
   9:             } else {
  10:               clipArea.add(childClipArea);
  11:             }
  12:         ...
  13:                   } else {
  14:                     clipArea.add(childClipArea);

View Full Code Here
   1:         double lastY = 0.0;
   2:         Area currentUsage = new Area();
   3:         ...
   4:         Area childUsage = null;
   5:         ZBounds immediateChildrenBounds = new ZBounds();
   6:         ...
   7: 
   8:                 currentUsage.add(getNodeArea(childPrimary));
   9: 
  10:         ...
  11: 
  12:                 currentUsage.add(childUsage);

View Full Code Here

clone

public Object clone()
Returns an exact copy of this Area object.
Overrides:
clone in interface Object
Returns:
Created clone object
Usages and Demos :

View More Examples of clone()
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.GeneralPath;
   4:         ...
   5:             Line2D line = (Line2D) shape;
   6:             result = (Shape) line.clone();    
   7:         }
   8:         ...
   9:             RectangularShape rectangle = (RectangularShape) shape;
  10:             result = (Shape) rectangle.clone();
  11:         }
  12:         ...
  13:         else if (shape instanceof Area) {

View Full Code Here

contains

public boolean contains(double x,
                        double y)
Tests if a specifed point lies inside the boundary of this Area object.
Specified by:
contains in interface Shape
Parameters:
Returns:
true if the point lies completely within the interior of the Area; false otherwise.

contains

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Tests whether or not the interior of this Area object completely contains the specified rectangular area.
Specified by:
contains in interface Shape
Parameters:
w - the width of the specified rectangular area
h - the height of the specified rectangular area
Returns:
true if the specified rectangular area lies completely within the interior of the Area; false otherwise.

contains

public boolean contains(Point2D p)
Tests if a specified Point2D lies inside the boundary of the this Area object.
Specified by:
contains in interface Shape
Parameters:
p - the Point2D to test
Returns:
true if the specified Point2D lies completely within the interior of the Area; false otherwise.
Usages and Demos :

View More Examples of contains(Point2D p)
   1:    int w, int h, MouseEvent e) {
   2:     Area resizeArea= new Area();
   3:         ...
   4:     resizeArea.add(new Area(new Rectangle(0,0,m_w,m_h)));
   5:     resizeArea.add(new Area(new Rectangle(w-m_w,0,m_w,m_h)));
   6:         ...
   7:     resizeArea.add(new Area(new Rectangle(w-m_w,h-m_h,m_w,m_h)));
   8:     return resizeArea.contains(e.getX(),e.getY());
   9:   };
  10:         ...
  11: 
  12:      if (new Area(new Rectangle(0,0,m_w,m_h)).contains(e.getX(),e.getY())) corner=corner | CORNER_TOP | CORNER_LEFT;

View Full Code Here

contains

public boolean contains(Rectangle2D p)
Tests whether or not the interior of this Area object completely contains the specified Rectangle2D.
Specified by:
contains in interface Shape
Parameters:
p - the Rectangle2D to test
Returns:
true if the Rectangle2D lies completely within the interior of the Area; false otherwise.
Usages and Demos :

View More Examples of contains(Rectangle2D p)
   1:    int w, int h, MouseEvent e) {
   2:     Area resizeArea= new Area();
   3:         ...
   4:     resizeArea.add(new Area(new Rectangle(0,0,m_w,m_h)));
   5:     resizeArea.add(new Area(new Rectangle(w-m_w,0,m_w,m_h)));
   6:         ...
   7:     resizeArea.add(new Area(new Rectangle(w-m_w,h-m_h,m_w,m_h)));
   8:     return resizeArea.contains(e.getX(),e.getY());
   9:   };
  10:         ...
  11: 
  12:      if (new Area(new Rectangle(0,0,m_w,m_h)).contains(e.getX(),e.getY())) corner=corner | CORNER_TOP | CORNER_LEFT;

View Full Code Here

createTransformedArea

public Area createTransformedArea(AffineTransform t)
Creates a new Area object that contains the same geometry as this Area transformed by the specified AffineTransform. This Area object is unchanged.
Parameters:
t - the specified AffineTransform used to transform the new Area
Returns:
a new Area object representing the transformed geometry.
Usages and Demos :

View More Examples of createTransformedArea(AffineTransform t)
   1: import java.awt.Rectangle;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:                     if (!canvasBounds.equals(XRectangle2D.INFINITY)) {
   6:                         final Area newArea = new Area(canvasBounds);
   7:         ...
   8:                         newArea.subtract(newArea.createTransformedArea(change));
   9:                         final Area area = (displayBounds instanceof Area) ?

View Full Code Here
   1: import java.awt.Rectangle;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Point2D;
   4:         ...
   5: 
   6:     public void setPreferredArea(final Rectangle2D area) {
   7:         final Rectangle2D oldArea;
   8:         ...
   9:             oldArea = preferredArea;
  10:             preferredArea = (area!=null) ? (Rectangle2D)area.clone() : null;
  11:         }
  12:         ...
  13:                 final Area newArea = new Area(mapPane.getBounds());
  14:                 newArea.subtract(newArea.createTransformedArea(change));

View Full Code Here

equals

public boolean equals(Area other)
Tests whether the geometries of the two Area objects are equal.
Parameters:
other - the Area to be compared to this Area
Returns:
true if the two geometries are equal; false otherwise.

exclusiveOr

public void exclusiveOr(Area rhs)
Sets the shape of this Area to be the combined area of its current shape and the shape of the specified Area, minus their intersection.
Parameters:
rhs - the Area to be exclusive ORed with this Area.
Usages and Demos :

View More Examples of exclusiveOr(Area rhs)
   1: 
   2:       area1 = new Area(new Ellipse2D.Double(100, 100, 150, 100));
   3:         ...
   4:       area2 = new Area(new Rectangle2D.Double(150, 150, 150, 100));
   5: 
   6:         ...
   7:                g2.draw(area2);
   8:                if (area != null) g2.fill(area);
   9:             }
  10:         ...
  11:                area.add(area1);
  12:                area.exclusiveOr(area2);

View Full Code Here

getBounds

public Rectangle getBounds()
Returns a bounding Rectangle that completely encloses this Area.

The Area class will attempt to return the tightest bounding box possible for the Shape. The bounding box will not be padded to include the control points of curves in the outline of the Shape, but should tightly fit the actual geometry of the outline itself. Since the returned object represents the bounding box with integers, the bounding box can only be as tight as the nearest integer coordinates that encompass the geometry of the Shape.

Specified by:
getBounds in interface Shape
Returns:
the bounding Rectangle for the Area.
Usages and Demos :

View More Examples of getBounds()
   1:         double lastY = 0.0;
   2:         Area currentUsage = new Area();
   3:         ...
   4:         Area childUsage = null;
   5:         ZBounds immediateChildrenBounds = new ZBounds();
   6:         ...
   7: 
   8:                 Rectangle2D allChildrenBounds = currentUsage.getBounds();
   9: 
  10:         ...
  11:         if (area == null) {
  12:             ZBounds bounds = aPrimaryNode.getBounds();

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Point2D;
   4:         ...
   5:                     requestedEnvelope = (GeneralEnvelope) gg.getEnvelope();
   6:                     dim = gg.getGridRange2D().getBounds();
   7:                 } else if (param.getDescriptor().getName().getCode().equals(
   8:         ...
   9:             final PlanarImage[] alphaChannels = new PlanarImage[numImages];
  10:             final Area finalLayout = new Area();
  11: 
  12:         ...
  13:                 location = (String) feature.getAttribute("location");
  14:                 bound = feature.getBounds();

View Full Code Here

getBounds2D

public Rectangle2D getBounds2D()
Returns a high precision bounding Rectangle2D that completely encloses this Area.

The Area class will attempt to return the tightest bounding box possible for the Shape. The bounding box will not be padded to include the control points of curves in the outline of the Shape, but should tightly fit the actual geometry of the outline itself.

Specified by:
getBounds2D in interface Shape
Returns:
the bounding Rectangle2D for the Area.

getPathIterator

public PathIterator getPathIterator(AffineTransform at)
Creates a PathIterator for the outline of this Area object. This Area object is unchanged.
Specified by:
getPathIterator in interface Shape
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 Area, one segment at a time.
Usages and Demos :

View More Examples of getPathIterator(AffineTransform at)
   1: 
   2: import java.awt.geom.Area;
   3: import java.awt.geom.GeneralPath;
   4:         ...
   5: 
   6:     public static ArrayList<ArrayList<Line2D>> getBoundariesLines(Area area) {
   7:         ArrayList<ArrayList<Line2D>> result = new ArrayList<ArrayList<Line2D>>();
   8:         ...
   9:         PathIterator pi = area.getPathIterator(null);
  10:         double coords[] = new double[6];
  11:         ...
  12:         ArrayList<ArrayList<Point2D>> result = new ArrayList<ArrayList<Point2D>>();
  13:         PathIterator pi = area.getPathIterator(null);

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Ellipse2D;
   4:         ...
   5:     
   6:     private transient Area area;
   7:     
   8:         ...
   9:     
  10:     for (PathIterator it = area.getPathIterator(null);
  11:          !it.isDone(); tot++) {

View Full Code Here

getPathIterator

public PathIterator getPathIterator(AffineTransform at,
                                    double flatness)
Creates a PathIterator for the flattened outline of this Area object. Only uncurved path segments represented by the SEG_MOVETO, SEG_LINETO, and SEG_CLOSE point types are returned by the iterator. This Area object is unchanged.
Specified by:
getPathIterator in interface Shape
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
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
Returns:
the PathIterator object that returns the geometry of the outline of this Area, one segment at a time.
Usages and Demos :

View More Examples of getPathIterator(AffineTransform at,double flatness)
   1: import java.awt.Shape;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.GeneralPath;
   4:         ...
   5:     Shape stroked = stroke.createStrokedShape(path);
   6:     Area area = new Area(stroked);
   7:         ...
   8:     PathIterator iter = area.getPathIterator(null, 10.0f);

View Full Code Here

intersect

public void intersect(Area rhs)
Sets the shape of this Area to the intersection of its current shape and the shape of the specified Area.
Parameters:
rhs - the Area to be intersected with this Area
Usages and Demos :

View More Examples of intersect(Area rhs)
   1: 
   2:       area1 = new Area(new Ellipse2D.Double(100, 100, 150, 100));
   3:         ...
   4:       area2 = new Area(new Rectangle2D.Double(150, 150, 150, 100));
   5: 
   6:         ...
   7:                g2.draw(area2);
   8:                if (area != null) g2.fill(area);
   9:             }
  10:         ...
  11:                area.add(area1);
  12:                area.intersect(area2);

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Dimension2D;
   4:         ...
   5:             DELTA + boundsCorrected.getWidth(), DELTA + boundsCorrected.getHeight());
   6:     final Area a = new Area(boundsCorrected);
   7:     if (a.isEmpty())
   8:         ...
   9:     final Area clipArea = new Area(s);
  10:     a.intersect(clipArea);
  11:     return a;

View Full Code Here
   1: import java.awt.geom.Arc2D;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Ellipse2D;
   4:         ...
   5:      {
   6:        Area current;
   7:         ...
   8:        if (clip instanceof Area)
   9:          current = (Area) clip;
  10:         ...
  11: 
  12:        current.intersect(intersect);

View Full Code Here

intersects

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Tests whether the interior of this Area object intersects the interior of the specified rectangular area.
Specified by:
intersects in interface Shape
Parameters:
w - the width of the specified rectangular area
h - the height of teh specified rectangular area
Returns:
true if the interior intersects the specified rectangular area; false otherwise;
Usages and Demos :

View More Examples of intersects(double x,double y,double w,double h)
   1: import java.awt.geom.Arc2D;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Ellipse2D;
   4:         ...
   5:     s = getTransform().createTransformedShape(s);
   6:     final Area area = new Area(s);
   7:     if (getClip() != null)
   8:         ...
   9:     }
  10:     return area.intersects(rect.x, rect.y, rect.width, rect.height);
  11:   }

View Full Code Here

intersects

public boolean intersects(Rectangle2D p)
Tests whether the interior of this Area object intersects the interior of the specified Rectangle2D.
Specified by:
intersects in interface Shape
Parameters:
p - the Rectangle2D to test for intersection
Returns:
true if the interior intersects the specified Rectangle2D; false otherwise.

isEmpty

public boolean isEmpty()
Tests whether this Area object encloses any area.
Returns:
true if this Area object represents an empty area; false otherwise.

isPolygonal

public boolean isPolygonal()
Tests whether this Area consists entirely of straight edged polygonal geometry.
Returns:
true if the geometry of this Area consists entirely of line segments; false otherwise.

isRectangular

public boolean isRectangular()
Tests whether this Area is rectangular in shape.
Returns:
true if the geometry of this Area is rectangular in shape; false otherwise.

isSingular

public boolean isSingular()
Tests whether this Area is comprised of a single closed subpath. This method returns true if the path contains 0 or 1 subpaths, or false if the path contains more than 1 subpath. The subpaths are counted by the number of SEG_MOVETO segments that appear in the path.
Returns:
true if the Area is comprised of a single basic geometry; false otherwise.

reset

public void reset()
Removes all of the geometry from this Area and restores it to an empty area.

subtract

public void subtract(Area rhs)
Subtracts the shape of the specified Area from the shape of this Area.
Parameters:
rhs - the Area to be subtracted from the current shape
Usages and Demos :

View More Examples of subtract(Area rhs)
   1: 
   2:     Area box1 = new Area(s1); 
   3:         ...
   4:     Area box2 = new Area(s2); 
   5:     Area box3 = new Area(s3); 
   6:         ...
   7:  
   8:     box1.subtract(box2);
   9:         ...
  10:     box2.subtract(box3);

View Full Code Here
   1: 
   2:       area1 = new Area(new Ellipse2D.Double(100, 100, 150, 100));
   3:         ...
   4:       area2 = new Area(new Rectangle2D.Double(150, 150, 150, 100));
   5: 
   6:         ...
   7:                g2.draw(area2);
   8:                if (area != null) g2.fill(area);
   9:             }
  10:         ...
  11:                area.add(area1);
  12:                area.subtract(area2);

View Full Code Here
   1: import java.awt.Rectangle;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Rectangle2D;
   4:         ...
   5:                     if (!canvasBounds.equals(XRectangle2D.INFINITY)) {
   6:                         final Area newArea = new Area(canvasBounds);
   7:         ...
   8:                         newArea.subtract(newArea.createTransformedArea(change));
   9:                         final Area area = (displayBounds instanceof Area) ?

View Full Code Here
   1: import java.awt.geom.Arc2D;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Line2D;
   4:         ...
   5: 
   6:     Area globalArea = new Area(new Rectangle2D.Double(x, y, width, height));
   7: 
   8:         ...
   9:       cornerArea.subtract(new Area(shape));
  10:       globalArea.subtract(cornerArea);
  11:     }

View Full Code Here
   1: import java.awt.Rectangle;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Point2D;
   4:         ...
   5: 
   6:     public void setPreferredArea(final Rectangle2D area) {
   7:         final Rectangle2D oldArea;
   8:         ...
   9:             oldArea = preferredArea;
  10:             preferredArea = (area!=null) ? (Rectangle2D)area.clone() : null;
  11:         }
  12:         ...
  13:                 final Area newArea = new Area(mapPane.getBounds());
  14:                 newArea.subtract(newArea.createTransformedArea(change));

View Full Code Here

transform

public void transform(AffineTransform t)
Transforms the geometry of this Area using the specified AffineTransform. The geometry is transformed in place, which permanently changes the enclosed area defined by this object.
Parameters:
t - the transformation used to transform the area
Usages and Demos :

View More Examples of transform(AffineTransform t)
   1: import java.awt.geom.Arc2D;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Point2D;
   4:         ...
   5: 
   6:         Area s = new Area(shape);
   7: 
   8:         ...
   9:             getTransform().setToRotation(angle, rotate.getX(), rotate.getY());
  10:             s.transform(getTransform());
  11:         }

View Full Code Here
   1: import java.awt.Graphics2D;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Ellipse2D;
   4:         ...
   5: 
   6:         Area shape;
   7:         GeneralPath pointer = new GeneralPath();
   8:         ...
   9: 
  10:         shape = new Area(circle);
  11:         shape.add(new Area(pointer));
  12:         ...
  13:             getTransform().setToRotation(angle, rotate.getX(), rotate.getY());
  14:             shape.transform(getTransform());

View Full Code Here
   1: import java.awt.Graphics2D;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Ellipse2D;
   4:         ...
   5: 
   6:         Area shape;
   7:         GeneralPath pointer = new GeneralPath();
   8:         ...
   9: 
  10:         shape = new Area(circle);
  11:         shape.add(new Area(pointer));
  12:         ...
  13:             getTransform().setToRotation(angle, rotate.getX(), rotate.getY());
  14:             shape.transform(getTransform());

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Ellipse2D;
   4:         ...
   5:     
   6:     private transient Area area;
   7:     
   8:         ...
   9:                          - height * 0.5);
  10:     area.transform(trans);
  11:     return new Area(area);
  12:         ...
  13:                          posY - lastPosY);
  14:     area.transform(trans);

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.geom.Area;
   3: import java.awt.geom.Ellipse2D;
   4:         ...
   5: 
   6:     private Area[] buildTicker()
   7:     {
   8:         ...
   9:         Area[] ticker = new Area[barsCount];
  10:         Point2D.Double center = new Point2D.Double((double) getWidth() / 2, (double) getHeight() / 2);
  11:         ...
  12: 
  13:             primitive.transform(toWheel);

View Full Code Here