View Javadoc

1   /* -------------------------------------------------------------------
2    * Java source file for the class AmbientLightBeanInfo
3    * 
4    * Copyright (c), 2003, Masahiro Takatsuka.
5    * All Rights Researved.
6    * 
7    * Original Author: Masahiro Takatsuka (masa@jbeans.net)
8    * $Author: takatsukam $
9    * 
10   * $Date: 2004/03/03 11:53:05 $
11   * 
12   * $Id: AmbientLightBeanInfo.java,v 1.3 2004/03/03 11:53:05 takatsukam Exp $
13   * 
14   * Reference:		Document no:
15   * ___				___
16   * 
17   * To Do:
18   * ___
19   * 
20  ------------------------------------------------------------------- */
21  
22  /* --------------------------- Package ---------------------------- */
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  
33  /*====================================================================
34               Implementation of class AmbientLightBeanInfo             
35  ====================================================================*/
36  /***
37   * Defines several bean information.
38   * 
39   * @version $Revision: 1.3 $
40   * @author Masahiro Takatsuka (masa@jbeans.net)
41   * @see JBeansBeanInfo
42   */
43  
44  public final class AmbientLightBeanInfo extends JBeansBeanInfo {
45      private final static Class beanClass = AmbientLight.class;
46  	private static String iconColor16x16Filename = "resources/AmbientLight/IconColor16.gif";
47  	private static String iconColor32x32Filename = "resources/AmbientLight/IconColor32.gif";
48  	private static String iconMono16x16Filename;
49  	private static String iconMono32x32Filename;
50  	
51  	/***
52  	* Returns a icons of the specified size.
53  	* <PRE>
54  	* </PRE>
55  	* 
56  	* @param iconKind an ID (ICON_COLOR_16x16 or ICON_COLOR_32x32)
57  	* indicating the size of the icon.
58  	* @return Image
59  	*/
60  	public Image getIcon(int iconKind) {
61  		switch (iconKind) {
62  			case BeanInfo.ICON_COLOR_16x16:
63  			  return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
64  			case BeanInfo.ICON_COLOR_32x32:
65  			  return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
66  			case BeanInfo.ICON_MONO_16x16:
67  			  return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
68  			case BeanInfo.ICON_MONO_32x32:
69  			  return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
70  		}
71  		return null;
72  	}
73  
74      protected PropertyDescriptor createPropertyDescriptor(String s, Object aobj[]) {
75          return super.createPropertyDescriptor(beanClass, s, aobj);
76      }
77  
78  	/***
79  	* Returns a BeanDescriptor for MtAmbientLight bean.
80  	* <PRE>
81  	* </PRE>
82  	* 
83  	* @return BeanDescriptor
84  	*/
85      public BeanDescriptor getBeanDescriptor() {
86          BeanDescriptor bd = createBeanDescriptor(beanClass, new Object[] {
87              "preferred", Boolean.TRUE, "isContainer", Boolean.FALSE, "shortDescription", "An ambient light component."
88          });
89  		//bd.setValue("hidden-state", Boolean.TRUE);
90          bd.setValue("helpSetName", "net/jbeans/j3d/light/resources/AmbientLight/jhelpset.hs");
91  		return bd;
92      }
93  	
94  	/***
95  	 * Returns PropertyDescriptors associated with a MtAmbientLight bean.
96  	 * <PRE>
97  	 * </PRE>
98  	 * 
99  	 * @return PropertyDescriptor[]
100 	 */
101    	public PropertyDescriptor[] getPropertyDescriptors() {
102   		return (new PropertyDescriptor[] {
103   			createPropertyDescriptor("enable", new Object[] {
104   				BOUND, Boolean.TRUE, PREFERRED, Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "Set the state of the light."}),
105   			createPropertyDescriptor("color", new Object[] {
106   				BOUND, Boolean.TRUE, PREFERRED, Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "Set the ambient color."})
107   		});
108   	}
109 
110 	/***
111 	 * Returns EventSetDescriptors associated with a MtAmbientLight bean.
112 	 * <PRE>
113 	 * </PRE>
114 	 * 
115 	 * @return EventSetDescriptor[]
116 	 */
117   	public EventSetDescriptor[] getEventSetDescriptors() {
118 		EventSetDescriptor[] rv = {};
119 		return rv;
120   	}	
121 }