KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > externalizer > ImageIconExternalizer


1 /*
2  * $Id: ImageIconExternalizer.java,v 1.3 2004/12/01 07:54:08 hengels Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings.externalizer;
15
16 import org.wings.io.Device;
17
18 import javax.swing.*;
19
20 /**
21  * @author <a HREF="mailto:haaf@mercatis.de">Armin Haaf</a>
22  * @author <a HREF="mailto:mreinsch@to.com">Michael Reinsch</a>
23  * @version $Revision: 1.3 $
24  */

25 public class ImageIconExternalizer extends ImageExternalizer {
26     private static final Class JavaDoc[] SUPPORTED_CLASSES = {ImageIcon.class};
27
28     public static final ImageIconExternalizer SHARED_GIF_INSTANCE = new ImageIconExternalizer(FORMAT_GIF);
29     public static final ImageIconExternalizer SHARED_PNG_INSTANCE = new ImageIconExternalizer(FORMAT_PNG);
30
31
32     public ImageIconExternalizer() {
33         super();
34     }
35
36     public ImageIconExternalizer(String JavaDoc format) {
37         super(format);
38     }
39
40     public Class JavaDoc[] getSupportedClasses() {
41         return SUPPORTED_CLASSES;
42     }
43
44     public void write(Object JavaDoc obj, Device out)
45             throws java.io.IOException JavaDoc {
46         super.write(((ImageIcon) obj).getImage(), out);
47     }
48 }
49
50
51
Popular Tags