Visual Color Imbalance Detector: Reconstructed project directories and files
[VistaCID.git] / org / tjworld / components / JIconToggleButtonBeanInfo.java
1 package org.tjworld.components;\r
2 \r
3 import java.beans.*;\r
4 \r
5 public class JIconToggleButtonBeanInfo extends SimpleBeanInfo {\r
6 \r
7 \r
8 \r
9 \r
10 \r
11 \r
12 \r
13   // Bean descriptor //GEN-FIRST:BeanDescriptor\r
14   private static BeanDescriptor beanDescriptor = new BeanDescriptor  ( JIconToggleButton.class , null );\r
15 \r
16   static {\r
17       beanDescriptor.setDisplayName ( "JIconToggleButton" );\r
18       beanDescriptor.setShortDescription ( "A JToggleButton with a Functionality Icon" );//GEN-HEADEREND:BeanDescriptor\r
19 \r
20     // Here you can add code for customizing the BeanDescriptor.\r
21 \r
22 }//GEN-LAST:BeanDescriptor\r
23 \r
24   // Properties information will be obtained from introspection.//GEN-FIRST:Properties\r
25   private static PropertyDescriptor[] properties = null;//GEN-HEADEREND:Properties\r
26 \r
27     // Here you can add code for customizing the properties array.\r
28 \r
29   //GEN-LAST:Properties\r
30 \r
31   // Event set information will be obtained from introspection.//GEN-FIRST:Events\r
32   private static EventSetDescriptor[] eventSets = null;//GEN-HEADEREND:Events\r
33 \r
34     // Here you can add code for customizing the event sets array.\r
35 \r
36   //GEN-LAST:Events\r
37 \r
38   // Method information will be obtained from introspection.//GEN-FIRST:Methods\r
39   private static MethodDescriptor[] methods = null;//GEN-HEADEREND:Methods\r
40 \r
41     // Here you can add code for customizing the methods array.\r
42     \r
43   //GEN-LAST:Methods\r
44 \r
45     private static java.awt.Image iconColor16 = null; //GEN-BEGIN:IconsDef\r
46     private static java.awt.Image iconColor32 = null;\r
47     private static java.awt.Image iconMono16 = null;\r
48     private static java.awt.Image iconMono32 = null; //GEN-END:IconsDef\r
49   private static String iconNameC16 = "/org/tjworld/components/media/JIconToggleButtonColor16.gif";//GEN-BEGIN:Icons\r
50   private static String iconNameC32 = null;\r
51   private static String iconNameM16 = null;\r
52   private static String iconNameM32 = null;//GEN-END:Icons\r
53 \r
54   private static final int defaultPropertyIndex = -1;//GEN-BEGIN:Idx\r
55   private static final int defaultEventIndex = -1;//GEN-END:Idx\r
56 \r
57 \r
58     /**\r
59      * Gets the bean's <code>BeanDescriptor</code>s.\r
60      * \r
61      * @return BeanDescriptor describing the editable\r
62      * properties of this bean.  May return null if the\r
63      * information should be obtained by automatic analysis.\r
64      */\r
65     public BeanDescriptor getBeanDescriptor() {\r
66         return beanDescriptor;\r
67     }\r
68 \r
69     /**\r
70      * Gets the bean's <code>PropertyDescriptor</code>s.\r
71      * \r
72      * @return An array of PropertyDescriptors describing the editable\r
73      * properties supported by this bean.  May return null if the\r
74      * information should be obtained by automatic analysis.\r
75      * <p>\r
76      * If a property is indexed, then its entry in the result array will\r
77      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.\r
78      * A client of getPropertyDescriptors can use "instanceof" to check\r
79      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.\r
80      */\r
81     public PropertyDescriptor[] getPropertyDescriptors() {\r
82         return properties;\r
83     }\r
84 \r
85     /**\r
86      * Gets the bean's <code>EventSetDescriptor</code>s.\r
87      * \r
88      * @return  An array of EventSetDescriptors describing the kinds of \r
89      * events fired by this bean.  May return null if the information\r
90      * should be obtained by automatic analysis.\r
91      */\r
92     public EventSetDescriptor[] getEventSetDescriptors() {\r
93         return eventSets;\r
94     }\r
95 \r
96     /**\r
97      * Gets the bean's <code>MethodDescriptor</code>s.\r
98      * \r
99      * @return  An array of MethodDescriptors describing the methods \r
100      * implemented by this bean.  May return null if the information\r
101      * should be obtained by automatic analysis.\r
102      */\r
103     public MethodDescriptor[] getMethodDescriptors() {\r
104         return methods;\r
105     }\r
106 \r
107     /**\r
108      * A bean may have a "default" property that is the property that will\r
109      * mostly commonly be initially chosen for update by human's who are \r
110      * customizing the bean.\r
111      * @return  Index of default property in the PropertyDescriptor array\r
112      *          returned by getPropertyDescriptors.\r
113      * <P>      Returns -1 if there is no default property.\r
114      */\r
115     public int getDefaultPropertyIndex() {\r
116         return defaultPropertyIndex;\r
117     }\r
118 \r
119     /**\r
120      * A bean may have a "default" event that is the event that will\r
121      * mostly commonly be used by human's when using the bean. \r
122      * @return Index of default event in the EventSetDescriptor array\r
123      *          returned by getEventSetDescriptors.\r
124      * <P>      Returns -1 if there is no default event.\r
125      */\r
126     public int getDefaultEventIndex() {\r
127         return defaultEventIndex;\r
128     }\r
129 \r
130     /**\r
131      * This method returns an image object that can be used to\r
132      * represent the bean in toolboxes, toolbars, etc.   Icon images\r
133      * will typically be GIFs, but may in future include other formats.\r
134      * <p>\r
135      * Beans aren't required to provide icons and may return null from\r
136      * this method.\r
137      * <p>\r
138      * There are four possible flavors of icons (16x16 color,\r
139      * 32x32 color, 16x16 mono, 32x32 mono).  If a bean choses to only\r
140      * support a single icon we recommend supporting 16x16 color.\r
141      * <p>\r
142      * We recommend that icons have a "transparent" background\r
143      * so they can be rendered onto an existing background.\r
144      *\r
145      * @param  iconKind  The kind of icon requested.  This should be\r
146      *    one of the constant values ICON_COLOR_16x16, ICON_COLOR_32x32, \r
147      *    ICON_MONO_16x16, or ICON_MONO_32x32.\r
148      * @return  An image object representing the requested icon.  May\r
149      *    return null if no suitable icon is available.\r
150      */\r
151     public java.awt.Image getIcon(int iconKind) {\r
152         switch ( iconKind ) {\r
153         case ICON_COLOR_16x16:\r
154             if ( iconNameC16 == null )\r
155                 return null;\r
156             else {\r
157                 if( iconColor16 == null )\r
158                     iconColor16 = loadImage( iconNameC16 );\r
159                 return iconColor16;\r
160             }\r
161         case ICON_COLOR_32x32:\r
162             if ( iconNameC32 == null )\r
163                 return null;\r
164             else {\r
165                 if( iconColor32 == null )\r
166                     iconColor32 = loadImage( iconNameC32 );\r
167                 return iconColor32;\r
168             }\r
169         case ICON_MONO_16x16:\r
170             if ( iconNameM16 == null )\r
171                 return null;\r
172             else {\r
173                 if( iconMono16 == null )\r
174                     iconMono16 = loadImage( iconNameM16 );\r
175                 return iconMono16;\r
176             }\r
177         case ICON_MONO_32x32:\r
178             if ( iconNameM32 == null )\r
179                 return null;\r
180             else {\r
181                 if( iconMono32 == null )\r
182                     iconMono32 = loadImage( iconNameM32 );\r
183                 return iconMono32;\r
184             }\r
185         default: return null;\r
186         }\r
187     }\r
188 \r
189 }\r
190 \r