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).

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

Method Summary
 javax.swing.JPopupMenu getPopupMenu(LayerContainer lc, java.awt.event.MouseEvent e, long timePoint, javax.swing.tree.TreePath treePath, TimelineObjectPath[] paths)
          Returns a popup menu for the given layer container.
 

Method Detail

getPopupMenu

javax.swing.JPopupMenu getPopupMenu(LayerContainer lc,
                                    java.awt.event.MouseEvent e,
                                    long timePoint,
                                    javax.swing.tree.TreePath treePath,
                                    TimelineObjectPath[] paths)
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
Returns:
a popup menu that can be used in the context specified by the given parameters
Since:
1.0
See Also:
LayerContainer.setMenuProvider(ILayerContainerMenuProvider)