/** * Add the menu item in a specific position * * @param action * @param index */ public void addAction(CytoscapeAction action, int index) { addCytoscapeAction(action, index); }
/** * 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. */ public void initializeMenus() { if (!menusInitialized) { menusInitialized = true; fillMenuBar(); fillToolBar(); } }
networkPanel.setNavigator(bevh.getBirdsEyeView()); cyMenus = new CyMenus(); cyMenus.initializeMenus(); main_panel.add(cyMenus.getToolBar(), BorderLayout.NORTH); setJMenuBar(cyMenus.getMenuBar());
/** * Takes a CytoscapeAction and will add it to the MenuBar or the Toolbar as * is appropriate. */ public void addCytoscapeAction(CytoscapeAction action) { if (action.isInMenuBar()) { getMenuBar().addAction(action); } if (action.isInToolBar()) { getToolBar().addAction(action); } }
/** * Register NCBIClientPlugin to the Web Service Client Manager. */ public NCBIClientPlugin() throws Exception { // Register this client to the manager. WebServiceClientManager.registerClient(NCBIClient.getClient()); Cytoscape.getDesktop().getCyMenus().getMenuBar().getMenu("File.Import") .add( new JMenuItem(new AbstractAction( "Import Attributes from NCBI Entrez Gene...") { private static final long serialVersionUID = 3263699405477145319L; public void actionPerformed(ActionEvent e) { if (annotationDialog == null) annotationDialog = new NCBIGeneDialog(); annotationDialog.setVisible(true); } })); } }
/** * Initalizes Tool Bar. */ private void initToolBar() { CytoscapeDesktop desktop = Cytoscape.getDesktop(); CyMenus cyMenus = desktop.getCyMenus(); CytoscapeToolBar toolBar = cyMenus.getToolBar(); quickFindToolBar = new QuickFindPanel(); TextIndexComboBox comboBox = quickFindToolBar.getTextIndexComboBox(); ActionListener listener = new UserSelectionListener(comboBox); comboBox.addFinalSelectionListener(listener); JRangeSliderExtended slider = quickFindToolBar.getSlider(); RangeSelectionListener rangeSelectionListener = new RangeSelectionListener(slider); slider.addChangeListener(rangeSelectionListener); toolBar.add(quickFindToolBar); toolBar.validate(); }
/** * Add the menu item in a specific position * * @param action * @param index */ public void addCytoscapeAction(CytoscapeAction action, int index) { if (action.isInMenuBar()) { getMenuBar().addAction(action, index); } if (action.isInToolBar()) { getToolBar().addAction(action); } }
/** * Creates a new BiomartClientPlugin object. * * @throws Exception */ public BiomartClientPlugin() throws Exception { // Register this client to the manager. WebServiceClientManager.registerClient(BiomartClient.getClient()); final JMenu menu = Cytoscape.getDesktop().getCyMenus().getMenuBar() .getMenu("File.Import"); if (menu != null) { menu.add(new AbstractAction("Import attributes from Biomart...") { private static final long serialVersionUID = -1303677510967797368L; public void actionPerformed(ActionEvent e) { BiomartMainDialog.showUI(); } }); } else { throw new IllegalStateException( "Could not register BioMart Client to Cytoscape menu."); } } }
addAction(new NewSessionAction()); addAction(new NewWindowSelectedNodesOnlyAction()); addAction(new NewWindowSelectedNodesEdgesAction()); addAction(new CloneGraphInNewWindowAction()); addAction(new NewNetworkAction()); addAction(new OpenSessionAction(),1); addAction(new SaveSessionAction("Save"),2); addAction(new SaveSessionAsAction("Save as..."),3); addAction(new ImportGraphFileAction(this)); addAction(new WebServiceNetworkImportAction()); addAction(new ImportNodeAttributesAction()); addAction(new ImportEdgeAttributesAction()); addAction(new ImportExpressionMatrixAction()); addAction(new ImportVizmapAction()); addAction(new ExportAsXGMMLAction()); addAction(new ExportAsGMLAction()); addAction(new ExportAsInteractionsAction()); addAction(new ExportNetworksAsNNFAction()); addAction(new ExportNodeAttributesAction()); addAction(new ExportEdgeAttributesAction()); addAction(new ExportVizmapAction()); addAction(new ExportAsGraphicsAction("PDF"));
/** * Add the menu item. * * @param action */ public void addAction(CytoscapeAction action) { addCytoscapeAction(action); }
/** * Constructor. * This method is called by the main Cytoscape Application upon startup. */ public BiopaxPlugin() { ImportHandler importHandler = new ImportHandler(); importHandler.addFilter(new BioPaxFilter()); // Optionally set up HTTP Proxy Properties cytoProps = CytoscapeInit.getProperties(); String proxyHost = (String) cytoProps.get(PROXY_HOST_PROPERTY); String proxyPort = (String) cytoProps.get(PROXY_PORT_PROPERTY); if ((proxyHost != null) && (proxyPort != null)) { System.getProperties().put("proxySet", "true"); System.getProperties().put("proxyHost", proxyHost); System.getProperties().put("proxyPort", proxyPort); } // add export to BioPAX menu CyMenus cyMenus = Cytoscape.getDesktop().getCyMenus(); cyMenus.addAction(new ExportAsBioPAXAction()); // to start listening to network events, like a load of a network from a session, // we create an instance of a BioPaxContainerClass this contains the network listener BioPaxContainer.getInstance(); }
/** * Creates a new FilterPlugin object. * * @param icon * DOCUMENT ME! * @param csfilter * DOCUMENT ME! */ public FilterPlugin() { // Add a menuItem on "select" menu FilterMenuItemAction menuAction = new FilterMenuItemAction(icon2, this); Cytoscape.getDesktop().getCyMenus().addCytoscapeAction( (CytoscapeAction) menuAction); // Add an icon to tool-bar FilterPluginToolBarAction toolbarAction = new FilterPluginToolBarAction( icon, this); Cytoscape.getDesktop().getCyMenus().addCytoscapeAction( (CytoscapeAction) toolbarAction); if (allFilterVect == null) { allFilterVect = new Vector<CompositeFilter>(); } logger = CyLogger.getLogger(FilterPlugin.class); restoreInitState(); // initialize the filterMainPanel and add it to the control panel CytoPanelImp cytoPanelWest = (CytoPanelImp) Cytoscape.getDesktop() .getCytoPanel(SwingConstants.WEST); cytoPanelWest.add("Filters", new FilterMainPanel(allFilterVect)); }
/** * PSI-MI Plugin */ public PsiMiPlugIn() { // Register PsiMiFilter ImportHandler importHandler = new ImportHandler(); importHandler.addFilter(new PsiMiFilter()); Cytoscape.getDesktop().getCyMenus().addAction(new ExportNetworkAsPsiMiOne()); Cytoscape.getDesktop().getCyMenus().addAction(new ExportNetworkAsPsiMiTwoFive()); } }
/** * DOCUMENT ME! */ public void initialize() { // create icons ImageIcon icon = new ImageIcon(getClass().getResource("/stock_filter-data-by-criteria.png")); ImageIcon icon2 = new ImageIcon(getClass() .getResource("/stock_filter-data-by-criteria-16.png")); //FilterPlugin action = new FilterPlugin(icon, this); FilterMenuItem menu_action = new FilterMenuItem(icon2, this); //Cytoscape.getDesktop().getCyMenus().addCytoscapeAction( ( CytoscapeAction )action ); Cytoscape.getDesktop().getCyMenus().addCytoscapeAction((CytoscapeAction) menu_action); FilterEditorManager.defaultManager().addEditor(new NumericAttributeFilterEditor()); FilterEditorManager.defaultManager().addEditor(new StringPatternFilterEditor()); FilterEditorManager.defaultManager().addEditor(new NodeTopologyFilterEditor()); FilterEditorManager.defaultManager().addEditor(new BooleanMetaFilterEditor()); FilterEditorManager.defaultManager().addEditor(new NodeInteractionFilterEditor()); FilterEditorManager.defaultManager().addEditor(new EdgeInteractionFilterEditor()); }
/** * Creates a new ManualLayoutPlugin object. */ public ManualLayoutPlugin() { // create the panels RotatePanel rotatePanel = new RotatePanel(); ScalePanel scalePanel = new ScalePanel(); ControlPanel controlPanel = new ControlPanel(); // add them to the cytopanel Cytoscape.getDesktop().getCytoPanel(SwingConstants.SOUTH_WEST) .add("Align and Distribute", controlPanel); Cytoscape.getDesktop().getCytoPanel(SwingConstants.SOUTH_WEST).add("Rotate", rotatePanel); Cytoscape.getDesktop().getCytoPanel(SwingConstants.SOUTH_WEST).add("Scale", scalePanel); // create the actions Cytoscape.getDesktop().getCyMenus().addAction( new ControlPanelAction(), 0); Cytoscape.getDesktop().getCyMenus().addAction( new RotatePanelAction(), 1); Cytoscape.getDesktop().getCyMenus().addAction( new ScalePanelAction(), 2); } }