ElegantJCharts Java API Specification v2.0

com.elegantj.beaninfo
Class SimpleBeanInfo

java.lang.Object
  |
  +--java.beans.SimpleBeanInfo
        |
        +--com.elegantj.beaninfo.SimpleBeanInfo
All Implemented Interfaces:
java.beans.BeanInfo
Direct Known Subclasses:
ComponentBeanInfo

public abstract class SimpleBeanInfo
extends java.beans.SimpleBeanInfo

Simple BeanInfo Abstract class provides the utility methods to set/get the properties. It's subclass should override the methods : getPropertyDescriptors(), getBeanDescriptor().


Field Summary
protected  java.beans.BeanDescriptor beanDescriptor
          Specifies the Bean Descriptor
protected  java.awt.Image beanIcon
          Specifies the Bean Icon
 
Fields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
 
Constructor Summary
SimpleBeanInfo()
           
 
Method Summary
 java.beans.PropertyDescriptor[] add(java.beans.PropertyDescriptor[] array1, java.beans.PropertyDescriptor[] array2)
          Adds the property descriptors array.
static java.beans.BeanDescriptor createBeanDescriptor(java.lang.Class beanClass)
          Create a BeanDescriptor for a bean that doesn't have a customizer.
static java.beans.BeanDescriptor createBeanDescriptor(java.lang.Class beanClass, java.lang.Class customizerClass)
          Create a BeanDescriptor for a bean that has a customizer.
static java.beans.BeanDescriptor createBeanDescriptor(java.lang.Class beanClass, java.lang.Class customizerClass, java.lang.String displayName)
          Create a BeanDescriptor for a bean that has a customizer.
static java.awt.Image createImage(java.lang.Class beanClass, java.lang.String imageName)
          Creates the Resource Image for specified Class
 java.beans.BeanDescriptor getBeanDescriptor()
          Denies knowledge about the class and customizer of the bean
 java.beans.EventSetDescriptor[] getEventSetDescriptors()
          Deny knowledge of event sets.
 java.awt.Image getIcon(int iconKind)
          This method returns an image object that can be used to represent the bean in toolboxes, toolbars, etc.
protected  java.beans.IndexedPropertyDescriptor getIndexedPropertyDescriptor(java.lang.String strProperty)
          Gets the indexed property descriptor with specified property name
 java.beans.MethodDescriptor[] getMethodDescriptors()
          Deny knowledge of methods.
 java.beans.PropertyDescriptor getPropertyDescriptor(java.beans.PropertyDescriptor[] array, java.lang.String propName)
          Gets the property descriptor from the array by specified property name.
 java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String strProperty)
          Gets the property descriptor with specified property name
 java.beans.PropertyDescriptor[] getPropertyDescriptors()
          Denies knowledge of properties.
protected  java.beans.PropertyDescriptor getReadOnlyPropertyDescriptor(java.lang.String strProperty)
          Gets the read only property descriptor with specified property name
protected  java.beans.PropertyDescriptor getWriteOnlyPropertyDescriptor(java.lang.String strProperty)
          Gets the write only property descriptor with specified property name
protected abstract  void init()
          Initializes the Bean Info
 java.beans.PropertyDescriptor[] removePropertyDescriptor(java.beans.PropertyDescriptor[] array, java.lang.String propName)
          Removes the property descriptor from the array by specified property name.
 java.beans.PropertyDescriptor[] removePropertyDescriptors(java.beans.PropertyDescriptor[] array, java.lang.String[] propNames)
          Removes the property descriptors from the array by specified property names.
 
Methods inherited from class java.beans.SimpleBeanInfo
getAdditionalBeanInfo, getDefaultEventIndex, getDefaultPropertyIndex, loadImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

beanDescriptor

protected java.beans.BeanDescriptor beanDescriptor
Specifies the Bean Descriptor


beanIcon

protected java.awt.Image beanIcon
Specifies the Bean Icon

Constructor Detail

SimpleBeanInfo

public SimpleBeanInfo()
Method Detail

add

public java.beans.PropertyDescriptor[] add(java.beans.PropertyDescriptor[] array1,
                                           java.beans.PropertyDescriptor[] array2)
Adds the property descriptors array.

Parameters:
array1 - the array of property descriptor
array2 - the array of property descriptor
Returns:
the combined array of property descriptor

getPropertyDescriptor

public java.beans.PropertyDescriptor getPropertyDescriptor(java.beans.PropertyDescriptor[] array,
                                                           java.lang.String propName)
Gets the property descriptor from the array by specified property name.

Parameters:
array - the array of property descriptor
propName - the name of the property
Returns:
the property descriptor which name is propName if found in the array, otherwise null

removePropertyDescriptor

public java.beans.PropertyDescriptor[] removePropertyDescriptor(java.beans.PropertyDescriptor[] array,
                                                                java.lang.String propName)
Removes the property descriptor from the array by specified property name.

Parameters:
array - the array of property descriptor
propName - the name of the property
Returns:
the property descriptor array which name is propName if found in the array, otherwise null

removePropertyDescriptors

