image.setBookmark( bookmark ); } setBookmark( HTMLTags.ATTR_IMAGE, bookmark );  setActiveIDTypeIID(image);
setBookmark( HTMLTags.ATTR_IMAGE, bookmark ); }
	public void startImage( IImageContent image )	{		assert image != null;		IStyle mergedStyle = image.getStyle( );		if ( peek( mergedStyle ) )		{			return;		}		logger.log( Level.FINE, "[HTMLImageEmitter] Start image" ); //$NON-NLS-1$ 		Object generateBy = image.getGenerateBy( );				// include select handle chart		if ( renderOption != null && renderOption instanceof HTMLRenderOption )		{			HTMLRenderOption htmlOption = (HTMLRenderOption) renderOption;						if ( htmlOption.getIncludeSelectionHandle( )					&& generateBy instanceof ExtendedItemDesign )			{				startSelectHandleTableChart( );			}		}				StringBuffer styleBuffer = new StringBuffer( );		int display = checkElementType( image.getX( ), image.getY( ),				mergedStyle, styleBuffer );		String tag = openTagByType( display, DISPLAY_BLOCK );		// action		boolean hasAction = handleAction( image.getHyperlinkAction( ) );		String imgUri = getImageURI( image );		boolean useSVG = ( image.getMIMEType( ) != null )				&& image.getMIMEType( ).equalsIgnoreCase( "image/svg+xml" ); //$NON-NLS-1$		if ( useSVG )		{ // use svg			writer.openTag( HTMLTags.TAG_EMBED );			// bookmark			String bookmark = image.getBookmark( );			if ( bookmark == null )			{				bookmark = generateUniqueID( );				image.setBookmark( bookmark );			}			setBookmark( HTMLTags.ATTR_IMAGE, bookmark ); //$NON-NLS-1$			// If the image is a chart, add it to active id list, and output type ��iid to html			setActiveIDTypeIID(image);						//onresize gives the SVG a change to change its content			writer.attribute( "onresize", bookmark+".reload()"); //$NON-NLS-1$			writer.attribute( HTMLTags.ATTR_TYPE, "image/svg+xml" ); //$NON-NLS-1$			writer.attribute( HTMLTags.ATTR_SRC, imgUri );			setStyleName( image.getStyleClass( ) );			StringBuffer buffer = new StringBuffer( );			// build size			AttributeBuilder.buildSize( buffer, HTMLTags.ATTR_WIDTH, image					.getWidth( ) ); //$NON-NLS-1$			AttributeBuilder.buildSize( buffer, HTMLTags.ATTR_HEIGHT, image					.getHeight( ) ); //$NON-NLS-1$			// handle inline style			handleStyle( image, buffer, false );			writer.closeNoEndTag( );		}		else		{ // use img			// write image map if necessary			Object imageMapObject = image.getImageMap( );			// use imgUri as the image ID. As we know only the CHART can have			// image maps and each chart			// will have differnt URI, so it is safe for CHART. (If the named			// image also support image			// map, then we must use another way to get the image ID.			String imageMapId = imgUri;			boolean hasImageMap = ( imageMapObject != null )					&& ( imageMapObject instanceof String )					&& ( ( (String) imageMapObject ).length( ) > 0 );			if ( hasImageMap )			{				writer.openTag( HTMLTags.TAG_MAP );				writer.attribute( HTMLTags.ATTR_NAME, imageMapId );				writer.text( (String) imageMapObject, true, false );				writer.closeTag( HTMLTags.TAG_MAP );			}			writer.openTag( HTMLTags.TAG_IMAGE ); //$NON-NLS-1$			setStyleName( image.getStyleClass( ) );			setDisplayProperty( display, 0, styleBuffer );			// bookmark			String bookmark = image.getBookmark( );			if ( bookmark == null )			{				bookmark = generateUniqueID( );				image.setBookmark( bookmark );			}			setBookmark( HTMLTags.ATTR_IMAGE, bookmark ); //$NON-NLS-1$						// if the image is a chart, add it to active id list, and output type ��iid to html			setActiveIDTypeIID(image);			String ext = image.getExtension( );			// FIXME special process, such as encoding etc			writer.attribute( HTMLTags.ATTR_SRC, imgUri );			if ( hasImageMap )			{				// BUGZILLA 119245 request chart (without hyperlink) can't have				// borders, the BROWSER add blue-solid border to the image with				// maps.				if ( !hasAction )				{					// disable the border, if the user defines border with the					// image, it will be overided by the following style setting					IStyle style = image.getStyle( );					if ( style.getBorderTopStyle( ) == null )					{						// user doesn't define the border, remove it.						styleBuffer.append( "border-top-style:none;" );					}					else					{						// use define the border-style, but not define the						// border color, use the default						// color.						if ( style.getBorderTopColor( ) == null )						{							styleBuffer.append( "border-top-color:black" );						}					}					if ( style.getBorderBottomStyle( ) == null )					{						styleBuffer.append( "border-bottom-style:none;" );					}					else					{						if ( style.getBorderBottomColor( ) == null )						{							styleBuffer.append( "border-bottom-color:black" );						}					}					if ( style.getBorderLeftStyle( ) == null )					{						styleBuffer.append( "border-left-style:none;" );					}					else					{						if ( style.getBorderLeftColor( ) == null )						{							styleBuffer.append( "border-left-color:black" );						}					}					if ( style.getBorderRightStyle( ) == null )					{						styleBuffer.append( "border-right-style:none;" );					}					else					{						if ( style.getBorderRightColor( ) == null )						{							styleBuffer.append( "border-right-color:black" );						}					}				}				writer.attribute( HTMLTags.ATTR_USEMAP, "#" + imageMapId ); //$NON-NLS-1$ //$NON-NLS-2$			}			// alternative text			writer.attribute( HTMLTags.ATTR_ALT, image.getAltText( ) );			// help text			writer.attribute( HTMLTags.ATTR_TITLE, image.getHelpText( ) );			// image size			AttributeBuilder.buildSize( styleBuffer, HTMLTags.ATTR_WIDTH, image					.getWidth( ) ); //$NON-NLS-1$			AttributeBuilder.buildSize( styleBuffer, HTMLTags.ATTR_HEIGHT,					image.getHeight( ) ); //$NON-NLS-1$			// handle style			handleStyle( image, styleBuffer, false );			if ( ".PNG".equalsIgnoreCase( ext ) && imageHandler != null ) //$NON-NLS-1$			{				writer.attribute( HTMLTags.ATTR_ONLOAD, "fixPNG(this)" ); //$NON-NLS-1$			}			writer.closeNoEndTag( );		}		if ( hasAction )		{			writer.closeTag( HTMLTags.TAG_A );		}		writer.closeTag( tag );				// include	select handle chart		if ( renderOption != null && renderOption instanceof HTMLRenderOption )		{			HTMLRenderOption htmlOption = (HTMLRenderOption) renderOption;						if ( htmlOption.getIncludeSelectionHandle( )					&& generateBy instanceof ExtendedItemDesign )			{				endSelectHandleTableChart( );			}		}			}