View Javadoc

1   /*
2      Copyright 2002-2006 Martin van den Bemt
3   
4      Licensed under the Apache License, Version 2.0 (the "License");
5      you may not use this file except in compliance with the License.
6      You may obtain a copy of the License at
7   
8          http://www.apache.org/licenses/LICENSE-2.0
9   
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15  */
16  package org.xulux.guilayer.swing.util;
17  
18  import java.awt.Image;
19  import java.net.URL;
20  
21  import javax.swing.ImageIcon;
22  
23  /**
24   * A simple interface to make sure there are not classloader
25   * issues when jimi is not on the classpath.
26   * It also leaves open pluggable image libraries
27   *
28   * @todo Add support for pluggable image libraries.
29   *
30   * @author <a href="mailto:martin@mvdb.net">Martin van den Bemt</a>
31   * @version $Id: ImageLoaderInterface.java,v 1.1 2005/12/18 12:58:22 mvdb Exp $
32   */
33  public interface ImageLoaderInterface {
34  
35      /**
36       * Returns the specified image
37       *
38       * @param url the url to load if from
39       * @return the image
40       */
41      Image getImage(URL url);
42  
43      /**
44       * Returns the specified icon
45       *
46       * @param url the url to load if from
47       * @return the imageIcon
48       */
49      ImageIcon getIcon(URL url);
50  
51      /**
52       * Specifies if this imageloader is usable.
53       * Eg checking if the image classes are on the classpath,etc
54       * @todo move this to a utilclass..
55       * @return false if not usable.
56       */
57      boolean isUsable();
58  
59  }