org.mlc.swing.layout
Class DefaultComponentBuilder

java.lang.Object
  extended by org.mlc.swing.layout.DefaultComponentBuilder
All Implemented Interfaces:
ComponentBuilder

public class DefaultComponentBuilder
extends java.lang.Object
implements ComponentBuilder

This is meant to be subclassed when you want to create a ComponentBuilder that has simplistic behavior.

Since:
Ptolemy II 8.0
Version:
$Id: DefaultComponentBuilder.java 57044 2010-01-27 22:41:05Z cxh $
Author:
Michael Connor mlconnor@yahoo.com

Field Summary
(package private)  java.beans.BeanInfo beanInfo
           
(package private)  java.lang.Class clazz
           
(package private)  java.util.List<java.beans.PropertyDescriptor> editableProperties
           
(package private)  java.util.Map<java.lang.String,java.beans.PropertyDescriptor> nameToDescriptor
           
(package private)  java.util.List<BeanProperty> properties
           
 
Constructor Summary
DefaultComponentBuilder(java.lang.Class clazz)
          Creates a new instance of DefaultComponentFactory
DefaultComponentBuilder(java.lang.Class clazz, java.lang.String[] properties)
          Creates a new instance of DefaultComponentFactory
 
Method Summary
 ComponentDef getComponentDef(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> beanProperties)
           
 java.lang.String getDeclaration(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> beanProperties)
          Returns the appropriate declaration suitable for this component
 java.awt.Component getInstance(java.util.Map<java.lang.String,java.lang.Object> objectProperties)
          Returns an instance of this object given the specified properties
 java.util.List<BeanProperty> getProperties()
          Returns a list of properties that are appropriate for construction
 boolean isComponentALayoutContainer()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

clazz

java.lang.Class clazz

beanInfo

java.beans.BeanInfo beanInfo

editableProperties

java.util.List<java.beans.PropertyDescriptor> editableProperties

nameToDescriptor

java.util.Map<java.lang.String,java.beans.PropertyDescriptor> nameToDescriptor

properties

java.util.List<BeanProperty> properties
Constructor Detail

DefaultComponentBuilder

public DefaultComponentBuilder(java.lang.Class clazz)
                        throws java.beans.IntrospectionException
Creates a new instance of DefaultComponentFactory

Throws:
java.beans.IntrospectionException

DefaultComponentBuilder

public DefaultComponentBuilder(java.lang.Class clazz,
                               java.lang.String[] properties)
                        throws java.beans.IntrospectionException
Creates a new instance of DefaultComponentFactory

Throws:
java.beans.IntrospectionException
Method Detail

getDeclaration

public java.lang.String getDeclaration(java.lang.String name,
                                       java.util.Map<java.lang.String,java.lang.Object> beanProperties)
Description copied from interface: ComponentBuilder
Returns the appropriate declaration suitable for this component

Specified by:
getDeclaration in interface ComponentBuilder

getComponentDef

public ComponentDef getComponentDef(java.lang.String name,
                                    java.util.Map<java.lang.String,java.lang.Object> beanProperties)
Specified by:
getComponentDef in interface ComponentBuilder

getInstance

public java.awt.Component getInstance(java.util.Map<java.lang.String,java.lang.Object> objectProperties)
                               throws java.lang.InstantiationException,
                                      java.lang.IllegalAccessException,
                                      java.lang.reflect.InvocationTargetException
Description copied from interface: ComponentBuilder
Returns an instance of this object given the specified properties

Specified by:
getInstance in interface ComponentBuilder
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

isComponentALayoutContainer

public boolean isComponentALayoutContainer()
Specified by:
isComponentALayoutContainer in interface ComponentBuilder

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getProperties

public java.util.List<BeanProperty> getProperties()
Description copied from interface: ComponentBuilder
Returns a list of properties that are appropriate for construction

Specified by:
getProperties in interface ComponentBuilder