Cytoscape 2.3.1 (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. Feb. 21, 2006 Refactored by kono@ucsd.edu Now addAction takes one more optional argument to specify index. Plugin writers can use this function to specify the location of the menu item.


Constructor Summary
CyMenus()
           
 
Method Summary
 void addAction(CytoscapeAction action)
           
 void addAction(CytoscapeAction action, int index)
           
 void addCytoscapeAction(CytoscapeAction action)
          Takes a CytoscapeAction and will add it to the MenuBar or the Toolbar as is appropriate.
 void addCytoscapeAction(CytoscapeAction action, int index)
          Add the menu item in a specific position
 JMenu getCytoPanelMenu()
          Returns the cytopanels menu.
 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 getViewMenu()
          Returns the menu with items related to data operations.
 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 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 setOverviewEnabled(boolean newState)
           
 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.


getViewMenu

public JMenu getViewMenu()
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.


getToolBar

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


addAction

public void addAction(CytoscapeAction action)

addAction

public void addAction(CytoscapeAction action,
                      int index)

addCytoscapeAction

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


addCytoscapeAction

public void addCytoscapeAction(CytoscapeAction action,
                               int index)
Add the menu item in a specific position

Parameters:
action -
index -

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.


setOverviewEnabled

public void setOverviewEnabled(boolean newState)

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