001// LEDDisplayBeanInfo Class 002// LEDDisplayBeanInfo.java 003 004package ca.bc.webarts.widgets.led; 005 006// Imports 007import java.beans.*; 008 009/** 010 * Description of the Class 011 * 012 * @created May 26, 2002 013 */ 014public class LEDDisplayBeanInfo extends SimpleBeanInfo 015{ 016 // Get the appropriate icon 017 /** 018 * Gets the icon attribute of the LEDDisplayBeanInfo object 019 * 020 * @param iconKind Description of the Parameter 021 * @return The icon value 022 */ 023 public java.awt.Image getIcon(int iconKind) 024 { 025 if (iconKind == BeanInfo.ICON_COLOR_16x16) 026 { 027 java.awt.Image img = loadImage("LEDDisplayIcon16.gif"); 028 return img; 029 } 030 if (iconKind == BeanInfo.ICON_COLOR_32x32) 031 { 032 java.awt.Image img = loadImage("LEDDisplayIcon32.gif"); 033 return img; 034 } 035 return null; 036 } 037 038 039 // Explicit declare the properties 040 /** 041 * Gets the propertyDescriptors attribute of the LEDDisplayBeanInfo object 042 * 043 * @return The propertyDescriptors value 044 */ 045 public PropertyDescriptor[] getPropertyDescriptors() 046 { 047 try 048 { 049 PropertyDescriptor 050 // Inherited properties 051 foreground = new PropertyDescriptor("foreground", LEDDisplay.class); 052 PropertyDescriptor 053 background = new PropertyDescriptor("background", LEDDisplay.class); 054 PropertyDescriptor 055 font = new PropertyDescriptor("font", LEDDisplay.class); 056 PropertyDescriptor 057 name = new PropertyDescriptor("name", LEDDisplay.class); 058 PropertyDescriptor 059 // New properties 060 raised = new PropertyDescriptor("raised", LEDDisplay.class); 061 PropertyDescriptor 062 numDigits = new PropertyDescriptor("numDigits", LEDDisplay.class); 063 PropertyDescriptor 064 value = new PropertyDescriptor("value", LEDDisplay.class); 065 066 // Hide the foreground, background, and font properties 067 foreground.setHidden(true); 068 background.setHidden(true); 069 font.setHidden(true); 070 071 PropertyDescriptor[] pd = {foreground, background, font, name, raised, 072 numDigits, value}; 073 return pd; 074 } 075 catch (IntrospectionException e) 076 { 077 throw new Error(e.toString()); 078 } 079 } 080} 081