KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > apps > rasterizer > SVGConverterController


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.apps.rasterizer;
19
20 import java.io.File JavaDoc;
21 import java.util.Map JavaDoc;
22 import java.util.Vector JavaDoc;
23
24 import org.apache.batik.transcoder.Transcoder;
25
26 /**
27  * Interface for controlling some aspectes of the
28  * <tt>SVGConverter</tt> operation.
29  *
30  * @author <a HREF="mailto:vhardy@apache.org">Vincent Hardy</a>
31  * @version $Id: SVGConverterController.java,v 1.4 2004/08/18 07:12:26 vhardy Exp $
32  */

33 public interface SVGConverterController {
34     /**
35      * Invoked when the rasterizer has computed the
36      * exact description of what it should do. The controller
37      * should return true if the transcoding process should
38      * proceed or false otherwise.
39      *
40      * @param transcoder Transcoder which will be used
41      * @param hints set of hints that were set on the transcoder
42      * @param sources list of SVG sources it will convert.
43      * @param dest list of destination file it will use
44      */

45     public boolean proceedWithComputedTask(Transcoder transcoder,
46                                            Map JavaDoc hints,
47                                            Vector JavaDoc sources,
48                                            Vector JavaDoc dest);
49
50     /**
51      * Invoked when the rasterizer is about to start transcoding
52      * of a given source.
53      * The controller should return true if the source should be
54      * transcoded and false otherwise.
55      */

56     public boolean proceedWithSourceTranscoding(SVGConverterSource source,
57                                                 File JavaDoc dest);
58         
59     /**
60      * Invoked when the rasterizer got an error while
61      * transcoding the input source.
62      * The controller should return true if the transcoding process
63      * should continue on other sources and it should return false
64      * if it should not.
65      *
66      * @param errorCode see the {@link SVGConverter} error code descriptions.
67      */

68     public boolean proceedOnSourceTranscodingFailure(SVGConverterSource source,
69                                                      File JavaDoc dest,
70                                                      String JavaDoc errorCode);
71
72     /**
73      * Invoked when the rasterizer successfully transcoded
74      * the input source.
75      */

76     public void onSourceTranscodingSuccess(SVGConverterSource source,
77                                            File JavaDoc dest);
78
79 }
80
81
Popular Tags