All Packages Class Hierarchy This Package Previous Next Index
Class image.XPolygon
java.lang.Object
|
+----java.awt.Polygon
|
+----image.XPolygon
- public class XPolygon
- extends Polygon
Extended polygon with following changes:
1. getBBox() returns bounding box 1 pixel wider&higher than getBounds()
2. contains() returns true for edge points
3. Noet that deprecated methods in Polygon can't be used
-
XPolygon()
-
-
XPolygon(int[], int[], int)
-
-
XPolygon(Polygon)
-
-
addPoint(int, int)
-
-
contains(int, int)
-
-
contains(Point)
-
-
contains(XPolygon)
- Test if contains the given poly
Note the function returns false when the given polygon has common vertices with the first one
-
getBBox()
-
-
scale(double)
- scale the polygon
-
setPoint(int, int, int)
-
-
translate(int, int)
-
XPolygon
public XPolygon()
XPolygon
public XPolygon(int x[],
int y[],
int n)
XPolygon
public XPolygon(Polygon p)
scale
public final void scale(double s)
- scale the polygon
- Parameters:
- scale - the scale (must be >0)
contains
public final boolean contains(int x,
int y)
- Overrides:
- contains in class Polygon
contains
public final boolean contains(Point p)
- Overrides:
- contains in class Polygon
contains
public final boolean contains(XPolygon f)
- Test if contains the given poly
Note the function returns false when the given polygon has common vertices with the first one
- Parameters:
- f - the second polygon
getBBox
public final Rectangle getBBox()
addPoint
public final void addPoint(int x,
int y)
- Overrides:
- addPoint in class Polygon
setPoint
public final void setPoint(int i,
int x,
int y)
translate
public final void translate(int x,
int y)
- Overrides:
- translate in class Polygon
All Packages Class Hierarchy This Package Previous Next Index