org.apache.batik.svggen

Class SimpleImageHandler

public class SimpleImageHandler extends 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 Summary
protected ImageHandlerimageHandler
ImageHandler which handles xlink:href attribute setting
Constructor Summary
SimpleImageHandler(ImageHandler imageHandler)
Method Summary
ElementcreateElement(SVGGeneratorContext generatorContext)
Creates an Element which can refer to an image.
protected voidhandleEmptyImage(Element imageElement)
AffineTransformhandleImage(Image image, Element imageElement, int x, int y, int width, int height, SVGGeneratorContext generatorContext)
The handler sets the xlink:href tag and returns a transform
AffineTransformhandleImage(RenderedImage image, Element imageElement, int x, int y, int width, int height, SVGGeneratorContext generatorContext)
The handler sets the xlink:href tag and returns a transform
AffineTransformhandleImage(RenderableImage image, Element imageElement, double x, double y, double width, double height, SVGGeneratorContext generatorContext)
The handler sets the xlink:href tag and returns a transform
voidsetDOMTreeManager(DOMTreeManager domTreeManager)
This GenericImageHandler implementation does not need to interact with the DOMTreeManager.
protected voidsetImageAttributes(Element imageElement, double x, double y, double width, double height, SVGGeneratorContext generatorContext)
Sets the x/y/width/height attributes on the <image> element.

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

createElement

public 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.

handleEmptyImage

protected void handleEmptyImage(Element imageElement)

handleImage

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

handleImage

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

handleImage

public AffineTransform handleImage(RenderableImage image, Element imageElement, double x, double y, double width, double height, SVGGeneratorContext generatorContext)
The handler sets the xlink:href tag and returns a transform

setDOMTreeManager

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

setImageAttributes

protected void setImageAttributes(Element imageElement, double x, double y, double width, double height, SVGGeneratorContext generatorContext)
Sets the x/y/width/height attributes on the <image> element.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.