FileDocCategorySizeDatePackage
Shape.javaAPI DocAndroid 1.5 API5999Wed May 06 22:41:54 BST 2009java.awt

Shape

public interface Shape
The Shape interface defines a geometric shape defined by a boundary (outline) path. The path outline can be accessed through a PathIterator object. The Shape interface provides methods for obtaining the bounding box (which is the smallest rectangle containing the shape and for obtaining a PathIterator object for current Shape, as well as utility methods which determine if the Shape contains or intersects a Rectangle or contains a Point.
since
Android 1.0

Fields Summary
Constructors Summary
Methods Summary
public booleancontains(double x, double y)
Checks whether or not the point with specified coordinates lies inside the Shape.

param
x the X coordinate.
param
y the Y coordinate.
return
true, if the specified coordinates lie inside the Shape, false otherwise.

public booleancontains(double x, double y, double w, double h)
Checks whether or not the rectangle with specified [x, y, width, height] parameters lies inside the Shape.

param
x the X double coordinate of the rectangle's upper left corner.
param
y the Y double coordinate of the rectangle's upper left corner.
param
w the width of rectangle.
param
h the height of rectangle.
return
true, if the specified rectangle lies inside the Shape, false otherwise.

public booleancontains(java.awt.geom.Point2D point)
Checks whether or not the specified Point2D lies inside the Shape.

param
point the Point2D object.
return
true, if the specified Point2D lies inside the Shape, false otherwise.

public booleancontains(java.awt.geom.Rectangle2D r)
Checks whether or not the specified rectangle lies inside the Shape.

param
r the Rectangle2D object.
return
true, if the specified rectangle lies inside the Shape, false otherwise.

public java.awt.RectanglegetBounds()
Gets the bounding rectangle of the Shape. The bounding rectangle is the smallest rectangle which contains the Shape.

return
the bounding rectangle of the Shape.

public java.awt.geom.Rectangle2DgetBounds2D()
Gets the Rectangle2D which represents Shape bounds. The bounding rectangle is the smallest rectangle which contains the Shape.

return
the bounding rectangle of the Shape.

public java.awt.geom.PathIteratorgetPathIterator(java.awt.geom.AffineTransform at)
Gets the PathIterator object of the Shape which provides access to the shape's boundary modified by the specified AffineTransform.

param
at the specified AffineTransform object or null.
return
PathIterator object for the Shape.

public java.awt.geom.PathIteratorgetPathIterator(java.awt.geom.AffineTransform at, double flatness)
Gets the PathIterator object of the Shape which provides access to the coordinates of the shapes boundary modified by the specified AffineTransform. The flatness parameter defines the amount of subdivision of the curved segments and specifies the maximum distance which every point on the unflattened transformed curve can deviate from the returned flattened path segments.

param
at the specified AffineTransform object or null.
param
flatness the maximum number of the control points for a given curve which varies from colinear before a subdivided curve is replaced by a straight line connecting the endpoints.
return
PathIterator object for the Shape.

public booleanintersects(java.awt.geom.Rectangle2D r)
Checks whether or not the interior of rectangle specified by Rectangle2D object intersects the interior of the Shape.

param
r the Rectangle2D object.
return
true, if the Rectangle2D intersects the interior of the Shape, otherwise false.

public booleanintersects(double x, double y, double w, double h)
Checks whether or not the interior of rectangular specified by [x, y, width, height] parameters intersects the interior of the Shape.

param
x the X double coordinate of the rectangle's upper left corner.
param
y the Y double coordinate of the rectangle's upper left corner.
param
w the width of rectangle.
param
h the height of rectangle.
return
true, if the rectangle specified by [x, y, width, height] parameters intersects the interior of the Shape, false otherwise.