KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > svggen > GenericImageHandler


1 /*
2
3    Copyright 2001,2003 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.svggen;
19
20 import java.awt.Image JavaDoc;
21 import java.awt.geom.AffineTransform JavaDoc;
22 import java.awt.image.RenderedImage JavaDoc;
23 import java.awt.image.renderable.RenderableImage JavaDoc;
24
25 import org.w3c.dom.Element JavaDoc;
26
27 /**
28  * Extends the default ImageHandler interface with calls to
29  * allow caching of raster images in generated SVG content.
30  *
31  * @author <a HREF="mailto:vincent.hardy@sun.com">Vincent Hardy</a>
32  * @version $Id: GenericImageHandler.java,v 1.4 2004/08/18 07:14:59 vhardy Exp $
33  */

34 public interface GenericImageHandler {
35     /**
36      * Sets the DomTreeManager this image handler may need to
37      * interact with.
38      */

39     public void setDOMTreeManager(DOMTreeManager domTreeManager);
40
41     /**
42      * Creates an Element suitable for referring to images.
43      * Note that no assumptions can be made about the name of this Element.
44      */

45     public Element JavaDoc createElement(SVGGeneratorContext generatorContext);
46
47     /**
48      * The handler should set the xlink:href and return a transform
49      *
50      * @param image the image under consideration
51      * @param imageElement the DOM Element for this image
52      * @param x x coordinate
53      * @param y y coordinate
54      * @param width width for rendering
55      * @param height height for rendering
56      * @param generatorContext the SVGGeneratorContext
57      *
58      * @return transform converting the image dimension to rendered dimension
59      */

60     public AffineTransform JavaDoc handleImage(Image JavaDoc image, Element JavaDoc imageElement,
61                                        int x, int y,
62                                        int width, int height,
63                                        SVGGeneratorContext generatorContext);
64
65     /**
66      * The handler should set the xlink:href tag and return a transform
67      *
68      * @param image the image under consideration
69      * @param imageElement the DOM Element for this image
70      * @param x x coordinate
71      * @param y y coordinate
72      * @param width width for rendering
73      * @param height height for rendering
74      * @param generatorContext the SVGGeneratorContext
75      *
76      * @return transform converting the image dimension to rendered dimension
77      */

78     public AffineTransform JavaDoc handleImage(RenderedImage JavaDoc image, Element JavaDoc imageElement,
79                                        int x, int y,
80                                        int width, int height,
81                                        SVGGeneratorContext generatorContext);
82
83     /**
84      * The handler should set the xlink:href tag and return a transform
85      *
86      * @param image the image under consideration
87      * @param imageElement the DOM Element for this image
88      * @param x x coordinate
89      * @param y y coordinate
90      * @param width width for rendering
91      * @param height height for rendering
92      * @param generatorContext the SVGGeneratorContext
93      *
94      * @return transform converting the image dimension to rendered dimension
95      */

96     public AffineTransform JavaDoc handleImage(RenderableImage JavaDoc image, Element JavaDoc imageElement,
97                                        double x, double y,
98                                        double width, double height,
99                                        SVGGeneratorContext generatorContext);
100
101 }
102
Popular Tags