Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package intro;
- import java.awt.Image;
- import java.beans.*;
- public class RectBeanInfo extends SimpleBeanInfo
- {
- Class beanClass = Rect.class; // @jve:decl-index=0:
- String iconColor16x16Filename;
- String iconColor32x32Filename;
- String iconMono16x16Filename;
- String iconMono32x32Filename;
- public RectBeanInfo() {
- }
- public PropertyDescriptor[] getPropertyDescriptors()
- {
- try
- {
- PropertyDescriptor _myHeight = new PropertyDescriptor(
- "myHeight", beanClass, "getMyHeight", "setMyHeight");
- PropertyDescriptor _myWidth = new PropertyDescriptor(
- "myWidth", beanClass, "getMyWidth", "setMyWidth");
- PropertyDescriptor _myXStart = new PropertyDescriptor(
- "myXStart", beanClass, "getMyXStart", "setMyXStart");
- PropertyDescriptor _myYStart = new PropertyDescriptor(
- "myYStart", beanClass, "getMyYStart", "setMyYStart");
- PropertyDescriptor[] pds = new PropertyDescriptor[] {
- _myHeight,
- _myWidth,
- _myXStart,
- _myYStart
- };
- return pds;
- } catch (Exception exception)
- {
- exception.printStackTrace();
- return null;
- }
- }
- public Image getIcon(int iconKind)
- {
- switch (iconKind)
- {
- case BeanInfo.ICON_COLOR_16x16:
- return ((iconColor16x16Filename != null)
- ? loadImage(iconColor16x16Filename) : null);
- case BeanInfo.ICON_COLOR_32x32:
- return ((iconColor32x32Filename != null)
- ? loadImage(iconColor32x32Filename) : null);
- case BeanInfo.ICON_MONO_16x16:
- return ((iconMono16x16Filename != null)
- ? loadImage(iconMono16x16Filename) : null);
- case BeanInfo.ICON_MONO_32x32:
- return ((iconMono32x32Filename != null)
- ? loadImage(iconMono32x32Filename) : null);
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement