KickJava   Java API By Example, From Geeks To Geeks.

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


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.Composite JavaDoc;
21 import java.awt.Paint JavaDoc;
22 import java.awt.Rectangle JavaDoc;
23 import java.awt.image.BufferedImageOp JavaDoc;
24
25 /**
26  * The ExtensionHandler interface allows the user to handle
27  * Java 2D API extensions that map to SVG concepts (such as custom
28  * Paints, Composites or BufferedImageOp filters).
29  *
30  * @author <a HREF="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
31  * @version $Id: ExtensionHandler.java,v 1.7 2004/08/18 07:14:59 vhardy Exp $
32  */

33 public interface ExtensionHandler {
34     /**
35      * @param paint Custom Paint to be converted to SVG
36      * @param generatorContext allows the handler to build DOM objects as needed.
37      * @return an SVGPaintDescriptor
38      */

39     public SVGPaintDescriptor handlePaint(Paint JavaDoc paint,
40                                           SVGGeneratorContext generatorContext);
41
42     /**
43      * @param composite Custom Composite to be converted to SVG.
44      * @param generatorContext allows the handler to build DOM objects as needed.
45      * @return an SVGCompositeDescriptor which contains a valid SVG filter,
46      * or null if the composite cannot be handled
47      *
48      */

49     public SVGCompositeDescriptor handleComposite(Composite JavaDoc composite,
50                                                   SVGGeneratorContext generatorContext);
51
52 /**
53      * @param filter Custom filter to be converted to SVG.
54      * @param filterRect Rectangle, in device space, that defines the area
55      * to which filtering applies. May be null, meaning that the
56      * area is undefined.
57      * @param generatorContext allows the handler to build DOM objects as needed.
58      * @return an SVGFilterDescriptor which contains a valid SVG filter,
59      * or null if the composite cannot be handled
60      */

61     public SVGFilterDescriptor handleFilter(BufferedImageOp JavaDoc filter,
62                                             Rectangle JavaDoc filterRect,
63                                             SVGGeneratorContext generatorContext);
64 }
65
Popular Tags