|
JavaGantt 2011.1 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.beesoft.gaia.util.ObjectBuilder<T>
eu.beesoft.gaia.swing.builder.SwingBuilder<T>
eu.beesoft.gaia.swing.builder.ComponentBuilder<T>
T
- class of object created by this builderpublic abstract class ComponentBuilder<T extends java.awt.Component>
Abstract superclass of all Swing component builders. Supports these properties:
java.awt.Color
(for example: BLACK), or r, g, b (for example:
128,255,15), or one RGB number in hexa format (for example: 504B1C)initBorder(String)
methodjava.awtFont.decode()
format
Constructor Summary | |
---|---|
ComponentBuilder()
|
Method Summary | |
---|---|
protected void |
addChild(ObjectBuilder<?> builder)
Adds the given builder to the children of this builder. |
protected void |
addSwingChild(ObjectBuilder<?> builder)
This implementation processes just instances of LayoutConstraintsBuilder to remember layout constraints for
component of this builder. |
protected java.lang.Object |
convertValue(java.lang.Object value,
java.lang.Class<?> targetClass,
java.lang.String fullBinding)
Converts given value to the class of given type. |
protected java.lang.Object |
createBoundData(java.lang.String binding)
Creates a new data object for given binding path. |
protected java.lang.Object |
findBoundData(java.lang.String binding,
SwingBuilder<?> caller)
Finds a data object for given binding path. |
java.lang.Object |
getLayoutConstraints()
Returns layout constraints for the component built by this builder. |
protected void |
initBackground(java.lang.String value)
|
protected void |
initBorder(java.lang.String value)
Initializes the border property from given
value . |
protected void |
initEnabled(java.lang.String value)
|
protected void |
initFont(java.lang.String value)
|
protected void |
initForeground(java.lang.String value)
|
protected void |
initId(java.lang.String value)
Initializes property ID for this value. |
protected void |
initLayoutConstraint(java.lang.String value)
Initializes layout constraint for the component of this builder. |
protected void |
initName(java.lang.String value)
|
protected void |
initOpaque(java.lang.String value)
|
protected void |
initSize(java.lang.String value)
|
protected void |
initToolTipText(java.lang.String value)
Initializes property toolTipText . |
protected void |
initVisible(java.lang.String value)
|
protected java.awt.Color |
parseColor(java.lang.String value)
Helper method to parse given String to the Color instance. |
protected javax.swing.Icon |
parseIcon(java.lang.String value)
Helper method to parse given value to icon. |
void |
setLayoutConstraints(java.lang.Object object)
Sets layout constraints for the component built by this builder. |
Methods inherited from class eu.beesoft.gaia.swing.builder.SwingBuilder |
---|
getBindableChildren, getBinding, getBoundData, getBoundValueFromComponent, getPropertyFromResourceBundle, getValueFromBoundObject, initBinding, isBindable, parseDimension, setBoundData, setBoundValueToComponent, setValueToBoundObject |
Methods inherited from class eu.beesoft.gaia.util.ObjectBuilder |
---|
createObject, createObject, getFactory, getChildren, getId, getObject, getParent, getProperties, getProperty, initClass, initObjectProperties, initObjectProperty, parseBoolean, parseClass, parseConstant, parseConstructor, parseDouble, parseInstance, parseInstance, parseInt, parseInt |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ComponentBuilder()
Method Detail |
---|
protected void addChild(ObjectBuilder<?> builder)
builder
to the children of this builder. Then
invokes addSwingChild(ObjectBuilder)
method.
addChild
in class ObjectBuilder<T extends java.awt.Component>
builder
- - the builder to addprotected void addSwingChild(ObjectBuilder<?> builder)
LayoutConstraintsBuilder
to remember layout constraints for
component of this builder.
builder
- - the builder which object should be added to swing componentprotected void initId(java.lang.String value)
ObjectBuilder
initId
in class ObjectBuilder<T extends java.awt.Component>
value
- - id to setprotected void initName(java.lang.String value)
protected void initLayoutConstraint(java.lang.String value)
value
is an integer or the constant name from the parent's
layout manager class.
value
- - value from according attribute in XML to initialize the
layout constraintspublic void setLayoutConstraints(java.lang.Object object)
object
- - the layout constraints to setpublic java.lang.Object getLayoutConstraints()
protected void initForeground(java.lang.String value)
protected void initBackground(java.lang.String value)
protected java.awt.Color parseColor(java.lang.String value)
value
can be:
value
- - string to parse
protected void initSize(java.lang.String value)
protected void initOpaque(java.lang.String value)
protected void initFont(java.lang.String value)
protected void initBorder(java.lang.String value)
border
property from given
value
. This method currently supports just limited set of
borders from javax.swing.border
package. You can use these:
null
" text as valueEmptyBorder (2, 3, 2, 5)
TitledBorder (This is my title)
)where:
constant
- is one of the constant names in given border
classint
- is some (little) integerboolean
- is value true
or
false
icon
- is an icon resource (file) namecolor
- is a color value as described in this class
comment
Please, note, the color value you can write in 3 different ways, and this
can change the real number of arguments in your XML attribute. For
example, the LineBorder(color, int)
you can write:
Each of these notations is equal and this method will parse it.
value
- - the value to initialize border propertyprotected void initToolTipText(java.lang.String value)
toolTipText
.
value
- - value from according attribute in XML to initialize this
propertyprotected javax.swing.Icon parseIcon(java.lang.String value)
value
- - icon resource name
protected void initEnabled(java.lang.String value)
protected void initVisible(java.lang.String value)
protected java.lang.Object convertValue(java.lang.Object value, java.lang.Class<?> targetClass, java.lang.String fullBinding)
convertValue
in class SwingBuilder<T extends java.awt.Component>
value
- - value to converttargetClass
- - the type to value has be convertedfullBinding
- - binding path from the root data object
protected java.lang.Object createBoundData(java.lang.String binding)
binding
path. Overriden
to forward the creation request to the parent builder, if exists. If not,
it returns the new empty instance of ValueObject
.
createBoundData
in class SwingBuilder<T extends java.awt.Component>
binding
- - binding for which should be created new object
protected java.lang.Object findBoundData(java.lang.String binding, SwingBuilder<?> caller)
binding
path. Overriden to
forward the find request to the parent builder, if exists.
findBoundData
in class SwingBuilder<T extends java.awt.Component>
binding
- - binding for which should be created new objectcaller
- - the builder which invokes this method
|
JavaGantt 2011.1 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |