com.dlsc.flexgantt.swing.layer

## Class DefaultLayerFactory

- java.lang.Object
- - com.dlsc.flexgantt.swing.layer.DefaultLayerFactory

- All Implemented Interfaces:
    ILayerFactory
  Direct Known Subclasses:
    MacLayerFactory

      public class DefaultLayerFactory
      extends Object
      implements ILayerFactory

  A layer factory implementation. For more information read the comments inside the implemented `ILayerFactory` interface. The factory implements the singleton pattern.
  Since:
    1.0
  Version:
    $Revision: 1.10 $
  Author:
    Dirk Lemmermann
  See Also:
    `AbstractLayer`, `AbstractSystemLayer`

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `DefaultLayerFactory()` Constructs a new factory.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AbstractCustomLayer` | `createCustomLayer(LayerContainer lc, ILayer layer)` The default layer factory implementation does not know about any custom layers and will always return a placeholder instance if a layer returned by the Gantt chart model indicates that it is a custom layer.
    `<T extends AbstractSystemLayer> T` | `createSystemLayer(LayerContainer lc, Class<T> layerType)` Creates a new system layer.
    `TimelineObjectLayer` | `createTimelineLayer(LayerContainer lc, ILayer layer)` Creates a new timeline object layer to be used for rendering timeline objects.
    `static ILayerFactory` | `getInstance()` Returns a factory.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultLayerFactory

          protected DefaultLayerFactory()

      Constructs a new factory. The constructor is protected because the class implements the singleton pattern.
      Since:
        1.0

  - ### Method Detail

    - #### getInstance

          public static ILayerFactory getInstance()

      Returns a factory.
      Returns:
        a singleton layer factory
      Since:
        1.0

    - #### createSystemLayer

          public <T extends AbstractSystemLayer> T createSystemLayer(LayerContainer lc,
                                                                     Class<T> layerType)

      Description copied from interface: `ILayerFactory`
      Creates a new system layer. The creation of all system layer types must be supported (all subclasses of `AbstractSystemLayer`).
      Specified by:
        `createSystemLayer` in interface `ILayerFactory`
      Type Parameters:
        `T` - the type of the system layer
      Parameters:
        `lc` - the layer container, which will manage the layer
        `layerType` - the system layer class
      Returns:
        a system layer user interface component

    - #### createTimelineLayer

          public TimelineObjectLayer createTimelineLayer(LayerContainer lc,
                                                         ILayer layer)

      Description copied from interface: `ILayerFactory`
      Creates a new timeline object layer to be used for rendering timeline objects.
      Specified by:
        `createTimelineLayer` in interface `ILayerFactory`
      Parameters:
        `lc` - the layer container, which will manage the layer
        `layer` - the layer model information
      Returns:
        either a timeline layer or a custom layer
      See Also:
        `ILayerFactory.createCustomLayer(LayerContainer, ILayer)`

    - #### createCustomLayer

          public AbstractCustomLayer createCustomLayer(LayerContainer lc,
                                                       ILayer layer)

      The default layer factory implementation does not know about any custom layers and will always return a placeholder instance if a layer returned by the Gantt chart model indicates that it is a custom layer.
      Specified by:
        `createCustomLayer` in interface `ILayerFactory`
      Parameters:
        `lc` - the layer container, which will manage the layer
        `layer` - the layer model information
      Returns:
        a custom layer
      Since:
        1.0
      See Also:
        `ILayer.isCustomLayer()`

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.