1 | /* |
---|
2 | * |
---|
3 | * This software is provided by NOAA for full, free and open release. It is |
---|
4 | * understood by the recipient/user that NOAA assumes no liability for any |
---|
5 | * errors contained in the code. Although this software is released without |
---|
6 | * conditions or restrictions in its use, it is expected that appropriate |
---|
7 | * credit be given to its author and to the National Oceanic and Atmospheric |
---|
8 | * Administration should the software be included by the recipient as an |
---|
9 | * element in other product development. |
---|
10 | */ |
---|
11 | package gov.noaa.pmel.sgt; |
---|
12 | |
---|
13 | import java.beans.*; |
---|
14 | |
---|
15 | /** |
---|
16 | * BeanInfo for <code>Pane</code>. |
---|
17 | */ |
---|
18 | public class PaneBeanInfo extends SimpleBeanInfo { |
---|
19 | // getAdditionalBeanInfo method allows to return any number of additional |
---|
20 | // BeanInfo objects which provide information about the Bean that this BeanInfo |
---|
21 | // describes. |
---|
22 | public BeanInfo[] getAdditionalBeanInfo() { |
---|
23 | try { |
---|
24 | BeanInfo[] bi = new BeanInfo[1]; |
---|
25 | bi[0] = Introspector.getBeanInfo(beanClass.getSuperclass()); |
---|
26 | return bi; |
---|
27 | } |
---|
28 | catch (IntrospectionException e) { |
---|
29 | throw new Error(e.toString()); |
---|
30 | } |
---|
31 | } |
---|
32 | |
---|
33 | // getIcon returns an image object which can be used by toolboxes, toolbars |
---|
34 | // to represent this bean. Icon images are in GIF format. |
---|
35 | public java.awt.Image getIcon(int iconKind) { |
---|
36 | if (iconKind == BeanInfo.ICON_COLOR_16x16 || |
---|
37 | iconKind == BeanInfo.ICON_MONO_16x16) { |
---|
38 | java.awt.Image img = loadImage("PaneIcon16.gif"); |
---|
39 | return img; |
---|
40 | } |
---|
41 | if (iconKind == BeanInfo.ICON_COLOR_32x32 || |
---|
42 | iconKind == BeanInfo.ICON_MONO_32x32) { |
---|
43 | java.awt.Image img = loadImage("PaneIcon32.gif"); |
---|
44 | return img; |
---|
45 | } |
---|
46 | return null; |
---|
47 | } |
---|
48 | |
---|
49 | // getPropertyDescriptors returns an array of PropertyDescriptors which describe |
---|
50 | // the editable properties of this bean. |
---|
51 | public PropertyDescriptor[] getPropertyDescriptors() { |
---|
52 | try { |
---|
53 | PropertyDescriptor id = new PropertyDescriptor("id", beanClass); |
---|
54 | id.setBound(false); |
---|
55 | id.setDisplayName("Pane Identifier"); |
---|
56 | |
---|
57 | PropertyDescriptor rv[] = {id}; |
---|
58 | return rv; |
---|
59 | } catch (IntrospectionException e) { |
---|
60 | throw new Error(e.toString()); |
---|
61 | } |
---|
62 | } |
---|
63 | |
---|
64 | public BeanDescriptor getBeanDescriptor() { |
---|
65 | return new BeanDescriptor(beanClass); |
---|
66 | } |
---|
67 | |
---|
68 | private final static Class beanClass = Pane.class; |
---|
69 | } |
---|