Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.batik.ext.awt.geom
Class ShapeExtender  view ShapeExtender download ShapeExtender.java

java.lang.Object
  extended byorg.apache.batik.ext.awt.geom.ShapeExtender
All Implemented Interfaces:
ExtendedShape, java.awt.Shape

public class ShapeExtender
extends java.lang.Object
implements ExtendedShape

This class wraps a normal path into an extended path.

Version:
$Id: ShapeExtender.java,v 1.5 2004/10/30 18:38:05 deweese Exp $

Nested Class Summary
static class ShapeExtender.EPIWrap
           
 
Field Summary
(package private)  java.awt.Shape shape
           
 
Constructor Summary
ShapeExtender(java.awt.Shape shape)
           
 
Method Summary
 boolean contains(double x, double y)
          Test if the coordinates lie in the shape.
 boolean contains(double x, double y, double w, double h)
          Test if a high-precision rectangle lies completely in the shape.
 boolean contains(java.awt.geom.Point2D p)
          Test if the point lie in the shape.
 boolean contains(java.awt.geom.Rectangle2D r)
          Test if a high-precision rectangle lies completely in the shape.
 java.awt.Rectangle getBounds()
          Returns a Rectange that bounds the shape.
 java.awt.geom.Rectangle2D getBounds2D()
          Returns a high precision bounding box of the shape.
 ExtendedPathIterator getExtendedPathIterator()
          Get an extended Path iterator that may return SEG_ARCTO commands
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
          Return an iterator along the shape boundary.
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at, double flatness)
          Return an iterator along the flattened version of the shape boundary.
 boolean intersects(double x, double y, double w, double h)
          Test if a high-precision rectangle intersects the shape.
 boolean intersects(java.awt.geom.Rectangle2D r)
          Test if a high-precision rectangle intersects the shape.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shape

java.awt.Shape shape
Constructor Detail

ShapeExtender

public ShapeExtender(java.awt.Shape shape)
Method Detail

contains

public boolean contains(double x,
                        double y)
Description copied from interface: java.awt.Shape
Test if the coordinates lie in the shape.

Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(double x,
                        double y,
                        double w,
                        double h)
Description copied from interface: java.awt.Shape
Test if a high-precision rectangle lies completely in the shape. This is true if all points in the rectangle are in the shape, with the caveat that the operation may include high probability estimates when the actual calculation is prohibitively expensive. The java.awt.geom.Area class can be used for more precise answers.

Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(java.awt.geom.Point2D p)
Description copied from interface: java.awt.Shape
Test if the point lie in the shape.

Specified by:
contains in interface java.awt.Shape

contains

public boolean contains(java.awt.geom.Rectangle2D r)
Description copied from interface: java.awt.Shape
Test if a high-precision rectangle lies completely in the shape. This is true if all points in the rectangle are in the shape, with the caveat that the operation may include high probability estimates when the actual calculation is prohibitively expensive. The java.awt.geom.Area class can be used for more precise answers.

Specified by:
contains in interface java.awt.Shape

getBounds

public java.awt.Rectangle getBounds()
Description copied from interface: java.awt.Shape
Returns a Rectange that bounds the shape. There is no guarantee that this is the minimum bounding box, particularly if the shape overflows the finite integer range of a bound. Generally, getBounds2D returns a tighter bound.

Specified by:
getBounds in interface java.awt.Shape

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D()
Description copied from interface: java.awt.Shape
Returns a high precision bounding box of the shape. There is no guarantee that this is the minimum bounding box, but at least it never overflows.

Specified by:
getBounds2D in interface java.awt.Shape

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
Description copied from interface: java.awt.Shape
Return an iterator along the shape boundary. If the optional transform is provided, the iterator is transformed accordingly. Each call returns a new object, independent from others in use. It is recommended, but not required, that the Shape isolate iterations from future changes to the boundary, and document this fact.

Specified by:
getPathIterator in interface java.awt.Shape

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at,
                                                  double flatness)
Description copied from interface: java.awt.Shape
Return an iterator along the flattened version of the shape boundary. Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE points are returned in the iterator. The flatness paramter controls how far points are allowed to differ from the real curve; although a limit on accuracy may cause this parameter to be enlarged if needed.

If the optional transform is provided, the iterator is transformed accordingly. Each call returns a new object, independent from others in use. It is recommended, but not required, that the Shape isolate iterations from future changes to the boundary, and document this fact.

Specified by:
getPathIterator in interface java.awt.Shape

getExtendedPathIterator

public ExtendedPathIterator getExtendedPathIterator()
Description copied from interface: ExtendedShape
Get an extended Path iterator that may return SEG_ARCTO commands

Specified by:
getExtendedPathIterator in interface ExtendedShape

intersects

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)
Description copied from interface: java.awt.Shape
Test if a high-precision rectangle intersects the shape. This is true if any point in the rectangle is in the shape, with the caveat that the operation may include high probability estimates when the actual calculation is prohibitively expensive. The java.awt.geom.Area class can be used for more precise answers.

Specified by:
intersects in interface java.awt.Shape

intersects

public boolean intersects(java.awt.geom.Rectangle2D r)
Description copied from interface: java.awt.Shape
Test if a high-precision rectangle intersects the shape. This is true if any point in the rectangle is in the shape, with the caveat that the operation may include high probability estimates when the actual calculation is prohibitively expensive. The java.awt.geom.Area class can be used for more precise answers.

Specified by:
intersects in interface java.awt.Shape