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