Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    
SUMMARY: 
java.lang.Object
  extended by org.apache.batik.svggen.SimpleImageHandler
All Implemented Interfaces:
ErrorConstants, GenericImageHandler, SVGSyntax, CSSConstants, SVGConstants, XMLConstants

public class SimpleImageHandler
extends java.lang.Object
implements GenericImageHandler, SVGSyntax, ErrorConstants

Implements the GenericImageHandler interface and only uses <image> elements. This class delegates to the ImageHandler interface for handling the xlink:href attribute on the elements it creates.


Field Detail

imageHandler

protected ImageHandler imageHandler
ImageHandler which handles xlink:href attribute setting

Constructor Detail

SimpleImageHandler

public SimpleImageHandler(ImageHandler imageHandler)
Parameters:
imageHandler - ImageHandler handling the xlink:href on the <image> elements this GenericImageHandler implementation creates.
Method Detail

setDOMTreeManager

public void setDOMTreeManager(DOMTreeManager domTreeManager)
This GenericImageHandler implementation does not need to interact with the DOMTreeManager.

Specified by:
setDOMTreeManager in interface GenericImageHandler

createElement

public org.w3c.dom.Element createElement(SVGGeneratorContext generatorContext)
Creates an Element which can refer to an image. Note that no assumptions should be made by the caller about the corresponding SVG tag.

Specified by:
createElement in interface GenericImageHandler

handleImage

public java.awt.geom.AffineTransform handleImage(java.awt.Image image,
                                                 org.w3c.dom.Element imageElement,
                                                 int x,
                                                 int y,
                                                 int width,
                                                 int height,
                                                 SVGGeneratorContext generatorContext)
The handler sets the xlink:href tag and returns a transform

Specified by:
handleImage in interface GenericImageHandler
Parameters:
image - the image under consideration
imageElement - the DOM Element for this image
x - x coordinate
y - y coordinate
width - width for rendering
height - height for rendering
generatorContext - the SVGGeneratorContext
Returns:
transform converting the image dimension to rendered dimension

handleImage

public java.awt.geom.AffineTransform handleImage(java.awt.image.RenderedImage image,
                                                 org.w3c.dom.Element imageElement,
                                                 int x,
                                                 int y,
                                                 int width,
                                                 int height,
                                                 SVGGeneratorContext generatorContext)
The handler sets the xlink:href tag and returns a transform

Specified by:
handleImage in interface GenericImageHandler
Parameters:
image - the image under consideration
imageElement - the DOM Element for this image
x - x coordinate
y - y coordinate
width - width for rendering
height - height for rendering
generatorContext - the SVGGeneratorContext
Returns:
transform converting the image dimension to rendered dimension

handleImage

public java.awt.geom.AffineTransform handleImage(java.awt.image.renderable.RenderableImage image,
                                                 org.w3c.dom.Element imageElement,
                                                 double x,
                                                 double y,
                                                 double width,
                                                 double height,
                                                 SVGGeneratorContext generatorContext)
The handler sets the xlink:href tag and returns a transform

Specified by:
handleImage in interface GenericImageHandler
Parameters:
image - the image under consideration
imageElement - the DOM Element for this image
x - x coordinate
y - y coordinate
width - width for rendering
height - height for rendering
generatorContext - the SVGGeneratorContext
Returns:
transform converting the image dimension to rendered dimension

setImageAttributes

protected void setImageAttributes(org.w3c.dom.Element imageElement,
                                  double x,
                                  double y,
                                  double width,
                                  double height,
                                  SVGGeneratorContext generatorContext)
Sets the x/y/width/height attributes on the <image> element.


handleEmptyImage

protected void handleEmptyImage(org.w3c.dom.Element imageElement)

Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    
SUMMARY: