1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package net.jbeans.j3d.scenegraph;
24
25 /* ------------------ Import classes (packages) ------------------- *//package-summary/html">class="comment"> ------------------ Import classes (packages) ------------------- *//package-summary.html">class="comment">/* ------------------ Import classes (packages) ------------------- *//package-summary.html">class="comment"> ------------------ Import classes (packages) ------------------- */
26 import java.awt.*;
27 import java.awt.event.*;
28 import java.beans.*;
29 import javax.swing.event.*;
30
31 import net.jbeans.bean.*;
32
33
34
35
36 /***
37 * generally describe AppearanceBeanInfo in here
38 *
39 * @version $Revision: 1.3 $
40 * @author Masahiro Takatsuka (masa@jbeans.net)
41 * @see JBeansBeanInfo
42 */
43
44 public final class AppearanceBeanInfo extends JBeansBeanInfo {
45 private final static Class beanClass = Appearance.class;
46
47 private static String iconColor16x16Filename = "resources/Appearance/IconColor16.gif";
48 private static String iconColor32x32Filename = "resources/Appearance/IconColor32.gif";
49 private static String iconMono16x16Filename;
50 private static String iconMono32x32Filename;
51
52 /***
53 * Returns a icons of the specified size.
54 * <PRE>
55 * </PRE>
56 *
57 * @param iconKind an ID (ICON_COLOR_16x16 or ICON_COLOR_32x32)
58 * indicating the size of the icon.
59 * @return Image
60 */
61 public Image getIcon(int iconKind) {
62 switch (iconKind) {
63 case BeanInfo.ICON_COLOR_16x16:
64 return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
65 case BeanInfo.ICON_COLOR_32x32:
66 return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
67 case BeanInfo.ICON_MONO_16x16:
68 return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
69 case BeanInfo.ICON_MONO_32x32:
70 return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
71 }
72 return null;
73 }
74
75 protected PropertyDescriptor createPropertyDescriptor(String s, Object aobj[]) {
76 return super.createPropertyDescriptor(beanClass, s, aobj);
77 }
78
79 /***
80 * Returns a BeanDescriptor for MtAmbientLight bean.
81 * <PRE>
82 * </PRE>
83 *
84 * @return BeanDescriptor
85 */
86 public BeanDescriptor getBeanDescriptor() {
87 BeanDescriptor bd = createBeanDescriptor(beanClass, new Object[] {
88 "preferred", Boolean.TRUE, "isContainer", Boolean.FALSE, "shortDescription", "An ambient light component."
89 });
90
91 bd.setValue("helpSetName", "net/jbeans/j3d/light/resources/AmbientLight/jhelpset.hs");
92 return bd;
93 }
94
95 /***
96 * Returns PropertyDescriptors associated with a MtAmbientLight bean.
97 * <PRE>
98 * </PRE>
99 *
100 * @return PropertyDescriptor[]
101 */
102 public PropertyDescriptor[] getPropertyDescriptors() {
103 return (new PropertyDescriptor[] {
104 createPropertyDescriptor("coloringAttributes", new Object[] {
105 BOUND, Boolean.TRUE, PREFERRED, Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "Set the attributes."}),
106 createPropertyDescriptor("lineAttributes", new Object[] {
107 BOUND, Boolean.TRUE, PREFERRED, Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "Set the attributes."}),
108 createPropertyDescriptor("material", new Object[] {
109 BOUND, Boolean.TRUE, PREFERRED, Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "Set the attributes."}),
110 createPropertyDescriptor("pointAttributes", new Object[] {
111 BOUND, Boolean.TRUE, PREFERRED, Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "Set the attributes."}),
112 createPropertyDescriptor("renderingAttributes", new Object[] {
113 BOUND, Boolean.TRUE, PREFERRED, Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "Set the attributes."}),
114 createPropertyDescriptor("texture", new Object[] {
115 BOUND, Boolean.TRUE, PREFERRED, Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "Set the attributes."}),
116 createPropertyDescriptor("textureAttributes", new Object[] {
117 BOUND, Boolean.TRUE, PREFERRED, Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "Set the attributes."}),
118 createPropertyDescriptor("textureUnitCount", new Object[] {
119 BOUND, Boolean.TRUE, PREFERRED, Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "Set the attributes."}),
120 createPropertyDescriptor("transparencyAttributes", new Object[] {
121 BOUND, Boolean.TRUE, PREFERRED, Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "Set the attributes."}),
122 });
123 }
124
125 /***
126 * Returns EventSetDescriptors associated with a MtAmbientLight bean.
127 * <PRE>
128 * </PRE>
129 *
130 * @return EventSetDescriptor[]
131 */
132 public EventSetDescriptor[] getEventSetDescriptors() {
133 EventSetDescriptor[] rv = {};
134 return rv;
135 }
136 }