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; } });
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); } });
/** * Toggles the cytopanel state. * * @param ev Triggering event - not used. */ public void actionPerformed(ActionEvent ev) { CytoPanelState curState = Cytoscape.getDesktop().getCytoPanel(position).getState(); if (curState == CytoPanelState.HIDE) { Cytoscape.getDesktop().getCytoPanel(position).setState(CytoPanelState.DOCK); } else { Cytoscape.getDesktop().getCytoPanel(position).setState(CytoPanelState.HIDE); } }
public void onComponentSelected(int componentIndex) { if (componentIndex == myIndex) { if (WEST != -1) { Cytoscape.getDesktop().getCytoPanel(SwingConstants.WEST).setSelectedIndex(WEST); } if (SOUTH != -1) { Cytoscape.getDesktop().getCytoPanel(SwingConstants.SOUTH).setSelectedIndex(SOUTH); } if (EAST != -1) { Cytoscape.getDesktop().getCytoPanel(SwingConstants.EAST).setSelectedIndex(EAST); } } }
/** * Activates the BioPaxPlugIn Tab in a Cytopanel. * Feature only available in Cytoscape 2.2. * * @param bpContainer BioPaxContainer Object. */ public static void activateBioPaxPlugInTab(BioPaxContainer bpContainer) { // cytoscape 2.2 code CytoscapeDesktop desktop = Cytoscape.getDesktop(); CytoPanel cytoPanel = desktop.getCytoPanel(BioPaxContainer.CYTO_PANEL_LOCATION); int index = cytoPanel.indexOfComponent(bpContainer); cytoPanel.setSelectedIndex(index); }
.getCytoPanel(SwingConstants.WEST); cytoPanelWest.addCytoPanelListener(this);
/** * DOCUMENT ME! * * @param e DOCUMENT ME! */ public void actionPerformed(ActionEvent e) { CytoPanel targetPanel = Cytoscape.getDesktop().getCytoPanel(SwingConstants.WEST); targetPanel.setSelectedIndex(1); // If Control Panel is hidden, display it. CytoPanelState curState = targetPanel.getState(); if (curState == CytoPanelState.HIDE) targetPanel.setState(CytoPanelState.DOCK); } }
public void onComponentSelected(int componentIndex){ // Add selection listener for the feedback table CytoPanelImp cytoPanelWest = (CytoPanelImp) Cytoscape.getDesktop() .getCytoPanel(SwingConstants.WEST); int _index = cytoPanelWest.indexOfComponent("Filters"); if (_index != componentIndex) return; //FiltersPanel is selected if (Cytoscape.getCurrentNetwork() == null) return; Cytoscape.getCurrentNetwork().addSelectEventListener(this); } public void onStateChange(CytoPanelState newState){}
/** * 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; }
/** * This dynamically sets the title of the menu based on the state of the CytoPanel. */ public void menuSelected(MenuEvent me) { if (parent != null){ CytoPanelState parentState = Cytoscape.getDesktop().getCytoPanel(parent.getCompassDirection()).getState(); if ( parentState == CytoPanelState.HIDE ) setEnabled(false); else setEnabled(true); } CytoPanelState curState = Cytoscape.getDesktop().getCytoPanel(position).getState(); if (curState == CytoPanelState.HIDE) { putValue(Action.NAME, SHOW + " " + title); } else { putValue(Action.NAME, HIDE + " " + title); } } }
cytopanelStates[1] = Cytoscape.getDesktop().getCytoPanel(SwingConstants.WEST).getState() .toString(); selectedPanels[1] = Cytoscape.getDesktop().getCytoPanel(SwingConstants.WEST) .getSelectedIndex(); cytopanelStates[2] = Cytoscape.getDesktop().getCytoPanel(SwingConstants.SOUTH).getState() .toString(); selectedPanels[2] = Cytoscape.getDesktop().getCytoPanel(SwingConstants.SOUTH) .getSelectedIndex(); cytopanelStates[3] = Cytoscape.getDesktop().getCytoPanel(SwingConstants.EAST).getState() .toString(); selectedPanels[3] = Cytoscape.getDesktop().getCytoPanel(SwingConstants.EAST) .getSelectedIndex();
Cytoscape.getDesktop().getCytoPanel(SwingConstants.SOUTH) .add(panelType.getDisplayName() + " Attribute Browser", mainPanel); Cytoscape.getDesktop().getCytoPanel(SwingConstants.SOUTH).setState(CytoPanelState.DOCK);
((CytoPanelImp) Cytoscape.getDesktop().getCytoPanel(SwingConstants.WEST)).validate();
CytoPanel cytoPanel = Cytoscape.getDesktop().getCytoPanel(SwingConstants.EAST); cytoPanel.addCytoPanelListener(this); cytoPanelState = cytoPanel.getState();
/** * 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); } }
/** * 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)); }
/** * 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); } }