001 package org.jdesktop.swingx.painter; 002 003 import org.jdesktop.swingx.BeanInfoSupport; 004 import org.jdesktop.swingx.editors.EnumPropertyEditor; 005 import org.jdesktop.swingx.editors.ImageEditor; 006 import org.jdesktop.swingx.editors.ImageURLEditor; 007 008 /** 009 * BeanInfo of ImagePainter. 010 * 011 * @author joshy, Jan Stola 012 */ 013 public class ImagePainterBeanInfo extends BeanInfoSupport { 014 015 /** Creates a new instance of ImagePainterBeanInfo */ 016 public ImagePainterBeanInfo() { 017 super(ImagePainter.class); 018 } 019 020 protected void initialize() { 021 setPropertyEditor(ImageEditor.class,"image"); 022 setPropertyEditor(ImageURLEditor.class,"imageString"); 023 setPropertyEditor(ScaleTypePropertyEditor.class, "scaleType"); 024 setPreferred(true, "image", "imageString", "scaleType", "scaleToFit"); 025 } 026 027 public static final class ScaleTypePropertyEditor extends EnumPropertyEditor<ImagePainter.ScaleType> { 028 public ScaleTypePropertyEditor() { 029 super(ImagePainter.ScaleType.class); 030 } 031 } 032 033 }