sb.append( "<AREA href=\"javascript:void(0)\"  onblur=\"" ); sb.append( eval( sv.getScript( ) ) ); sb.append( "\" shape=\"poly\" coords=\"" ); sb.append( coords ).append( "\">" );
tag.addAttribute( HTMLAttribute.HREF, NO_OP_JAVASCRIPT ); tag.addAttribute( HTMLAttribute.ONBLUR, eval( sv.getScript( ) ) ); tag.addAttribute( HTMLAttribute.SHAPE, POLY_SHAPE); tag.addAttribute( HTMLAttribute.COORDS, coords ); sb.append( tag.toString( ) );
	public String getImageMap( )	{		Map triggerMap = getTriggers( );		if ( triggerMap == null || triggerMap.size( ) == 0 )		{			return null;		}		// Generate image map using associated trigger list.		StringBuffer sb = new StringBuffer( );		// 1. onfocus		List al = (List) triggerMap.get( TriggerCondition.ONFOCUS_LITERAL );		if ( al != null )		{			for ( int i = al.size() - 1; i >= 0; i -- )			{				ShapedAction sa = (ShapedAction) al.get( i );				Action ac = sa.getAction( );				String coords = shape2polyCoords( sa.getShape( ) );				if ( coords != null )				{					if ( checkSupportedAction( ac ) )					{						switch ( ac.getType( ).getValue( ) )						{							case ActionType.URL_REDIRECT :								URLValue uv = (URLValue) ac.getValue( );								sb.append( "<AREA href=\"javascript:void(0)\" onfocus=\"" ); //$NON-NLS-1$								sb.append( "window.location.href='" ); //$NON-NLS-1$								sb.append( eval( uv.getBaseUrl( ) ) );								sb.append( "'\" shape=\"poly\" coords=\"" ); //$NON-NLS-1$								sb.append( coords ).append( "\">" ); //$NON-NLS-1$								break;							case ActionType.SHOW_TOOLTIP :								// for onmouseover only.								break;							case ActionType.INVOKE_SCRIPT :								ScriptValue sv = (ScriptValue) ac.getValue( );								sb.append( "<AREA href=\"javascript:void(0)\" onfocus=\"" ); //$NON-NLS-1$								sb.append( eval( sv.getScript( ) ) );								sb.append( "\" shape=\"poly\" coords=\"" ); //$NON-NLS-1$								sb.append( coords ).append( "\">" ); //$NON-NLS-1$								break;						}					}					else					{						// not supported by image map.					}				}			}		}		// 2. onblur		al = (List) triggerMap.get( TriggerCondition.ONBLUR_LITERAL );		if ( al != null )		{			for ( int i = al.size() - 1; i >= 0; i -- )			{				ShapedAction sa = (ShapedAction) al.get( i );				Action ac = sa.getAction( );				String coords = shape2polyCoords( sa.getShape( ) );				if ( coords != null )				{					if ( checkSupportedAction( ac ) )					{						switch ( ac.getType( ).getValue( ) )						{							case ActionType.URL_REDIRECT :								URLValue uv = (URLValue) ac.getValue( );								sb.append( "<AREA href=\"javascript:void(0)\"  onblur=\"" ); //$NON-NLS-1$								sb.append( "window.location.href='" ); //$NON-NLS-1$								sb.append( eval( uv.getBaseUrl( ) ) );								sb.append( "'\" shape=\"poly\" coords=\"" ); //$NON-NLS-1$								sb.append( coords ).append( "\">" ); //$NON-NLS-1$								break;							case ActionType.SHOW_TOOLTIP :								// for onmouseover only.								break;							case ActionType.INVOKE_SCRIPT :								ScriptValue sv = (ScriptValue) ac.getValue( );								sb.append( "<AREA href=\"javascript:void(0)\"  onblur=\"" ); //$NON-NLS-1$								sb.append( eval( sv.getScript( ) ) );								sb.append( "\" shape=\"poly\" coords=\"" ); //$NON-NLS-1$								sb.append( coords ).append( "\">" ); //$NON-NLS-1$								break;						}					}					else					{						// not supported by image map.					}				}			}		}		// 3. onclick		al = (List) triggerMap.get( TriggerCondition.ONCLICK_LITERAL );		if ( al != null )		{			for ( int i = al.size() - 1; i >= 0; i -- )			{				ShapedAction sa = (ShapedAction) al.get( i );				Action ac = sa.getAction( );				String coords = shape2polyCoords( sa.getShape( ) );				if ( coords != null )				{					if ( checkSupportedAction( ac ) )					{						switch ( ac.getType( ).getValue( ) )						{							case ActionType.URL_REDIRECT :								URLValue uv = (URLValue) ac.getValue( );								sb.append( "<AREA href=\"" ); //$NON-NLS-1$								sb.append( eval( uv.getBaseUrl( ) ) );								sb.append( "\" shape=\"poly\" coords=\"" ); //$NON-NLS-1$								sb.append( coords ).append( "\">" ); //$NON-NLS-1$								break;							case ActionType.SHOW_TOOLTIP :								// for onmouseover only.								break;							case ActionType.INVOKE_SCRIPT :								ScriptValue sv = (ScriptValue) ac.getValue( );								sb.append( "<AREA href=\"javascript:void(0)\" onclick=\"" ); //$NON-NLS-1$								sb.append( eval( sv.getScript( ) ) );								sb.append( "\" shape=\"poly\" coords=\"" ); //$NON-NLS-1$								sb.append( coords ).append( "\">" ); //$NON-NLS-1$								break;						}					}					else					{						// not supported by image map.					}				}			}		}		// 4. onmouseover		al = (List) triggerMap.get( TriggerCondition.ONMOUSEOVER_LITERAL );		if ( al != null )		{			for ( int i = al.size() - 1; i >= 0; i -- )			{				ShapedAction sa = (ShapedAction) al.get( i );				Action ac = sa.getAction( );				String coords = shape2polyCoords( sa.getShape( ) );				if ( coords != null )				{					if ( checkSupportedAction( ac ) )					{						switch ( ac.getType( ).getValue( ) )						{							case ActionType.URL_REDIRECT :								// not for onmouseover.								break;							case ActionType.SHOW_TOOLTIP :								TooltipValue tv = (TooltipValue) ac.getValue( );								sb.append( "<AREA alt=\"" ); //$NON-NLS-1$								sb.append( eval( tv.getText( ) ) );								sb.append( "\" shape=\"poly\" coords=\"" ); //$NON-NLS-1$								sb.append( coords ).append( "\">" ); //$NON-NLS-1$								break;							case ActionType.INVOKE_SCRIPT :								// not for onmouseover.								break;						}					}					else					{						// not supported by image map.					}				}			}		}		return sb.toString( );	}