com.jgoodies.forms.builder
Class AbstractBuilder

java.lang.Object
  extended by com.jgoodies.forms.builder.AbstractBuilder
Direct Known Subclasses:
AbstractButtonPanelBuilder, AbstractFormBuilder

public abstract class AbstractBuilder
extends Object

An abstract class that minimizes the effort required to implemen non-visual builders that use the FormLayout.

Version:
$Revision: 1.3 $
Author:
Karsten Lentzsch
See Also:
ButtonBarBuilder, ButtonStackBuilder, PanelBuilder, I15dPanelBuilder, DefaultFormBuilder

Field Summary
protected  CellConstraints currentCellConstraints
          Holds an instance of CellConstraints that will be used t specify the location, extent and alignments of the component to b added next.
 
Constructor Summary
protected AbstractBuilder(FormLayout layout, Container container)
          Constructs an AbstractBuilde for the given FormLayout and layout container.
 
Method Summary
protected  ComponentFactory createComponentFactory()
          Invoked when the per-instance component factory is lazily initialized.
 int getColumnCount()
          Returns the number of columns in the form.
 ComponentFactory getComponentFactory()
          Returns this builder's component factory.
static ComponentFactory getComponentFactoryDefault()
          Returns the factory that is used as default for new builder' as they are created.
 Container getContainer()
          Returns the container used to build the form.
 FormLayout getLayout()
          Returns the FormLayout instance used to build this form.
 int getRowCount()
          Returns the number of rows in the form.
 void setComponentFactory(ComponentFactory newFactory)
          Sets a new component factory for this builder overriding the default as provided b getComponentFactoryDefault().
static void setComponentFactoryDefault(ComponentFactory factory)
          Sets the global default that is used to initialize the per-instanc component factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentCellConstraints

protected final CellConstraints currentCellConstraints
Holds an instance of CellConstraints that will be used t specify the location, extent and alignments of the component to b added next.

Constructor Detail

AbstractBuilder

protected AbstractBuilder(FormLayout layout,
                          Container container)
Constructs an AbstractBuilde for the given FormLayout and layout container.

Parameters:
layout - the FormLayout to use
container - the layout container
Throws:
NullPointerException - if layout or container is null
Method Detail

getComponentFactoryDefault

public static ComponentFactory getComponentFactoryDefault()
Returns the factory that is used as default for new builder' as they are created. This default itself is lazily initialize as the DefaultComponentFactory.

Returns:
the factory that is used as default for new builder instances

setComponentFactoryDefault

public static void setComponentFactoryDefault(ComponentFactory factory)
Sets the global default that is used to initialize the per-instanc component factory.

Parameters:
factory - the factory to be used for all new builder instance that do not override the default

getContainer

public final Container getContainer()
Returns the container used to build the form.

Returns:
the layout container

getLayout

public final FormLayout getLayout()
Returns the FormLayout instance used to build this form.

Returns:
the FormLayout

getColumnCount

public final int getColumnCount()
Returns the number of columns in the form.

Returns:
the number of columns

getRowCount

public final int getRowCount()
Returns the number of rows in the form.

Returns:
the number of rows

getComponentFactory

public final ComponentFactory getComponentFactory()
Returns this builder's component factory. If no factor has been set before, it is lazily initialized from the globa default as returned by getComponentFactoryDefault().

Returns:
the component factory
See Also:
setComponentFactory(ComponentFactory)

setComponentFactory

public final void setComponentFactory(ComponentFactory newFactory)
Sets a new component factory for this builder overriding the default as provided b getComponentFactoryDefault().

Parameters:
newFactory - the component factory to be used for this builder
See Also:
getComponentFactory()

createComponentFactory

protected ComponentFactory createComponentFactory()
Invoked when the per-instance component factory is lazily initialized This implementation returns the global default factory.

setComponentFactoryDefault(ComponentFactory).

Returns:
the factory used during the lazy initialization o the per-instance component factory


Copyright © 2002-2013 JGoodies Software GmbH. All Rights Reserved.