public java.beans.PropertyDescriptor[] removePropertyDescriptors(java.beans.PropertyDescriptor[] array,
                                                                 java.lang.String[] propNames)
Removes the property descriptors from the array by specified property names.

Parameters:
array - the array of property descriptor
propNames - the names of the properties
Returns:
the property descriptor array which names in propNames if found in the array, otherwise null

getPropertyDescriptor

public final java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String strProperty)
Gets the property descriptor with specified property name

Parameters:
strProperty - the name of the property
Returns:
the property descriptor with the specified name

getIndexedPropertyDescriptor

protected final java.beans.IndexedPropertyDescriptor getIndexedPropertyDescriptor(java.lang.String strProperty)
Gets the indexed property descriptor with specified property name

Parameters:
strProperty - the name of the property
Returns:
the indexed property descriptor with the specified name

getReadOnlyPropertyDescriptor

protected final java.beans.PropertyDescriptor getReadOnlyPropertyDescriptor(java.lang.String strProperty)
Gets the read only property descriptor with specified property name

Parameters:
strProperty - the name of the property
Returns:
the read only property descriptor with the specified name

getWriteOnlyPropertyDescriptor

protected final java.beans.PropertyDescriptor getWriteOnlyPropertyDescriptor(java.lang.String strProperty)
Gets the write only property descriptor with specified property name

Parameters:
strProperty - the name of the property
Returns:
the write only property descriptor with the specified name

getPropertyDescriptors

public java.beans.PropertyDescriptor[] getPropertyDescriptors()
Denies knowledge of properties.

Specified by:
getPropertyDescriptors in interface java.beans.BeanInfo
Overrides:
getPropertyDescriptors in class java.beans.SimpleBeanInfo
Returns:
An array of PropertyDescriptor describing the editable properties supported by this bean. May return null if the information should be obtained by automatic analysis. If a property is indexed, then its entry in the result array will belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor. A client of getPropertyDescriptors can use "instanceof" to check if a given PropertyDescriptor is an IndexedPropertyDescriptor. A subclass of this class should override this method

getEventSetDescriptors

public java.beans.EventSetDescriptor[] getEventSetDescriptors()
Deny knowledge of event sets.

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. May return null if the information should be obtained by automatic analysis.

getMethodDescriptors

public java.beans.MethodDescriptor[] getMethodDescriptors()
Deny knowledge of methods.

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. May return null if the information should be obtained by automatic analysis.

getBeanDescriptor

public java.beans.BeanDescriptor getBeanDescriptor()
Denies knowledge about the class and customizer of the bean

Specified by:
getBeanDescriptor in interface java.beans.BeanInfo
Overrides:
getBeanDescriptor in class java.beans.SimpleBeanInfo
Returns:
BeanDescriptor providing overall information about the bean, such as its displayName, its customizer, etc. May return null if the information should be obtained by automatic analysis

createBeanDescriptor

public static java.beans.BeanDescriptor createBeanDescriptor(java.lang.Class beanClass)
Create a BeanDescriptor for a bean that doesn't have a customizer.

Parameters:
beanClass - The Class object of the Java class that implements the bean.
Returns:
a BeanDescriptor object

createBeanDescriptor

public static java.beans.BeanDescriptor createBeanDescriptor(java.lang.Class beanClass,
                                                             java.lang.Class customizerClass)
Create a BeanDescriptor for a bean that has a customizer.

Parameters:
beanClass - The Class object of the Java class that implements the bean.
customizerClass - The Class object of the Java class that implements the bean's Customizer.
Returns:
a BeanDescriptor object

createBeanDescriptor

public static java.beans.BeanDescriptor createBeanDescriptor(java.lang.Class beanClass,
                                                             java.lang.Class customizerClass,
                                                             java.lang.String displayName)
Create a BeanDescriptor for a bean that has a customizer.

Parameters:
beanClass - The Class object of the Java class that implements the bean.
customizerClass - The Class object of the Java class that implements the bean's Customizer.
Returns:
a BeanDescriptor object

getIcon

public java.awt.Image getIcon(int iconKind)
This method returns an image object that can be used to represent the bean in toolboxes, toolbars, etc. Icon images will be GIFs, override this method to return other formats. We recommend that icons have a "transparent" background so they can be rendered onto an existing background. There are four possible flavors of icons (16x16 color, 32x32 color, 16x16 mono, 32x32 mono). If a bean choses to only support a single icon we recommend supporting 16x16 color. Each icon has the name as "Bean Name"+"Icon" (as Text) +"Icon Type", as an example Test bean has the 16x16 color icon called as "TestIconColor16.gif". If only one icon is specified it has the name as "Bean Name" + "Icon" (as Text) as an example "TestIcon.gif".

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

createImage

public static java.awt.Image createImage(java.lang.Class beanClass,
                                         java.lang.String imageName)
Creates the Resource Image for specified Class


init

protected abstract void init()
Initializes the Bean Info


ElegantJCharts Java API Specification v2.0

For any feedback, suggestion, or query, please revert back to support@elegantcharts.com

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjcharts.com
All Rights Reserved.