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