Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.view
Class CyMenus

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

public class CyMenus
extends Object
implements GraphViewChangeListener

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

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()
          Creates a new CyMenus object.
 
Method Summary
 void addAction(CytoscapeAction action)
          Add the menu item.
 void addAction(CytoscapeAction action, int index)
          Add the menu item in a specific position
 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()
          Deprecated. Will be removed April 2008. Cytopanels no longer have a separate menu (they're in View).
 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 getNewNetworkMenu()
          Returns the File.New.Network menu.
 JMenu getOperationsMenu()
          Returns the menu with items associated with plugins.
 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)
          We are not listening for any GraphViewChangeEvents.
 void initCytoPanelMenus()
          Deprecated. Will be removed April 2008. Cytopanels are initialized in the Display* actions. Do not use.
 void initializeMenus()
          This method should be called by the creator of this object after the constructor has finished.
 void setNodesRequiredItemsEnabled()
          Deprecated. Will be removed April 2008. Item state is now handled by Actions directly. Don't use this.
 void setOverviewEnabled(boolean newState)
          Deprecated. Will be removed April 2008. Item state is now handled by Actions directly. Don't use this.
 void setVisualMapperItemsEnabled(boolean newState)
          Deprecated. Will be removed April 2008. Item state is now handled by Actions directly. Don't use this.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CyMenus

public CyMenus()
Creates a new CyMenus object. This will construct the basic bar objects, but won't fill them with menu items and associated action listeners.

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 plugins. Most plugins grab this menu and add their menu option.


getNewNetworkMenu

public JMenu getNewNetworkMenu()
Returns the File.New.Network menu.


getToolBar

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


addAction

public void addAction(CytoscapeAction action)
Add the menu item.

Parameters:
action -

addAction

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

Parameters:
action -
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)
Deprecated. Will be removed April 2008. Item state is now handled by Actions directly. Don't use this.


setOverviewEnabled

public void setOverviewEnabled(boolean newState)
Deprecated. Will be removed April 2008. Item state is now handled by Actions directly. Don't use this.


setNodesRequiredItemsEnabled

public void setNodesRequiredItemsEnabled()
Deprecated. Will be removed April 2008. Item state is now handled by Actions directly. Don't use this.


graphViewChanged

public void graphViewChanged(GraphViewChangeEvent e)
We are not listening for any GraphViewChangeEvents. MenuItems are responsible for updating their own state, which is generally accomplished by implementing the menuSelected() method.

Specified by:
graphViewChanged in interface GraphViewChangeListener
Parameters:
e -

getCytoPanelMenu

public JMenu getCytoPanelMenu()
Deprecated. Will be removed April 2008. Cytopanels no longer have a separate menu (they're in View).

Used to return the cytopanels menu.


initCytoPanelMenus

public void initCytoPanelMenus()
Deprecated. Will be removed April 2008. Cytopanels are initialized in the Display* actions. Do not use.

Used to set up the CytoPanelMenu items.


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