Interface DataViewerGearMenuPlugin

All Superinterfaces:
MMGenericPlugin, MMPlugin, org.scijava.plugin.SciJavaPlugin

public interface DataViewerGearMenuPlugin extends MMPlugin
Adds an item to the gear menu of a viewer that is a DataViewer but not a DisplayWindow, such as the TiledDataViewer.

This is the counterpart of DisplayGearMenuPlugin, which takes a DisplayWindow and so cannot be used by viewers that do not implement that interface. Implementations declare which viewers they support through isApplicableToDataViewer(DataViewer), in the same way InspectorPanelPlugin does, and typically cast the viewer to their own API type inside onPluginSelected(DataViewer).

  • Method Details

    • getSubMenu

      String getSubMenu()
      Indicate which sub-menu of the gear menu this plugin should appear in. If that sub-menu does not exist, it will be created. If an empty string is returned, then the plugin will be inserted directly into the gear menu, instead of into a sub-menu.
      Returns:
      Sub-menu of the gear menu hosting this entry, or empty string.
    • isApplicableToDataViewer

      boolean isApplicableToDataViewer(DataViewer viewer)
      Indicate whether this plugin can operate on the given viewer.

      Only applicable plugins are shown in that viewer's gear menu, so an implementation may safely cast the viewer to its expected type in onPluginSelected(DataViewer).

      Parameters:
      viewer - the viewer whose gear menu is being built
      Returns:
      true if this plugin should appear in that viewer's gear menu
    • onPluginSelected

      void onPluginSelected(DataViewer viewer)
      This method will be called when the plugin is selected from the gear menu.
      Parameters:
      viewer - The viewer whose gear menu was interacted with. This is one for which isApplicableToDataViewer(DataViewer) returned true.