Interface GraphContextMenuItem

All Superinterfaces:
org.gephi.datalab.spi.ContextMenuItemManipulator, org.gephi.datalab.spi.Manipulator

public interface GraphContextMenuItem extends org.gephi.datalab.spi.ContextMenuItemManipulator
Please note that the methods offered in this service are the same as Data Laboratory nodes manipulators. It is possible to reuse actions implementations by adding both ServiceProvider annotations.

Interface from providing graph context menu items as services.

All context menu items are able to:

  • Execute an action
  • Provide a name, type and order of appearance (position in group of its type)
  • Indicate whether they have to be available (appear in the context menu) or not
  • Indicate whether they have to be executable (enabled in the context menu) or not
  • Provide and icon or not

Used for different manipulators such as NodesManipulator, EdgesManipulator and GeneralActionsManipulator.

The only methods that are called before setting up an item with the data are getSubItems, getType and getPosition. This way, the other methods behaviour can depend on the data that has been setup before

getSubItems will be called before and after setup. Take care when the nodes are null!

To provide a context menu item, a class has to implement this interface and have a @ServiceProvider annotation

Author:
Eduardo Ramos
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setup(org.gephi.graph.api.Graph graph, org.gephi.graph.api.Node[] nodes)
    Prepare nodes for this item.

    Methods inherited from interface org.gephi.datalab.spi.ContextMenuItemManipulator

    getMnemonicKey, getSubItems, isAvailable

    Methods inherited from interface org.gephi.datalab.spi.Manipulator

    canExecute, execute, getDescription, getIcon, getName, getPosition, getType, getUI
  • Method Details

    • setup

      void setup(org.gephi.graph.api.Graph graph, org.gephi.graph.api.Node[] nodes)
      Prepare nodes for this item. Note that nodes could contain 0 nodes.
      Parameters:
      graph - graph
      nodes - All selected nodes