1 53 54 package org.swixml.converters; 55 56 import org.jdom.Attribute; 57 import org.swixml.Converter; 58 import org.swixml.Localizer; 59 60 import javax.swing.*; 61 import java.awt.*; 62 63 71 public class ImageConverter implements Converter { 72 73 74 public static final Class TEMPLATE = Image.class; 75 76 83 public Object convert( final Class type, final Attribute attr, Localizer localizer ) { 84 return ImageConverter.conv( type, attr, localizer ); 85 } 86 87 94 public static Object conv( final Class type, final Attribute attr, Localizer localizer ) { 95 ImageIcon icon = (ImageIcon) ImageIconConverter.conv( type, attr, localizer ); 96 return icon != null ? icon.getImage() : null; 97 } 98 99 104 public Class convertsTo() { 105 return TEMPLATE; 106 } 107 } 108 | Popular Tags |