Class CompositeImpl
- java.lang.Object
-
- net.sf.jguiraffe.gui.builder.components.CompositeImpl
-
- All Implemented Interfaces:
AccessibleComposite
,Composite
public class CompositeImpl extends Object implements AccessibleComposite
A straight-forward implementation of the
Composite
interface.This implementation uses member fields to store and expose the data required by the
Composite
interface. It can be used by other implementations as delegate. This implementation is not thread-safe.- Since:
- 1.3
- Version:
- $Id$
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description CompositeImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addComponent(Object comp, Object constraints)
Adds the specified component to this container using the given constraints.Collection<Object[]>
getComponents()
Returns an unmodifiable collection with the components and constraints that have been added to this object.Object
getContainer()
Returns the concrete container component that is wrapped by this object.Object
getLayout()
Returns the layout object passed to this instance.void
setContainer(Object container)
Sets the container represented by this object.void
setLayout(Object layout)
Sets the layout object for this container.
-
-
-
Method Detail
-
addComponent
public void addComponent(Object comp, Object constraints)
Adds the specified component to this container using the given constraints. This implementation adds the specified component and constraints object to an internal collection. This information can be queried using thegetComponents()
method.- Specified by:
addComponent
in interfaceComposite
- Parameters:
comp
- the component to addconstraints
- the constraints (may be null )
-
getLayout
public Object getLayout()
Returns the layout object passed to this instance. This implementation returns the object which has been set using thesetLayout(Object)
method.- Specified by:
getLayout
in interfaceAccessibleComposite
- Returns:
- the layout object
-
setLayout
public void setLayout(Object layout)
Sets the layout object for this container. This implementation stores the passed in layout object in an internal field.
-
getContainer
public Object getContainer()
Returns the concrete container component that is wrapped by this object. The returned container will be specific for the used GUI library. This implementation returns the container object set by thesetContainer(Object)
method.- Specified by:
getContainer
in interfaceComposite
- Returns:
- the GUI library specific container
-
setContainer
public void setContainer(Object container)
Sets the container represented by this object. The object passed to this method is directly returned bygetContainer()
.- Parameters:
container
- the container
-
getComponents
public Collection<Object[]> getComponents()
Returns an unmodifiable collection with the components and constraints that have been added to this object. Each element of the collection is an array of size 0. Index 0 contains the component, index 1 contains the constraints object. This implementation returns a collection with the data set by all previousaddComponent(Object, Object)
calls.- Specified by:
getComponents
in interfaceAccessibleComposite
- Returns:
- a collection with the components and constraints added to this object
-
-