home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1999 February / CDW0299.iso / Demos / Cafe / Source.bin / DaySpinnerBeanInfo.java < prev    next >
Encoding:
Java Source  |  1998-03-18  |  2.4 KB  |  82 lines

  1. package symantec.itools.awt.util.spinner;
  2.  
  3. import java.beans.*;
  4. import symantec.itools.beans.*;
  5. import java.util.ResourceBundle;
  6.  
  7. //  09/11/97    LAB    Removed redundant information.
  8.  
  9. /**
  10.  * BeanInfo for DaySpinner.
  11.  *
  12.  */
  13. public class DaySpinnerBeanInfo extends SimpleBeanInfo {
  14.  
  15.     /**
  16.      * Constructs a DaySpinnerBeanInfo object.
  17.      */
  18.     public DaySpinnerBeanInfo() {
  19.     }
  20.  
  21.     /**
  22.      * Gets a BeanInfo for the superclass of this bean.
  23.      * @return BeanInfo[] containing this bean's superclass BeanInfo
  24.      */
  25.     public BeanInfo[] getAdditionalBeanInfo() {
  26.         try {
  27.             BeanInfo[] bi = new BeanInfo[1];
  28.             bi[0] = Introspector.getBeanInfo(beanClass.getSuperclass());
  29.             return bi;
  30.         }
  31.         catch (IntrospectionException e) { throw new Error(e.toString());}
  32.     }
  33.  
  34.     /**
  35.      * Gets the SymantecBeanDescriptor for this bean.
  36.      * @return an object of type SymantecBeanDescriptor
  37.      * @see symantec.itools.beans.SymantecBeanDescriptor
  38.      */
  39.     public BeanDescriptor getBeanDescriptor() {
  40.         ResourceBundle group = ResourceBundle.getBundle("symantec.itools.resources.GroupBundle");
  41.         String s=group.getString("GroupAdditional"); 
  42.  
  43.         SymantecBeanDescriptor bd = new SymantecBeanDescriptor(beanClass);
  44.         bd.setCanAddChild(false);
  45.         bd.setFolder(s);
  46.         bd.setWinHelp("0x123AF");
  47.  
  48.         bd.addAdditionalConnections(getAdditionalBeanInfo());
  49.  
  50.         return (BeanDescriptor) bd;
  51.     }
  52.  
  53.     /**
  54.      * Gets an image that may be used to visually represent this bean
  55.      * (in the toolbar, on a form, etc).
  56.      * @param iconKind the type of icon desired, one of: BeanInfo.ICON_MONO_16x16,
  57.      * BeanInfo.ICON_COLOR_16x16, BeanInfo.ICON_MONO_32x32, or BeanInfo.ICON_COLOR_32x32.
  58.      * @return an image for this bean, always color even if requested monochrome
  59.      * @see BeanInfo#ICON_MONO_16x16
  60.      * @see BeanInfo#ICON_COLOR_16x16
  61.      * @see BeanInfo#ICON_MONO_32x32
  62.      * @see BeanInfo#ICON_COLOR_32x32
  63.      */
  64.     public java.awt.Image getIcon(int iconKind) {
  65.         if (iconKind == BeanInfo.ICON_MONO_16x16 ||
  66.             iconKind == BeanInfo.ICON_COLOR_16x16) {
  67.             java.awt.Image img = loadImage("DaySpinnerC16.gif");
  68.             return img;
  69.         }
  70.  
  71.         if (iconKind == BeanInfo.ICON_MONO_32x32 ||
  72.             iconKind == BeanInfo.ICON_COLOR_32x32) {
  73.             java.awt.Image img = loadImage("DaySpinnerC32.gif");
  74.             return img;
  75.         }
  76.  
  77.         return null;
  78.     }
  79.  
  80.     private final static Class beanClass = DaySpinner.class;
  81.  
  82.     }    //  end of class DaySpinnerBeanInfo