com.dlsc.flexgantt.swing.layer

## Interface ILayerContainerMenuProvider

- All Known Implementing Classes:
    DefaultLayerContainerMenuProvider

      public interface ILayerContainerMenuProvider

  A menu provider is a convenient way of adding a context sensitive popup menu to the `LayerContainer`. When using this provider instead of using `JComponent.setComponentPopupMenu(JPopupMenu)` the information that is usually required by the popup menu gets already delivered to the provider. This information contains the location of the mouse event that triggered the popup, the tree path to the row where the popup got requested and the timline object paths (one path for each timeline object that is placed at the location of the popup request / overlapping timeline objects).

  If a spreadsheet is visible then that information will be passed.

  Since:
    1.0
  Author:
    Dirk Lemmermann
  See Also:
    `LayerContainer.setMenuProvider(ILayerContainerMenuProvider)`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `JPopupMenu` | `getPopupMenu(LayerContainer lc, MouseEvent e, ITimeSpan timeSpan, TreePath treePath, ISpreadsheet spreadsheet)` Returns a popup menu for the given layer container when the given spreadsheet is currently active.
    `JPopupMenu` | `getPopupMenu(LayerContainer lc, MouseEvent e, long timePoint, TreePath treePath, TimelineObjectPath[] paths, IRelationship[] relationships)` Returns a popup menu for the given layer container.

- - ### Method Detail

    - #### getPopupMenu

          JPopupMenu getPopupMenu(LayerContainer lc,
                                  MouseEvent e,
                                  long timePoint,
                                  TreePath treePath,
                                  TimelineObjectPath[] paths,
                                  IRelationship[] relationships)

      Returns a popup menu for the given layer container.
      Parameters:
        `lc` - the layer container that requests the popup menu
        `e` - the mouse event that triggered the popup menu request
        `timePoint` - the time point at the mouse location
        `treePath` - the tree path that points to the row where the request occured
        `paths` - one timeline object path for each timeline object located at the location of the popup request event
        `relationships` - contains all relationships found at the location of the popup request
      Returns:
        a popup menu that can be used in the context specified by the given parameters
      Since:
        1.0
      See Also:
        `LayerContainer.setMenuProvider(ILayerContainerMenuProvider)`

    - #### getPopupMenu

          JPopupMenu getPopupMenu(LayerContainer lc,
                                  MouseEvent e,
                                  ITimeSpan timeSpan,
                                  TreePath treePath,
                                  ISpreadsheet spreadsheet)

      Returns a popup menu for the given layer container when the given spreadsheet is currently active.
      Parameters:
        `lc` - the layer container that requests the popup menu
        `e` - the mouse event that triggered the popup menu request
        `timeSpan` - the time span of the spreadsheet cell at the mouse location
        `treePath` - the tree path that points to the row where the request occured
        `spreadsheet` - the currently active spreadsheet
      Returns:
        a popup menu that can be used in the context specified by the given parameters
      Since:
        2.1
      See Also:
        `LayerContainer.setMenuProvider(ILayerContainerMenuProvider)`

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