Interface CyAction

All Superinterfaces:
Action, ActionListener, EventListener, MenuListener, PopupMenuListener
All Known Implementing Classes:
AbstractCyAction

public interface CyAction extends Action, MenuListener, PopupMenuListener
An interface that describes how an action should be placed within the menus and/or toolbars of the Swing application.

Cytoscape Backwards Compatibility (SPI Interface): We expect that this interface will be implemented. Therefore to maintain backwards compatibility this interface will only be modified for major version updates.

Module: swing-application-api

To use this in your app, include the following dependency in your POM:

<dependency>
    <groupId>org.cytoscape</groupId>
    <artifactId>swing-application-api</artifactId>
</dependency>
  • Method Details

    • getName

      String getName()
      Returns the name of the action.
      Returns:
      the name of the action.
    • isInMenuBar

      boolean isInMenuBar()
      Returns whether the action should be in the menu bar.
      Returns:
      whether the action should be in the menu bar.
    • isInToolBar

      boolean isInToolBar()
      Returns whether the action should be in the tool bar.
      Returns:
      true if the action should be in the tool bar.
    • isInNodeTableToolBar

      default boolean isInNodeTableToolBar()
      Returns whether the action should be in the Node Table Panel's tool bar.
      Returns:
      true if the action should be in the Node Table Panel's tool bar.
    • isInEdgeTableToolBar

      default boolean isInEdgeTableToolBar()
      Returns whether the action should be in the Edge Table Panel's tool bar.
      Returns:
      true if the action should be in the Edge Table Panel's tool bar.
    • isInNetworkTableToolBar

      default boolean isInNetworkTableToolBar()
      Returns whether the action should be in the Network Table Panel's tool bar.
      Returns:
      true if the action should be in the Network Table Panel's tool bar.
    • isInUnassignedTableToolBar

      default boolean isInUnassignedTableToolBar()
      Returns whether the action should be in the Unassigned Tables Panel's tool bar.
      Returns:
      true if the action should be in the Unassigned Tables Panel's tool bar.
    • insertSeparatorBefore

      boolean insertSeparatorBefore()
      Insert a separator before this menu item.
      Returns:
      true if this Action should have a separator before it
    • insertSeparatorAfter

      boolean insertSeparatorAfter()
      Insert a separator after this menu item.
      Returns:
      true if this Action should have a separator after it
    • getMenuGravity

      float getMenuGravity()
      Returns the gravity used to place the menu item for this action. Gravity is a numeric value associated with each menu item. MenuItems in the same menu pull-down are sorted in ascending order based on their gravity values.
      Returns:
      The gravity used to place the menu item for this action.
    • getToolbarGravity

      float getToolbarGravity()
      Returns the gravity used to place this action in the toolbar. Gravity is a numeric value associated with each menu item. MenuItems in the same menu pull-down are sorted in ascending order based on their gravity values.
      Returns:
      The gravity used to place this action in the toolbar.
    • getAcceleratorKeyStroke

      KeyStroke getAcceleratorKeyStroke()
      Returns the accelerator KeyStroke defined for this action. Will return null if no accelerator is set.
      Returns:
      the accelerator KeyStroke defined for this action. Will return null if no accelerator is set.
    • getPreferredMenu

      String getPreferredMenu()
      This method returns a Menu specification string. Submenus are preceded by dots in this string, so the result "File.Import" specifies the submenu "Import" of the menu "File". If the result is null, the menu will be placed in a default location.
      Returns:
      the string identifying the preferred menu.
    • useCheckBoxMenuItem

      boolean useCheckBoxMenuItem()
      Returns whether or not a checkbox menu item should be used. Use Action.putValue(String, Object) to set the value of Action.SELECTED_KEY to true in order to have the menu item checked.
      Returns:
      whether or not a checkbox menu item should be used.
    • useToggleButton

      default boolean useToggleButton()
      Returns whether or not a toggle button should be used in the tool bar. Only valid when setIsInToolBar(boolean) is also set to true. Use Action.putValue(String, Object) to set the value of Action.SELECTED_KEY to true in order to have the toggle button selected.
      Returns:
      true toggle button should be used.
    • updateEnableState

      void updateEnableState()
      Forces the action to update its enable state based on the criteria defined for the action.
    • getProperties

      Map<String,String> getProperties()
      Returns the configuration properties that were passed to the CyAction when it was created.
    • setIsInMenuBar

      void setIsInMenuBar(boolean b)
      To support configurable menus and tools, setIsInMenuBar added for 3.6
    • setIsInToolBar

      void setIsInToolBar(boolean b)
      To support configurable menus and tools, setIsInToolBar added for 3.6
    • setIsInNodeTableToolBar

      default void setIsInNodeTableToolBar(boolean b)
      To support configurable menus and tools, added for 3.9
    • setIsInEdgeTableToolBar

      default void setIsInEdgeTableToolBar(boolean b)
      To support configurable menus and tools, added for 3.9
    • setIsInNetworkTableToolBar

      default void setIsInNetworkTableToolBar(boolean b)
      To support configurable menus and tools, added for 3.9
    • setIsInUnassignedTableToolBar

      default void setIsInUnassignedTableToolBar(boolean b)
      To support configurable menus and tools, added for 3.9
    • setPreferredMenu

      void setPreferredMenu(String menu)
      To support configurable menus and tools, setPreferredMenu added for 3.6
    • setToolbarGravity

      void setToolbarGravity(float f)
      To support configurable menus and tools, setToolbarGravity added for 3.6
    • setMenuGravity

      void setMenuGravity(float f)
      To support configurable menus and tools, setMenuGravity added for 3.6
    • setAcceleratorKeyStroke

      void setAcceleratorKeyStroke(KeyStroke ks)
      Was defined in AbstractCyAction, but not in this interface
    • getToolTipImage

      default URL getToolTipImage()
      Optional image to be displayed in the target component's tool tip.