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); } }
pageFormat.getImageableHeight() / this.getHeight());
public void export(final CyNetworkView view, final FileOutputStream stream) { final InternalFrameComponent ifc = Cytoscape.getDesktop() .getNetworkViewManager().getInternalFrameComponent(view); final ExportBitmapOptionsDialog dialog = new ExportBitmapOptionsDialog(ifc.getWidth(), ifc.getHeight()); ActionListener listener = new ActionListener() { public void actionPerformed(ActionEvent e) { BitmapExporter exporter = new BitmapExporter(extension, dialog.getZoom()); dialog.dispose(); ExportTask.run("Exporting to " + extension, exporter, view, stream); } }; dialog.addActionListener(listener); dialog.setVisible(true); } }
/ ((double) ifc.getHeight())); g.scale(imageScale, imageScale);