question: private void handleImageMapArea ( HTMLElement areaTag ) { if ( curImageMap != null ) { String shape = areaTag . getAttributeById ( HTMLElement . ATTR_SHAPE ) ; boolean supportedShape = false ; if ( shape != null ) { String hrefStr = areaTag . getAttributeById ( HTMLElement . ATTR_HREF ) ; if ( shape . equalsIgnoreCase ( "default" ) ) { supportedShape = true ; curImageMap . setDefaultLink ( hrefStr ) ; } else if ( ( shape . equalsIgnoreCase ( "rect" ) ) || ( shape . equalsIgnoreCase ( "circle" ) ) ) { supportedShape = true ; String coordsStr = areaTag . getAttributeById ( HTMLElement . ATTR_COORDS ) ; if ( ( coordsStr != null ) && ( hrefStr != null ) ) { String curValStr = "" ; int coords [ ] = new int [ 4 ] ; int curCoord = 0 ; boolean error = true ; try { for ( int c = 0 ; c < coordsStr . length ( ) ; c ++ ) { char ch = coordsStr . charAt ( c ) ; if ( ch != ',' ) { curValStr += ch ; } else { coords [ curCoord ] = Integer . parseInt ( curValStr ) ; curCoord ++ ; curValStr = "" ; } } if ( curValStr . length ( ) > 0 ) { coords [ curCoord ] = Integer . parseInt ( curValStr ) ; curCoord ++ ; } if ( shape . equalsIgnoreCase ( "rect" ) ) { if ( curCoord == 4 ) { curImageMap . addRectArea ( new Rectangle ( coords [ 0 ] , coords [ 1 ] , coords [ 2 ] - coords [ 0 ] , coords [ 3 ] - coords [ 1 ] ) , hrefStr ) ; error = false ; } } else if ( curCoord == 3 ) { curImageMap . addRectArea ( new Rectangle ( coords [ 0 ] - coords [ 2 ] , coords [ 1 ] - coords [ 2 ] , coords [ 2 ] * 2 + 1 , coords [ 2 ] * 2 + 1 ) , hrefStr ) ; error = false ; } } catch ( Exception e ) { } if ( error ) { notifyImageMapError ( "AREA tag 'coords' property value is invalid (should be exactly 3 comma seperated numbers for circle, 4 for rectangle): " + coordsStr , HTMLCallback . ERROR_ATTIBUTE_VALUE_INVALID , HTMLElement . ATTR_COORDS , coordsStr ) ; } } } } if ( ! supportedShape ) { notifyImageMapError ( "Unsupported or missing AREA tag 'shape' property: " + shape , HTMLCallback . ERROR_ATTIBUTE_VALUE_INVALID , HTMLElement . ATTR_SHAPE , shape ) ; } } else { notifyImageMapError ( "AREA tag is defined without a parent MAP tag - ignoring" , HTMLCallback . ERROR_INVALID_TAG_HIERARCHY , - 1 , null ) ; } }
target:  Handles an area definition for an image map