|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.text.html.Map
Map is used to represent a map element that is part of an HTML document. Once a Map has been created, and any number of areas have been added, you can test if a point falls inside the map via the contains method.
Nested Class Summary | |
(package private) static class |
Map.CircleRegionContainment
Used to test for containment in a circular region. |
(package private) static class |
Map.DefaultRegionContainment
An implementation that will return true if the x, y location is inside a rectangle defined by origin 0, 0, and width equal to width passed in, and height equal to height passed in. |
(package private) static class |
Map.PolygonRegionContainment
Used to test for containment in a polygon region. |
(package private) static class |
Map.RectangleRegionContainment
Used to test for containment in a rectangular region. |
(package private) static interface |
Map.RegionContainment
Defines the interface used for to check if a point is inside a region. |
Field Summary | |
private Vector |
areaAttributes
An array of AttributeSets. |
private Vector |
areas
An array of RegionContainments, will slowly grow to match the length of areaAttributes as needed. |
private String |
name
Name of the Map. |
Constructor Summary | |
Map()
|
|
Map(String name)
|
Method Summary | |
void |
addArea(AttributeSet as)
Defines a region of the Map, based on the passed in AttributeSet. |
protected Map.RegionContainment |
createRegionContainment(AttributeSet attributes)
Creates and returns an instance of RegionContainment that can be used to test if a particular point lies inside a region. |
protected static int[] |
extractCoords(Object stringCoords)
Creates and returns an array of integers from the String stringCoords . |
AttributeSet |
getArea(int x,
int y,
int width,
int height)
Returns the AttributeSet that contains the passed in location, x , y . |
AttributeSet[] |
getAreas()
Returns the AttributeSets representing the differet areas of the Map. |
String |
getName()
Returns the name of the Map. |
void |
removeArea(AttributeSet as)
Removes the previously created area. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private String name
private Vector areaAttributes
private Vector areas
Constructor Detail |
public Map()
public Map(String name)
Method Detail |
public String getName()
public void addArea(AttributeSet as)
public void removeArea(AttributeSet as)
public AttributeSet[] getAreas()
public AttributeSet getArea(int x, int y, int width, int height)
x
, y
. width
, height
gives the size of the region the map is defined over. If a matching
area is found, the AttribueSet for it is returned.
protected Map.RegionContainment createRegionContainment(AttributeSet attributes)
protected static int[] extractCoords(Object stringCoords)
stringCoords
. If one of the values represents a
% the returned value with be negative. If a parse error results
from trying to parse one of the numbers null is returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |