de.gulden.framework.jjack
Class JJackBeanInfoAbstract

java.lang.Object
  extended by java.beans.SimpleBeanInfo
      extended by de.gulden.framework.jjack.JJackBeanInfoAbstract
All Implemented Interfaces:
java.beans.BeanInfo

public abstract class JJackBeanInfoAbstract
extends java.beans.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 java.lang.String IMAGE_PREFIX
          Prefix path to internal JJack icon images.
static java.lang.String IMAGE_SUFFIX
          Suffix of internal JJack icon images.
protected  int methodDescriptorsCount
          Number of MethodDescriptors.
protected  int propertyDescriptorsCount
          Number of PropertyDescriptors.
protected  java.lang.Class thisClass
          Bean-class that gets described by this BeanInfo-class.
 
Fields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
 
Constructor Summary
protected JJackBeanInfoAbstract(java.lang.Class cl)
          Constructor.
protected JJackBeanInfoAbstract(java.lang.Class cl, int extraPropertyDescriptorsCount, int extraMethodDescriptorsCount)
          Constructor.
 
Method Summary
protected  void exc(java.lang.Exception e)
          Outputs an Exception's type and message.
 java.beans.BeanDescriptor getBeanDescriptor()
          Gets the beans BeanDescriptor.
 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.
 java.beans.EventSetDescriptor[] getEventSetDescriptors()
          Gets the beans EventSetDescriptors.
 java.awt.Image getIcon(int kind)
          This method returns an image object that can be used to represent the bean in toolboxes, toolbars, etc.
 java.beans.MethodDescriptor[] getMethodDescriptors()
          Gets the beans MethodDescriptors.
 java.beans.PropertyDescriptor[] getPropertyDescriptors()
          Gets the beans PropertyDescriptors.
 
Methods inherited from class java.beans.SimpleBeanInfo
getAdditionalBeanInfo, getDefaultPropertyIndex, loadImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGE_PREFIX

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

See Also:
Constant Field Values

IMAGE_SUFFIX

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

See Also:
Constant Field Values

thisClass

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


propertyDescriptorsCount

protected int propertyDescriptorsCount
Number of PropertyDescriptors.


methodDescriptorsCount

protected int methodDescriptorsCount
Number of MethodDescriptors.

Constructor Detail

JJackBeanInfoAbstract

protected JJackBeanInfoAbstract(java.lang.Class cl)
Constructor.

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

JJackBeanInfoAbstract

protected JJackBeanInfoAbstract(java.lang.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

getBeanDescriptor

public java.beans.BeanDescriptor getBeanDescriptor()
Gets the beans BeanDescriptor.

Specified by:
getBeanDescriptor in interface java.beans.BeanInfo
Overrides:
getBeanDescriptor in class java.beans.SimpleBeanInfo
Returns:
A BeanDescriptor providing overall information about the bean, such as its displayName, its customizer, etc.

getPropertyDescriptors

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

Specified by:
getPropertyDescriptors in interface java.beans.BeanInfo
Overrides:
getPropertyDescriptors in class java.beans.SimpleBeanInfo
Returns:
An array of PropertyDescriptors describing the editable properties supported by this bean.

getEventSetDescriptors

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

Specified by:
getEventSetDescriptors in interface java.beans.BeanInfo
Overrides:
getEventSetDescriptors in class java.beans.SimpleBeanInfo
Returns:
An array of EventSetDescriptors describing the kinds of events fired by this bean.

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.

Specified by:
getDefaultEventIndex in interface java.beans.BeanInfo
Overrides:
getDefaultEventIndex in class java.beans.SimpleBeanInfo
Returns:
Index of default event in the EventSetDescriptor array returned by getEventSetDescriptors.

getMethodDescriptors

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

Specified by:
getMethodDescriptors in interface java.beans.BeanInfo
Overrides:
getMethodDescriptors in class java.beans.SimpleBeanInfo
Returns:
An array of MethodDescriptors describing the externally visible methods supported by this bean.

getIcon

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

Specified by:
getIcon in interface java.beans.BeanInfo
Overrides:
getIcon in class java.beans.SimpleBeanInfo
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.

exc

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

Parameters:
e - the exception