Cytoscape 2.2 (c) 2004 ISB, MSKCC, UCSD

cytoscape.view
Class CyMenus

java.lang.Object
  extended bycytoscape.view.CyMenus
All Implemented Interfaces:
EventListener, GraphViewChangeListener

public class CyMenus
extends Object
implements GraphViewChangeListener

This class creates the menu and tool bars for a Cytoscape window object. It also provides access to individual menus and items.


Constructor Summary
CyMenus()
           
 
Method Summary
 void addAction(CytoscapeAction action)
           
 void addCytoscapeAction(CytoscapeAction action)
          Takes a CytoscapeAction and will add it to the MenuBar or the Toolbar as is appropriate.
 void disableDeleteSelectionMenuItem()
          Called when the window switches to read-only mode, disabling the menu option for deleting selected objects.
 void enableDeleteSelectionMenuItem()
          Called when the window switches to edit mode, enabling the menu option for deleting selected objects.
 JMenu getCytoPanelMenu()
          Returns the cytopanels menu.
 JMenu getDataMenu()
          Returns the menu with items related to data operations.
 JMenu getEditMenu()
          returns the menu with items related to editing the graph.
 JMenu getFileMenu()
          Returns the menu with items related to file operations.
 JMenu getHelpMenu()
          Returns the help menu.
 JMenu getLayoutMenu()
          Returns the menu with items realted to layout actions.
 JMenu getLoadSubMenu()
          Returns the submenu with items related to loading objects.
 CytoscapeMenuBar getMenuBar()
          Returns the main menu bar constructed by this object.
 JMenu getOperationsMenu()
          Returns the menu with items associated with plug-ins.
 JMenu getSaveSubMenu()
          Returns the submenu with items related to saving objects.
 JMenu getSelectMenu()
          Returns the menu with items related to selecting nodes and edges in the graph.
 CytoscapeToolBar getToolBar()
          Returns the toolbar object constructed by this class.
 JMenu getVizMenu()
          Returns the menu with items related to visualiation.
 void graphViewChanged(GraphViewChangeEvent e)
          Update the UI menus and buttons.
 void initCytoPanelMenus()
           
 void initializeMenus()
          This method should be called by the creator of this object after the constructor has finished.
 void refreshOperationsMenu()
          Deprecated. This method is no longer needed now that we don't use the NO_OPERATIONS menu placeholder. This method does nothing.
 void setNodesRequiredItemsEnabled()
          Enables or disables save, print, and display nodes in new window GUI functions, based on the number of nodes in this window's graph perspective.
 void setVisualMapperItemsEnabled(boolean newState)
          Enables the menu items related to the visual mapper if the argument is true, else disables them.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CyMenus

public CyMenus()
Method Detail

getMenuBar

public CytoscapeMenuBar getMenuBar()
Returns the main menu bar constructed by this object.


getFileMenu

public JMenu getFileMenu()
Returns the menu with items related to file operations.


getLoadSubMenu

public JMenu getLoadSubMenu()
Returns the submenu with items related to loading objects.


getSaveSubMenu

public JMenu getSaveSubMenu()
Returns the submenu with items related to saving objects.


getEditMenu

public JMenu getEditMenu()
returns the menu with items related to editing the graph.


getDataMenu

public JMenu getDataMenu()
Returns the menu with items related to data operations.


getSelectMenu

public JMenu getSelectMenu()
Returns the menu with items related to selecting nodes and edges in the graph.


getLayoutMenu

public JMenu getLayoutMenu()
Returns the menu with items realted to layout actions.


getVizMenu

public JMenu getVizMenu()
Returns the menu with items related to visualiation.


getHelpMenu

public JMenu getHelpMenu()
Returns the help menu.


getOperationsMenu

public JMenu getOperationsMenu()
Returns the menu with items associated with plug-ins. Most plug-ins grab this menu and add their menu option. The plugins should then call refreshOperationsMenu to update the menu.


refreshOperationsMenu

public void refreshOperationsMenu()
Deprecated. This method is no longer needed now that we don't use the NO_OPERATIONS menu placeholder. This method does nothing.


getToolBar

public CytoscapeToolBar getToolBar()
Returns the toolbar object constructed by this class.


addAction

public void addAction(CytoscapeAction action)

addCytoscapeAction

public void addCytoscapeAction(CytoscapeAction action)
Takes a CytoscapeAction and will add it to the MenuBar or the Toolbar as is appropriate.


enableDeleteSelectionMenuItem

public void enableDeleteSelectionMenuItem()
Called when the window switches to edit mode, enabling the menu option for deleting selected objects. Again, the keeper of the edit modes should probably get a reference to the menu item and manage its state.


disableDeleteSelectionMenuItem

public void disableDeleteSelectionMenuItem()
Called when the window switches to read-only mode, disabling the menu option for deleting selected objects. Again, the keeper of the edit modes should probably get a reference to the menu item and manage its state.


setVisualMapperItemsEnabled

public void setVisualMapperItemsEnabled(boolean newState)
Enables the menu items related to the visual mapper if the argument is true, else disables them. This method should only be called from the window that holds this menu.


setNodesRequiredItemsEnabled

public void setNodesRequiredItemsEnabled()
Enables or disables save, print, and display nodes in new window GUI functions, based on the number of nodes in this window's graph perspective. This function should be called after every operation which adds or removes nodes from the current window.


graphViewChanged

public void graphViewChanged(GraphViewChangeEvent e)
Update the UI menus and buttons. When the graph view is changed, this method is the listener which will update the UI items, enabling or disabling items which are only available when the graph view is non-empty.

Specified by:
graphViewChanged in interface GraphViewChangeListener
Parameters:
e -

getCytoPanelMenu

public JMenu getCytoPanelMenu()
Returns the cytopanels menu.


initCytoPanelMenus

public void initCytoPanelMenus()

initializeMenus

public void initializeMenus()
This method should be called by the creator of this object after the constructor has finished. It fills the previously created menu and tool bars with items and action listeners that respond when those items are activated. This needs to come after the constructor is done, because some of the listeners try to access this object in their constructors. Any calls to this method after the first will do nothing.


www.cytoscape.org