/** * Constructor. * This method is called by the main Cytoscape Application upon startup. */ public CPathPlugIn() { CytoscapeDesktop desktop = Cytoscape.getDesktop(); CyMenus cyMenus = desktop.getCyMenus(); JMenu plugInMenu = cyMenus.getNewNetworkMenu(); JMenuItem menuItem = new JMenuItem("Construct Network Using cPath..."); plugInMenu.add(menuItem); menuItem.addActionListener(this); }
/** * Add new menu item under "Plugins" */ public NetworkMergePlugin() { Cytoscape.getDesktop().getCyMenus().getOperationsMenu().add( 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(); }
/** * 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); } })); } }
/** * 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."); } } }
/** * 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()); } }
/** * 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)); }
/** * 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); } }
/** * 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(); }
/** * Enables of disables the action based on system state. * * @param ev Triggering event - not used. */ public void menuSelected(MenuEvent e) { enableForNetworkAndView(); JCheckBoxMenuItem item = (JCheckBoxMenuItem)Cytoscape.getDesktop().getCyMenus().getLayoutMenu().getItem(menuIndex); if ( manualLayoutPanel.getSelectedIndex() != menuIndex || manualLayoutPanel.getState() == CytoPanelState.HIDE ) item.setState(false); else item.setState(true); CytoPanelState parentState = Cytoscape.getDesktop().getCytoPanel(SwingConstants.WEST).getState(); if ( parentState == CytoPanelState.HIDE ) { setEnabled(false); } else { setEnabled(true); } }