Package org.cytoscape.application.swing
Interface CyAction
- All Superinterfaces:
Action
,ActionListener
,EventListener
,MenuListener
,PopupMenuListener
- All Known Implementing Classes:
AbstractCyAction
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>
-
Field Summary
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
Method Summary
Modifier and TypeMethodDescriptionReturns the accelerator KeyStroke defined for this action.float
Returns the gravity used to place the menu item for this action.getName()
Returns the name of the action.This method returns a Menu specification string.Returns the configuration properties that were passed to the CyAction when it was created.float
Returns the gravity used to place this action in the toolbar.default URL
Optional image to be displayed in the target component's tool tip.boolean
Insert a separator after this menu item.boolean
Insert a separator before this menu item.default boolean
Returns whether the action should be in the Edge Table Panel's tool bar.boolean
Returns whether the action should be in the menu bar.default boolean
Returns whether the action should be in the Network Table Panel's tool bar.default boolean
Returns whether the action should be in the Node Table Panel's tool bar.boolean
Returns whether the action should be in the tool bar.default boolean
Returns whether the action should be in the Unassigned Tables Panel's tool bar.void
Was defined in AbstractCyAction, but not in this interfacedefault void
setIsInEdgeTableToolBar
(boolean b) To support configurable menus and tools, added for 3.9void
setIsInMenuBar
(boolean b) To support configurable menus and tools, setIsInMenuBar added for 3.6default void
setIsInNetworkTableToolBar
(boolean b) To support configurable menus and tools, added for 3.9default void
setIsInNodeTableToolBar
(boolean b) To support configurable menus and tools, added for 3.9void
setIsInToolBar
(boolean b) To support configurable menus and tools, setIsInToolBar added for 3.6default void
setIsInUnassignedTableToolBar
(boolean b) To support configurable menus and tools, added for 3.9void
setMenuGravity
(float f) To support configurable menus and tools, setMenuGravity added for 3.6void
setPreferredMenu
(String menu) To support configurable menus and tools, setPreferredMenu added for 3.6void
setToolbarGravity
(float f) To support configurable menus and tools, setToolbarGravity added for 3.6void
Forces the action to update its enable state based on the criteria defined for the action.boolean
Returns whether or not a checkbox menu item should be used.default boolean
Returns whether or not a toggle button should be used in the tool bar.Methods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
Methods inherited from interface javax.swing.event.MenuListener
menuCanceled, menuDeselected, menuSelected
Methods inherited from interface javax.swing.event.PopupMenuListener
popupMenuCanceled, popupMenuWillBecomeInvisible, popupMenuWillBecomeVisible
-
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. UseAction.putValue(String, Object)
to set the value ofAction.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 whensetIsInToolBar(boolean)
is also set to true. UseAction.putValue(String, Object)
to set the value ofAction.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
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
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
Was defined in AbstractCyAction, but not in this interface -
getToolTipImage
Optional image to be displayed in the target component's tool tip.
-