de.gulden.framework.jjack

Class JJackBeanInfoAbstract

public abstract class JJackBeanInfoAbstract extends SimpleBeanInfo

Abstract base class for BeanInfo classes describing JJack clients as JavaBeans. If a JJack client is a subclass of JJackMonitor or JJackClient, it can be used as a JavaBean. This class makes it easy to create the corresponding BeanInfo class.

Version: 0.3

Author: Jens Gulden

Field Summary
static StringIMAGE_PREFIX
Prefix path to internal JJack icon images.
static StringIMAGE_SUFFIX
Suffix of internal JJack icon images.
protected intmethodDescriptorsCount
Number of MethodDescriptors.
protected intpropertyDescriptorsCount
Number of PropertyDescriptors.
protected ClassthisClass
Bean-class that gets described by this BeanInfo-class.
Constructor Summary
protected JJackBeanInfoAbstract(Class cl)
Constructor.
protected JJackBeanInfoAbstract(Class cl, int extraPropertyDescriptorsCount, int extraMethodDescriptorsCount)
Constructor.
Method Summary
protected voidexc(Exception e)
Outputs an Exception's type and message.
BeanDescriptorgetBeanDescriptor()
Gets the beans BeanDescriptor.
intgetDefaultEventIndex()
A bean may have a "default" event that is the event that will mostly commonly be used by humans when using the bean.
EventSetDescriptor[]getEventSetDescriptors()
Gets the beans EventSetDescriptors.
ImagegetIcon(int kind)
This method returns an image object that can be used to represent the bean in toolboxes, toolbars, etc.
MethodDescriptor[]getMethodDescriptors()
Gets the beans MethodDescriptors.
PropertyDescriptor[]getPropertyDescriptors()
Gets the beans PropertyDescriptors.

Field Detail

IMAGE_PREFIX

public static final String IMAGE_PREFIX
Prefix path to internal JJack icon images.

IMAGE_SUFFIX

public static final String IMAGE_SUFFIX
Suffix of internal JJack icon images.

methodDescriptorsCount

protected int methodDescriptorsCount
Number of MethodDescriptors.

propertyDescriptorsCount

protected int propertyDescriptorsCount
Number of PropertyDescriptors.

thisClass

protected Class thisClass
Bean-class that gets described by this BeanInfo-class.

Constructor Detail

JJackBeanInfoAbstract

protected JJackBeanInfoAbstract(Class cl)
Constructor.

Parameters: cl Bean-class that gets described by this BeanInfo-class.

JJackBeanInfoAbstract

protected JJackBeanInfoAbstract(Class cl, int extraPropertyDescriptorsCount, int extraMethodDescriptorsCount)
Constructor.

Parameters: cl Bean-class that gets described by this BeanInfo-class. extraPropertyDescriptorsCount number of PropertyDescriptors that are additionally handled by subclass extraMethodDescriptorsCount number of MethodDescriptors that are additionally handled by subclass

Method Detail

exc

protected void exc(Exception e)
Outputs an Exception's type and message. Program execution is not interrupted.

Parameters: e the exception

getBeanDescriptor

public BeanDescriptor getBeanDescriptor()
Gets the beans BeanDescriptor.

Returns: A BeanDescriptor providing overall information about the bean, such as its displayName, its customizer, etc.

getDefaultEventIndex

public int getDefaultEventIndex()
A bean may have a "default" event that is the event that will mostly commonly be used by humans when using the bean.

Returns: Index of default event in the EventSetDescriptor array returned by getEventSetDescriptors.

getEventSetDescriptors

public EventSetDescriptor[] getEventSetDescriptors()
Gets the beans EventSetDescriptors.

Returns: An array of EventSetDescriptors describing the kinds of events fired by this bean.

getIcon

public Image getIcon(int kind)
This method returns an image object that can be used to represent the bean in toolboxes, toolbars, etc.

Parameters: kind The kind of icon requested. This should be one of the constant values ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, or ICON_MONO_32x32.

Returns: An image object representing the requested icon. May return null if no suitable icon is available.

getMethodDescriptors

public MethodDescriptor[] getMethodDescriptors()
Gets the beans MethodDescriptors.

Returns: An array of MethodDescriptors describing the externally visible methods supported by this bean.

getPropertyDescriptors

public PropertyDescriptor[] getPropertyDescriptors()
Gets the beans PropertyDescriptors.

Returns: An array of PropertyDescriptors describing the editable properties supported by this bean.