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


Constructor Index

 o XPolygon()
 o XPolygon(int[], int[], int)
 o XPolygon(Polygon)

Method Index

 o addPoint(int, int)
 o contains(int, int)
 o contains(Point)
 o contains(XPolygon)
Test if contains the given poly
Note the function returns false when the given polygon has common vertices with the first one
 o getBBox()
 o scale(double)
scale the polygon
 o setPoint(int, int, int)
 o translate(int, int)

Constructors

 o XPolygon
 public XPolygon()
 o XPolygon
 public XPolygon(int x[],
                 int y[],
                 int n)
 o XPolygon
 public XPolygon(Polygon p)

Methods

 o scale
 public final void scale(double s)
scale the polygon

Parameters:
scale - the scale (must be >0)
 o contains
 public final boolean contains(int x,
                               int y)
Overrides:
contains in class Polygon
 o contains
 public final boolean contains(Point p)
Overrides:
contains in class Polygon
 o 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
 o getBBox
 public final Rectangle getBBox()
 o addPoint
 public final void addPoint(int x,
                            int y)
Overrides:
addPoint in class Polygon
 o setPoint
 public final void setPoint(int i,
                            int x,
                            int y)
 o translate
 public final void translate(int x,
                             int y)
Overrides:
translate in class Polygon

All Packages  Class Hierarchy  This Package  Previous  Next  Index