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

java.lang.Object
  |
  +--com.ibm.wbi.http.beans.imagemap.ImageMapRegion
Direct Known Subclasses:
ImageMapCircle, ImageMapPolygon, ImageMapRectangle

public abstract class ImageMapRegion
extends java.lang.Object

Abstract class to define regions of an ImageMap. Allows a specific region of an image to be mapped to a url. Subclasses are expected to provide their own isInside methods to be called by ImageMap to determine if a specific point is located inside this region.

See Also:
com.ibm.wbi.http.beans.ImageMapGenerator

Field Summary
protected  java.lang.String url
           
 
Constructor Summary
ImageMapRegion()
          Initialize a region without mapping to a specific url.
ImageMapRegion(java.lang.String URL)
          Initialize a region to be mapped to a specific url.
 
Method Summary
 java.lang.String getUrl()
          Returns the url this region maps to.
abstract  boolean isInside(int x, int y)
          Determines if the location x,y is inside this defined region.
abstract  boolean isInside(Point point)
          Determines if the location point is inside this defined region.
static void main(java.lang.String[] args)
          Tests ImageMapRegion.
 void setUrl(java.lang.String URL)
          Sets the url the region is mapped to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

protected java.lang.String url
Constructor Detail

ImageMapRegion

public ImageMapRegion(java.lang.String URL)
Initialize a region to be mapped to a specific url.
Parameters:
URL - url this region maps to

ImageMapRegion

public ImageMapRegion()
Initialize a region without mapping to a specific url.
Method Detail

main

public static void main(java.lang.String[] args)
Tests ImageMapRegion.
Parameters:
args[] - command line parameters

isInside

public abstract 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

isInside

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

setUrl

public final void setUrl(java.lang.String URL)
Sets the url the region is mapped to.
Parameters:
URL - url the region should map to

getUrl

public final java.lang.String getUrl()
Returns the url this region maps to.
Returns:
url this region maps to; null if no url is currently defined