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