com.dlsc.flexgantt.swing

## Interface IGridComponent

- All Known Implementing Classes:
    Eventline, LayerContainer, MacEventline, SimpleEventline

      public interface IGridComponent

  A grid component is an object that supports a grid based on a given granularity. This grid is usually used for drag & drop operations, so that dragged objects line up with the (for example) exact beginning and / or end of a day. Grid components can be observed by other objects, which implement the `IGridComponentListener` interface. This way the currently used grid granularity of a component can be visualized.
  Since:
    1.0
  Version:
    $Revision: 1.8 $
  Author:
    Dirk Lemmermann
  See Also:
    `Eventline.setGridGranularity(IGranularity)`, `LayerContainer.setGridGranularity(IGranularity)`, `GridControl`, `GridControlPanel`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addGridComponentListener(IGridComponentListener l)` Adds a listener to the grid component.
    `String` | `getGridComponentName()` Returns the name of the grid component.
    `IGranularity` | `getGridGranularity()` Returns the granularity used by the grid component.
    `IGridPolicy` | `getGridPolicy()` Returns the grid policy used by the grid component.
    `boolean` | `isGridAutomatic()` Determines whether the component is using an automatic grid.
    `boolean` | `isGridControlVisible()` Determines whether the UI component used to control the grid is currently visible or not.
    `void` | `removeGridComponentListener(IGridComponentListener l)` Removes a listener from the grid component.
    `void` | `setGridAutomatic(boolean b)` Specifies whether the component is using an automatic grid.
    `void` | `setGridGranularity(IGranularity granularity)` Specifies a new granularity to be used by the grid component.

- - ### Method Detail

    - #### setGridGranularity

          void setGridGranularity(IGranularity granularity)

      Specifies a new granularity to be used by the grid component. This granularity will be used by the `IGridPolicy` to calculate grid locations. It will not be used if the automatic grid feature is turned on.
      Parameters:
        `granularity` - the granularity to be used for the grid
      Since:
        1.0
      See Also:
        `setGridAutomatic(boolean)`

    - #### getGridGranularity

          IGranularity getGridGranularity()

      Returns the granularity used by the grid component.
      Returns:
        the grid granularity
      Since:
        1.0

    - #### setGridAutomatic

          void setGridAutomatic(boolean b)

      Specifies whether the component is using an automatic grid. A grid is automatic if it is not based on the grid granularity but on some other granularity of various origin. The dateline, for example, displays a major and a minor time (granularity). The minor granularity can be used for calculating grid locations.
      Parameters:
        `b` - if TRUE the grid gets calculated automatically and not based on the given grid granularity
      Since:
        1.0

    - #### isGridAutomatic

          boolean isGridAutomatic()

      Determines whether the component is using an automatic grid. A grid is automatic if it is not based on the grid granularity but on some other granularity of various origin. The dateline, for example, displays a major and a minor time (granularity). The minor granularity can be used for calculating grid locations.
      Returns:
        TRUE if the grid gets calculated automatically and not based on the given grid granularity
      Since:
        1.0

    - #### isGridControlVisible

          boolean isGridControlVisible()

      Determines whether the UI component used to control the grid is currently visible or not.
      Returns:
        TRUE if the grid control is visible
      Since:
        1.0

    - #### getGridPolicy

          IGridPolicy getGridPolicy()

      Returns the grid policy used by the grid component. Each component can have its own grid policy, which is used to determine which granularities are supported by the component.
      Returns:
        the component's grid policy
      Since:
        1.0

    - #### getGridComponentName

          String getGridComponentName()

      Returns the name of the grid component. This is useful for displaying a grid control so that the controls used for the different grid components can be distinguished from each other.
      Returns:
        the name of the grid component
      Since:
        1.0

    - #### addGridComponentListener

          void addGridComponentListener(IGridComponentListener l)

      Adds a listener to the grid component. The listener will be informed whenever the grid granularity used by the component gets changed.
      Parameters:
        `l` - the grid component listener
      Since:
        1.0

    - #### removeGridComponentListener

          void removeGridComponentListener(IGridComponentListener l)

      Removes a listener from the grid component.
      Parameters:
        `l` - the grid component listener that gets removed
      Since:
        1.0

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