public SliderStateTracker(PolymorphicSlider s) { Cytoscape.getDesktop().getNetworkViewManager().getSwingPropertyChangeSupport() .addPropertyChangeListener(CytoscapeDesktop.NETWORK_VIEW_FOCUSED,this); layoutStateMap = new HashMap<String,Integer>(); preFocusedViewId = "none"; slider = s; }
public void export(CyNetworkView view, FileOutputStream stream) throws IOException { InternalFrameComponent ifc = Cytoscape.getDesktop().getNetworkViewManager().getInternalFrameComponent(view); int width = (int) (ifc.getWidth() * scale); int height = (int) (ifc.getHeight() * scale); // CyLogger.getLogger().info("Exporting "+width+"X"+height+" image"); BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); Graphics2D g = (Graphics2D) image.getGraphics(); g.scale(scale, scale); ifc.print(g); g.dispose(); ImageIO.write(image, extension, stream); } }
unsetFocus(); // in case the newly focused network doesn't have a setFocus(network_id); if (this.getDesktopPane() != null) { canvas.addTransferComponent(this.getDesktopPane()); CyNetworkView new_view = (CyNetworkView) e.getNewValue(); createContainer(new_view); e = null; } else if (CytoscapeDesktop.NETWORK_VIEW_DESTROYED.equals(e.getPropertyName())) { removeView(view); e = null;
networkViewManager = new NetworkViewManager(this); networkViewManager.getSwingPropertyChangeSupport().addPropertyChangeListener(this);
/** * DOCUMENT ME! * * @return DOCUMENT ME! */ public BirdsEyeViewHandler getBirdsEyeViewHandler() { if (bevh == null) bevh = new BirdsEyeViewHandler(networkViewManager.getDesktopPane()); return bevh; }
/** * Fire Events when a Managed Network View gets the Focus. */ public void internalFrameActivated(InternalFrameEvent e) { String network_id = componentMap.get(e.getInternalFrame()); if (network_id == null) { return; } //logger.info("NetworkViewManager: firing NETWORK_VIEW_FOCUSED (intenalFrameActivate)"); firePropertyChange(CytoscapeDesktop.NETWORK_VIEW_FOCUSED, null, network_id); }
/** * Fire Events when a Managed Network View gets the Focus. */ public void internalFrameOpened(InternalFrameEvent e) { internalFrameActivated(e); }
private CyDesktopManager() { desktop = Cytoscape.getDesktop().getNetworkViewManager().getDesktopPane(); }
.addPropertyChangeListener(Cytoscape.getDesktop().getBirdsEyeViewHandler()); Cytoscape.getDesktop().getNetworkViewManager() .firePropertyChange(CytoscapeDesktop.NETWORK_VIEW_FOCUSED, null, Cytoscape.getCurrentNetworkView().getNetwork() .getIdentifier());
public ScalingDirectionTracker(JCheckBox j) { jCheckBox = j; listeningNetworks = new HashSet<String>(); Cytoscape.getDesktop().getNetworkViewManager().getSwingPropertyChangeSupport() .addPropertyChangeListener(CytoscapeDesktop.NETWORK_VIEW_FOCUSED,this); }
public void export(CyNetworkView view, FileOutputStream stream) throws IOException { DingNetworkView theView = (DingNetworkView) view; theView.setPrintingTextAsShape(!exportTextAsFont); InternalFrameComponent ifc = Cytoscape.getDesktop().getNetworkViewManager().getInternalFrameComponent(view); SVGGraphics2D g = new SVGGraphics2D(stream, ifc); // this sets text as shape java.util.Properties p = new java.util.Properties(); p.setProperty("org.freehep.graphicsio.AbstractVectorGraphicsIO.TEXT_AS_SHAPES", Boolean.toString(!exportTextAsFont)); g.setProperties(p); g.startExport(); ifc.print(g); g.endExport(); }
JDesktopPane desktopPane = Cytoscape.getDesktop().getNetworkViewManager().getDesktopPane(); if (desktopPane == null) return;
componentMap.put(iframe, view.getNetwork().getIdentifier()); firePropertyChange(CytoscapeDesktop.NETWORK_VIEW_FOCUSED, null, view.getNetwork().getIdentifier());
public CheckBoxTracker(JCheckBox j) { jCheckBox = j; listeningNetworks = new HashSet<String>(); Cytoscape.getDesktop().getNetworkViewManager().getSwingPropertyChangeSupport() .addPropertyChangeListener(CytoscapeDesktop.NETWORK_VIEW_FOCUSED,this); }
public void export(CyNetworkView view, FileOutputStream stream) throws IOException { DingNetworkView theView = (DingNetworkView) view; theView.setPrintingTextAsShape(!exportTextAsFont); InternalFrameComponent ifc = Cytoscape.getDesktop().getNetworkViewManager().getInternalFrameComponent(view); Properties p = new Properties(); p.setProperty(PSGraphics2D.PAGE_SIZE,"Letter"); p.setProperty("org.freehep.graphicsio.AbstractVectorGraphicsIO.TEXT_AS_SHAPES", Boolean.toString(!exportTextAsFont)); PSGraphics2D g = new PSGraphics2D(stream,ifc); g.setMultiPage(false); g.setProperties(p); g.startExport(); ifc.printWithoutForeground(g); g.endExport(); }
/** * Creates the TopRight Pane. * * @param networkViewManager * to load on left side of top right bimodal. * @return BiModalJSplitPane Object. */ protected BiModalJSplitPane createTopRightPane(NetworkViewManager networkViewManager) { // create cytopanel with tabs along the top cytoPanelEast = new CytoPanelImp(SwingConstants.EAST, JTabbedPane.TOP, CytoPanelState.HIDE); // create the split pane - we show this on startup final BiModalJSplitPane splitPane = new BiModalJSplitPane(this, JSplitPane.HORIZONTAL_SPLIT, BiModalJSplitPane.MODE_HIDE_SPLIT, networkViewManager.getDesktopPane(), cytoPanelEast); // set the cytopanelcontainer cytoPanelEast.setCytoPanelContainer(splitPane); // set the resize weight - left component gets extra space splitPane.setResizeWeight(1.0); // outta here return splitPane; }
public SliderTracker(final JSlider slider, final JCheckBox controllingCheckBox) { this.slider = slider; this.controllingCheckBox = controllingCheckBox; Cytoscape.getDesktop().getNetworkViewManager().getSwingPropertyChangeSupport() .addPropertyChangeListener(CytoscapeDesktop.NETWORK_VIEW_FOCUSED, this); }
Cytoscape.getDesktop().getNetworkViewManager().getInternalFrameComponent(view);
private void restoreDesktopState() { final List<NetworkFrame> frames = session.getSessionState() .getDesktop().getNetworkFrames().getNetworkFrame(); final Map<String, NetworkFrame> frameMap = new HashMap<String, NetworkFrame>(); for (NetworkFrame netFrame : frames) frameMap.put(netFrame.getFrameID(), netFrame); Component[] desktopFrames = Cytoscape.getDesktop() .getNetworkViewManager().getDesktopPane().getComponents(); for (int i = 0; i < desktopFrames.length; i++) { Component cmp; cmp = desktopFrames[i]; if (cmp instanceof JInternalFrame) { JInternalFrame frame = (JInternalFrame) cmp; NetworkFrame nFrame = frameMap.get(frame.getTitle()); if (nFrame != null) { frame.setSize(nFrame.getWidth().intValue(), nFrame .getHeight().intValue()); frame.setLocation(nFrame.getX().intValue(), nFrame.getY() .intValue()); } } } }
/** * Constructor. * * @param bpPanel BioPaxDetails Panel Object. */ public NetworkListener(BioPaxDetailsPanel bpPanel) { this.bpPanel = bpPanel; // to catch network creation / destruction events Cytoscape.getSwingPropertyChangeSupport().addPropertyChangeListener(this); // to catch network selection / focus events Cytoscape.getDesktop().getNetworkViewManager().getSwingPropertyChangeSupport() .addPropertyChangeListener(this); }