com.ibm.wbi.http.beans.imagemap
Class ImageMapPolygon

java.lang.Object
  |
  +--com.ibm.wbi.http.beans.imagemap.ImageMapRegion
        |
        +--com.ibm.wbi.http.beans.imagemap.ImageMapPolygon

public final class ImageMapPolygon
extends ImageMapRegion

Defines an ImageMapRegion that represents a polygon.


Fields inherited from class com.ibm.wbi.http.beans.imagemap.ImageMapRegion
url
 
Constructor Summary
ImageMapPolygon()
          Constructs a Polygon region with no region specifications.
ImageMapPolygon(java.lang.String url, int[] x, int[] y)
          Constructs a Polygon region mapped to url, with points (x[n],y[n]) defining the polygon.
ImageMapPolygon(java.lang.String url, Point[] points)
          Constructs a Polygon region mapped to url, with points (points[]) defining the polygon.
 
Method Summary
 boolean isInside(int x, int y)
          Determines if the location x,y is inside this defined region.
 boolean isInside(Point point)
          Determines if the location point is inside this defined region.
 void set(int[] x, int[] y)
          Sets the points defining this polygon region to (x[n],y[n]).
 void set(Point[] points)
          Sets the points defining this polygon region to (points[n]).
 
Methods inherited from class com.ibm.wbi.http.beans.imagemap.ImageMapRegion
getUrl, main, setUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageMapPolygon

public ImageMapPolygon()
Constructs a Polygon region with no region specifications.

ImageMapPolygon

public ImageMapPolygon(java.lang.String url,
                       int[] x,
                       int[] y)
                throws ImageMapPolygonException
Constructs a Polygon region mapped to url, with points (x[n],y[n]) defining the polygon.
Parameters:
url - url this region is mapped to
x - series of x coordinates for all points defining polygon
y - series of y coordinates for all points defining polygon
Throws:
ImageMapPolygonException - if size of array x does not match size of array y

ImageMapPolygon

public ImageMapPolygon(java.lang.String url,
                       Point[] points)
Constructs a Polygon region mapped to url, with points (points[]) defining the polygon.
Parameters:
url - url this region is mapped to
points - series of points defining polygon
Method Detail

set

public void set(int[] x,
                int[] y)
         throws ImageMapPolygonException
Sets the points defining this polygon region to (x[n],y[n]).
Parameters:
x - series of x coordinates for all points defining polygon
y - series of y coordinates for all points defining polygon
Throws:
ImageMapPolygonException - if size of array x does not match size of array y

set

public void set(Point[] points)
Sets the points defining this polygon region to (points[n]).
Parameters:
points - series of points defining polygon

isInside

public boolean isInside(int x,
                        int y)
Determines if the location x,y is inside this defined region.
Parameters:
x - x coordinate
y - y coordinate
Returns:
true if x,y is inside the region; false if x,y is not inside the region
Overrides:
isInside in class ImageMapRegion

isInside

public boolean isInside(Point point)
Determines if the location point is inside this defined region.
Parameters:
point - the point in question
true - if x,y is inside the region; false if x,y is not inside the region
Overrides:
isInside in class ImageMapRegion