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.light;
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 import net.jbeans.j3d.bean.*;
33
34
35
36
37 /***
38 * Defines several bean information.
39 *
40 * @version $Revision: 1.3 $
41 * @author Masahiro Takatsuka (masa@jbeans.net)
42 * @see JBeansBeanInfo
43 */
44
45 public final class DirectionalLightBeanInfo extends JBeansBeanInfo {
46 static {
47 Class clazz = J3DBeanUtil.class;
48 }
49 private final static Class beanClass = DirectionalLight.class;
50 private static String iconColor16x16Filename = "resources/DirectionalLight/IconColor16.gif";
51 private static String iconColor32x32Filename = "resources/DirectionalLight/IconColor32.gif";
52 private static String iconMono16x16Filename;
53 private static String iconMono32x32Filename;
54
55 /***
56 * Returns a icons of the specified size.
57 * <PRE>
58 * </PRE>
59 *
60 * @param iconKind an ID (ICON_COLOR_16x16 or ICON_COLOR_32x32)
61 * indicating the size of the icon.
62 * @return Image
63 */
64 public Image getIcon(int iconKind) {
65 switch (iconKind) {
66 case BeanInfo.ICON_COLOR_16x16:
67 return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
68 case BeanInfo.ICON_COLOR_32x32:
69 return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
70 case BeanInfo.ICON_MONO_16x16:
71 return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
72 case BeanInfo.ICON_MONO_32x32:
73 return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
74 }
75 return null;
76 }
77
78 protected PropertyDescriptor createPropertyDescriptor(String s, Object aobj[]) {
79 return super.createPropertyDescriptor(beanClass, s, aobj);
80 }
81
82 /***
83 * Returns a BeanDescriptor for MtDirectionalLight bean.
84 * <PRE>
85 * </PRE>
86 *
87 * @return BeanDescriptor
88 */
89 public BeanDescriptor getBeanDescriptor() {
90 BeanDescriptor bd = createBeanDescriptor(beanClass, new Object[] {
91 "preferred", Boolean.TRUE, "isContainer", Boolean.FALSE, "shortDescription", "A directional light component."
92 });
93
94 bd.setValue("helpSetName", "net/jbeans/j3d/light/resources/DirectionalLight/jhelpset.hs");
95 return bd;
96 }
97
98 /***
99 * Returns PropertyDescriptors associated with a MtDirectionalLight bean.
100 * <PRE>
101 * </PRE>
102 *
103 * @return PropertyDescriptor[]
104 */
105 public PropertyDescriptor[] getPropertyDescriptors() {
106 return (new PropertyDescriptor[] {
107 createPropertyDescriptor("color", new Object[] {
108 BOUND, Boolean.TRUE, PREFERRED, Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "Set the directional light's color."}),
109 createPropertyDescriptor("direction", new Object[] {
110 BOUND, Boolean.TRUE, PREFERRED, Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "Set the direction."})
111 });
112 }
113
114 /***
115 * Returns EventSetDescriptors associated with a MtDirectionalLight bean.
116 * <PRE>
117 * </PRE>
118 *
119 * @return EventSetDescriptor[]
120 */
121 public EventSetDescriptor[] getEventSetDescriptors() {
122 EventSetDescriptor[] rv = {};
123 return rv;
124 }
125 }