1 14 package org.wings.externalizer; 15 16 import org.wings.io.Device; 17 18 import javax.swing.*; 19 20 25 public class ImageIconExternalizer extends ImageExternalizer { 26 private static final Class [] 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 format) { 37 super(format); 38 } 39 40 public Class [] getSupportedClasses() { 41 return SUPPORTED_CLASSES; 42 } 43 44 public void write(Object obj, Device out) 45 throws java.io.IOException { 46 super.write(((ImageIcon) obj).getImage(), out); 47 } 48 } 49 50 51 | Popular Tags |