/** * 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); }
/** * 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); } }
private CyDesktopManager() { desktop = Cytoscape.getDesktop().getNetworkViewManager().getDesktopPane(); }
/** * Returns new vizmapper GUI. * * @return DOCUMENT ME! */ public VizMapperMainPanel getVizMapperUI() { if (vizmapperUI == null) { this.vmm = Cytoscape.getVisualMappingManager(); vizmapperUI = VizMapperMainPanel.getVizMapperUI(); getCytoPanel(SwingConstants.WEST).add("VizMapper\u2122", vizmapperUI); this.getSwingPropertyChangeSupport().addPropertyChangeListener(vizmapperUI); } return vizmapperUI; }
/** * DOCUMENT ME! * * @param e DOCUMENT ME! */ public void actionPerformed(ActionEvent e) { // Show warning String warning = "Current session (all networks/attributes) will be lost.\nDo you want to continue?"; int result = JOptionPane.showConfirmDialog(Cytoscape.getDesktop(), warning, "Caution!", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null); if (result == JOptionPane.YES_OPTION) { Cytoscape.setSessionState(Cytoscape.SESSION_OPENED); Cytoscape.createNewSession(); Cytoscape.getDesktop().setTitle("Cytoscape Desktop (New Session)"); Cytoscape.getDesktop().getNetworkPanel().repaint(); Cytoscape.getDesktop().repaint(); Cytoscape.setSessionState(Cytoscape.SESSION_NEW); Cytoscape.getPropertyChangeSupport().firePropertyChange(Cytoscape.CYTOSCAPE_INITIALIZED, null, null); } else { return; } } }
setIconImage(Toolkit.getDefaultToolkit().getImage(Cytoscape.class.getResource(SMALL_ICON))); getBirdsEyeViewHandler(); getSwingPropertyChangeSupport().addPropertyChangeListener(bevh); Cytoscape.getPropertyChangeSupport().addPropertyChangeListener(bevh); this.getSwingPropertyChangeSupport().addPropertyChangeListener(networkViewManager); networkViewManager.getSwingPropertyChangeSupport().addPropertyChangeListener(this); this.getSwingPropertyChangeSupport().addPropertyChangeListener(networkPanel); networkPanel.getSwingPropertyChangeSupport().addPropertyChangeListener(this); masterPane = setupCytoPanels(networkPanel, networkViewManager); initStatusBar(main_panel); setJMenuBar(cyMenus.getMenuBar()); getVizMapperUI(); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { Cytoscape.exit(returnVal); setContentPane(main_panel); setSize(DEF_DESKTOP_SIZE);
public void run() { CytoPanel cytoPanel = desktop.getCytoPanel(BioPaxContainer.CYTO_PANEL_LOCATION); URL url = BioPaxDetailsPanel.class.getResource("read_obj.gif"); Icon icon = new ImageIcon(url); cytoPanel.add("Node Details", icon, bpContainer, "Node Details"); cytoPanel.setState(CytoPanelState.DOCK); bioPaxUIInitialized = true; } });
Cytoscape.getDesktop().getSwingPropertyChangeSupport() .removePropertyChangeListener(Cytoscape.getDesktop().getBirdsEyeViewHandler()); Cytoscape.getDesktop().getSwingPropertyChangeSupport() .addPropertyChangeListener(Cytoscape.getDesktop().getBirdsEyeViewHandler()); Cytoscape.getDesktop().getNetworkViewManager() .firePropertyChange(CytoscapeDesktop.NETWORK_VIEW_FOCUSED, null, Cytoscape.getCurrentNetworkView().getNetwork()
/** * DOCUMENT ME! * * @param e DOCUMENT ME! */ public void actionPerformed(ActionEvent e) { if (!on) { bev = new BirdsEyeView((DGraphView) Cytoscape.getCurrentNetworkView()) { public Dimension getMinimumSize() { return new Dimension(180, 180); } }; Cytoscape.getDesktop().getNetworkPanel().setNavigator(bev); Cytoscape.getDesktop().getSwingPropertyChangeSupport().addPropertyChangeListener(this); on = true; putValue(Action.NAME, "Hide Network Overview"); } else { if (bev != null) { bev.destroy(); bev = null; } Cytoscape.getDesktop().getNetworkPanel() .setNavigator(Cytoscape.getDesktop().getNetworkPanel().getNavigatorPanel()); Cytoscape.getDesktop().getSwingPropertyChangeSupport().removePropertyChangeListener(this); on = false; putValue(Action.NAME, "Show Network Overview"); } } }
this.interactionBundleModel = interactionBundleModel; this.pathwayTableModel = pathwayTableModel; appLayeredPane = Cytoscape.getDesktop().getRootPane().getLayeredPane(); webApi.addApiListener(this); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); CytoPanel cytoPanel = Cytoscape.getDesktop().getCytoPanel(SwingConstants.EAST); cytoPanel.addCytoPanelListener(this); cytoPanelState = cytoPanel.getState();
UndoMonitor() { Cytoscape.getDesktop().getSwingPropertyChangeSupport().addPropertyChangeListener( CytoscapeDesktop.NETWORK_VIEW_FOCUSED,this); }
private void setDesktopStates() throws JAXBException { DesktopSize dSize = factory.createDesktopSize(); NetworkFrames frames = factory.createNetworkFrames(); Component[] networkFrames = Cytoscape.getDesktop().getNetworkViewManager().getDesktopPane() .getComponents(); for (int i = 0; i < networkFrames.length; i++) { if(networkFrames[i] instanceof JInternalFrame) { JInternalFrame networkFrame = (JInternalFrame) networkFrames[i]; NetworkFrame frame = factory.createNetworkFrame(); frame.setFrameID(networkFrame.getTitle()); frame.setWidth(BigInteger.valueOf(networkFrame.getWidth())); frame.setHeight(BigInteger.valueOf(networkFrame.getHeight())); frame.setX(BigInteger.valueOf(networkFrame.getX())); frame.setY(BigInteger.valueOf(networkFrame.getY())); frames.getNetworkFrame().add(frame); } } dSize.setHeight(BigInteger.valueOf(Cytoscape.getDesktop().getSize().height)); dSize.setWidth(BigInteger.valueOf(Cytoscape.getDesktop().getSize().width)); Desktop desktop = factory.createDesktop(); desktop.setDesktopSize(dSize); desktop.setNetworkFrames(frames); sState.setDesktop(desktop); }
public void run() { Cytoscape.getDesktop().getNetworkPanel().updateTitle(cyNetwork); } });
private void setDefaultPanel(final Image defImage, boolean repaint) { if (defImage == null) return; defaultAppearencePanel.removeAll(); final JButton defaultImageButton = new JButton(); defaultImageButton.setUI(new BlueishButtonUI()); defaultImageButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); defaultImageButton.setIcon(new ImageIcon(defImage)); defaultAppearencePanel.add(defaultImageButton, BorderLayout.CENTER); defaultImageButton.addMouseListener(new DefaultMouseListener()); if ( repaint ) Cytoscape.getDesktop().repaint(); }
public void run() { JOptionPane.showMessageDialog(Cytoscape.getDesktop().getCytoPanel(SwingConstants.WEST).getSelectedComponent(), "Continuous Mapper can be used with Numbers only.", "Incompatible Mapping Type!", JOptionPane.ERROR_MESSAGE); } });
Cytoscape.getDesktop().getSwingPropertyChangeSupport().addPropertyChangeListener(CytoscapeDesktop.NETWORK_VIEWS_SELECTED,this); Cytoscape.getDesktop().getSwingPropertyChangeSupport().addPropertyChangeListener(CytoscapeDesktop.NETWORK_VIEW_FOCUSED, this); .getCytoPanel(SwingConstants.WEST); cytoPanelWest.addCytoPanelListener(this);
Cytoscape.getDesktop().setTitle("Cytoscape Desktop (New Session)"); Cytoscape.getDesktop().getNetworkPanel().repaint(); Cytoscape.getDesktop().repaint(); Cytoscape.setSessionState(Cytoscape.SESSION_NEW); Cytoscape.getPropertyChangeSupport().firePropertyChange(Cytoscape.CYTOSCAPE_INITIALIZED, null, null);
/** * */ public CytoscapeModifiedNetworkManager() { super(); Cytoscape.getDesktop().getSwingPropertyChangeSupport() .addPropertyChangeListener(Cytoscape.NETWORK_MODIFIED, this); Cytoscape.getDesktop().getSwingPropertyChangeSupport() .addPropertyChangeListener(Cytoscape.NETWORK_SAVED, this); Cytoscape.getDesktop().getSwingPropertyChangeSupport() .addPropertyChangeListener(Cytoscape.NETWORK_CREATED, this); Cytoscape.getSwingPropertyChangeSupport().addPropertyChangeListener(this); }
NetworkPanel netPanel = cyDesktop.getNetworkPanel();