Package: groovy.swing.factory

## [Groovy] Class LayoutFactory

- groovy.swing.factory.LayoutFactory

-     class LayoutFactory
      extends BeanFactory

  Base factory for creating layout managers and exposing layout constants.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static String` | `DEFAULT_DELEGATE_PROPERTY_CONSTRAINT` | Default child attribute name for layout constraints.
    `static String` | `DELEGATE_PROPERTY_CONSTRAINT` | Builder context key for the child constraints attribute name.

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class BeanFactory` | `leaf`

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `Object` | `contextProps` Cached layout constants copied into the builder context.

  - Inherited properties
    Properties inherited from class | Properties
    --- | ---
    `class BeanFactory` | `beanClass`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `LayoutFactory(Class klass)` Creates a new base factory for creating layout managers and exposing layout constants
    `LayoutFactory(Class klass, boolean leaf)` Creates a new base factory for creating layout managers and exposing layout constants

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `addLayoutProperties(Object context, Class layoutClass)` Copies layout constants into the builder context.
    `` | `void` | `addLayoutProperties(Object context)` Copies layout constants into the builder context.
    `` | `static Object` | `constraintsAttributeDelegate(Object builder, Object node, Object attributes)` Captures a constraints attribute for later child insertion.
    `` | `static Container` | `getLayoutTarget(Container parent)` Returns the container whose layout should be updated.
    `` | `Object` | `newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes)` Creates the node handled by this factory.
    `` | `void` | `setParent(FactoryBuilderSupport builder, Object parent, Object child)` Attaches the current node to its parent when parent-specific handling is required.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class BeanFactory` | `isLeaf, newInstance`
    `class AbstractFactory` | `isHandlesNodeChildren, isLeaf, onFactoryRegistration, onHandleNodeAttributes, onNodeChildren, onNodeCompleted, setChild, setParent`

- - ### Field Detail

    - #### public static final String DEFAULT_DELEGATE_PROPERTY_CONSTRAINT

      Default child attribute name for layout constraints.

    - #### public static final String DELEGATE_PROPERTY_CONSTRAINT

      Builder context key for the child constraints attribute name.

  - ### Property Detail

    - #### Object contextProps

      Cached layout constants copied into the builder context.

  - ### Constructor Detail

    - #### LayoutFactory(Class klass)

      Creates a new base factory for creating layout managers and exposing layout constants

      Parameters:
        `klass` - the widget class to instantiate

    - #### LayoutFactory(Class klass, boolean leaf)

      Creates a new base factory for creating layout managers and exposing layout constants

      Parameters:
        `klass` - the widget class to instantiate
        `leaf` - whether created nodes are leaf nodes

  - ### Method Detail

    - #### void addLayoutProperties(Object context, Class layoutClass)

      Copies layout constants into the builder context.

      Parameters:
        `context` - the builder context
        `layoutClass` - the layout class whose constants should be copied

    - #### void addLayoutProperties(Object context)

      Copies layout constants into the builder context.

      Parameters:
        `context` - the builder context

    - #### static Object constraintsAttributeDelegate(Object builder, Object node, Object attributes)

      Captures a constraints attribute for later child insertion.

      Parameters:
        `builder` - the factory builder
        `node` - the current node
        `attributes` - the node attributes

    - #### static Container getLayoutTarget(Container parent)

      Returns the container whose layout should be updated.

      Parameters:
        `parent` - the parent node
      Returns:
        the container whose layout should be updated

    - #### Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes)

      Creates the node handled by this factory.

      Parameters:
        `builder` - the factory builder
        `name` - the node name
        `value` - the node value
        `attributes` - the node attributes
      Returns:
        the created or reused node

    - #### void setParent(FactoryBuilderSupport builder, Object parent, Object child)

      Attaches the current node to its parent when parent-specific handling is required.

      Parameters:
        `builder` - the factory builder
        `parent` - the parent node
        `child` - the child node