KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > ext > awt > image > spi > URLRegistryEntry


1 /*
2
3    Copyright 1999-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
19 package org.apache.batik.ext.awt.image.spi;
20
21 import org.apache.batik.ext.awt.image.renderable.Filter;
22 import org.apache.batik.util.ParsedURL;
23
24 /**
25  * This type of Image tag registy entry is used for 'odd' URL types.
26  * Ussually this means that the URL uses a non-standard protocol. In
27  * these cases you should be aware that in order for the construction
28  * of the URL object to succeed you must register a @see
29  * URLStreamHandler using one of the methods listed in
30  * @see java.net.URL#URL(java.lang.String, java.lang.String, int, java.lang.String).
31  * */

32 public interface URLRegistryEntry extends RegistryEntry {
33     /**
34      * Check if the URL references an image that can be
35      * handled by this format handler. Generally speaking
36      * this should not open the URL. The decision should
37      * be based on the structure of the URL (such as
38      * the protocol in use).<p>
39      *
40      * If you don't care about the structure of the URL and only about
41      * the contents of the URL you should register as a
42      * StreamRegistryEntry, so the URL "connection" will be made
43      * only once.
44      *
45      * @param url The URL to inspect.
46      */

47     public boolean isCompatibleURL(ParsedURL url);
48
49     /**
50      * Decode the URL into a RenderableImage, here you should feel
51      * free to open the URL yourself.<P>
52      *
53      * This should only return a broken link image if the image
54      * is clearly of this format, but is unreadable for some reason.
55      * otherwise return null.<p>
56      *
57      * If all entries refuse the url or return null then the registry
58      * will automatically return a broken link image for you.
59      *
60      * @param url The url that reference the image.
61      * @param needRawData If true the image returned should not have
62      * any default color correction the file may
63      * specify applied.
64      */

65     public Filter handleURL(ParsedURL url, boolean needRawData);
66 }
67
Popular Tags