Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/apache/batik/apps/svgbrowser/SquiggleInputHandler.java


1   /*
2   
3      Copyright 2002  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.svgbrowser;
19  
20  import java.io.File;
21  
22  import org.apache.batik.util.ParsedURL;
23  
24  /**
25   * This is the interface expected from classes which can handle specific 
26   * types of input for the Squiggle SVG browser. The simplest implementation
27   * will simply handle SVG documents. Other, more sophisticated implementations
28   * will handle other types of documents and convert them into SVG before
29   * displaying them in an SVG canvas.
30   *
31   * @author <a mailto="vincent.hardy@sun.com">Vincent Hardy</a>
32   * @version $Id: SquiggleInputHandler.java,v 1.3 2004/08/18 07:12:27 vhardy Exp $
33   */
34  public interface SquiggleInputHandler {
35      /**
36       * Returns the list of mime types handled by this handler.
37       */
38      String[] getHandledMimeTypes();
39  
40      /**
41       * Returns the list of file extensions handled by this handler
42       */
43      String[] getHandledExtensions();
44  
45      /**
46       * Returns a description for this handler
47       */
48      String getDescription();
49  
50      /**
51       * Returns true if the input file can be handled by the handler
52       */
53      boolean accept(File f);
54  
55      /**
56       * Returns true if the input URI can be handled by the handler
57       * @param purl URL describing the candidate input
58       */
59      boolean accept(ParsedURL purl);
60  
61      /**
62       * Handles the given input for the given JSVGViewerFrame
63       */
64      void handle(ParsedURL purl, JSVGViewerFrame svgFrame) throws Exception ;
65  }