Class TimerBeanBeanInfo

java.lang.Object
  |
  +--java.beans.SimpleBeanInfo
        |
        +--TimerBeanBeanInfo
All Implemented Interfaces:
java.beans.BeanInfo

public class TimerBeanBeanInfo
extends java.beans.SimpleBeanInfo

TimerBean BeanInfo class: This class stores information about the TimerBean (Bean) for use by a builder tool. The builder tool looks to this class to find out information about the properties, events, and methods the TimerBean supports.


Fields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
 
Constructor Summary
TimerBeanBeanInfo()
           
 
Method Summary
 java.awt.Image getIcon(int i)
          This method gives the TimerBean (Bean) a custom icon in the builder tool.
 java.beans.MethodDescriptor[] getMethodDescriptors()
          This method tells the builder tool which methods I want the user to see and have access to.
 java.beans.PropertyDescriptor[] getPropertyDescriptors()
          This method overrides the default property descriptors.
 
Methods inherited from class java.beans.SimpleBeanInfo
getAdditionalBeanInfo, getBeanDescriptor, getDefaultEventIndex, getDefaultPropertyIndex, getEventSetDescriptors, loadImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimerBeanBeanInfo

public TimerBeanBeanInfo()
Method Detail

getIcon

public java.awt.Image getIcon(int i)
This method gives the TimerBean (Bean) a custom icon in the builder tool.

PRE: This method assumes that the parameter is not equal to null.

POST: This method does nothing more than return a color 16x16 image if the parameter is equal to 1 or a color 32x32 image if the parameter is equal to 2 otherwise it returns null.

Overrides:
getIcon in class java.beans.SimpleBeanInfo
Parameters:
i - Type of icon requested by the Builder tool.
Returns:
Returns an image of the specified type if available. Otherwise it returns null.
Since:
08/16/2003

getPropertyDescriptors

public java.beans.PropertyDescriptor[] getPropertyDescriptors()
This method overrides the default property descriptors. In effect I am limiting the user to modify only the 'timeOut' value.

PRE: This method assumes that there is a String value named "timeOut" in the TimerBean class.

POST: This method does nothing more than try to create a PropertyDescriptor object for the "timeOut" value in the TimerBean class. In the process it lets the bean tool know that this is a custom property descriptor and that the TimeOutEditor class will handle the display. Afterwards, it sets the display name and returns the newly created ProperyDescriptor object.

Overrides:
getPropertyDescriptors in class java.beans.SimpleBeanInfo
Returns:
Returns a list of PropertyDesciptor objects that I to be displayed in the builder tool.
Since:
08/16/2003

getMethodDescriptors

public java.beans.MethodDescriptor[] getMethodDescriptors()
This method tells the builder tool which methods I want the user to see and have access to. This greatly simplifies the builder tool by hiding many methods that are of no use to the user and would only confuse them.

PRE: This method assumes that there are method called 'startTimer', 'stopTimer' and 'resetTImer' in the TimerBean class.

POST: This method is in charge of letting the bean tool know what methods to display to the user. It does so by first creating a Method object for each of the methods we want to display. Then finally it creates and returns a MethodDescriptor object array composed of the Method object we have just created.

Overrides:
getMethodDescriptors in class java.beans.SimpleBeanInfo
Returns:
Returns an array of the specified Method Objects.
Since:
08/16/2003