Tag: jung

JUNG:将整个图形(不仅仅是可见部分)保存为图像

我一直在寻找我的问题的解决方案,但没有什么是我想要的。 我想要做的是将整个JUNG图(使用自定义顶点和边渲染)保存到图像(PNG或JPEG)。 当我将VisualizationViewer保存到BufferedImage时,它只占用可见部分。 我想保存整个图表,所以这不是一个选项。 有没有人知道如何将整个图形渲染到图像? 提前致谢!

如何在eclipse上安装Jung2?

http://jung.sourceforge.net/ 有人可以为我仔细地走过这些台阶吗? 我已经尝试了几个小时,我似乎无法得到它。 我正在使用Mac。 而且,我希望能够在使用Eclipse IDE进行编程时使用Jung2库。

将JUNG图导出为高分辨率图像(最好是基于矢量的)

在我的一个项目中,我使用JUNG2来显示一个非常大的多父层次结构图,显示在一个applet中。 我需要将图形的整个/部分导出为高分辨率静止图像,因为打印时屏幕截图看起来很可怕(特别是如果图形已经缩小)。 我目前使用的代码如下: public void writeToDisk(File saveToFolder, String filename) { //Dimension loDims = getGraphLayout().getSize(); Dimension vsDims = getSize(); int width = vsDims.width; int height = vsDims.height; Color bg = getBackground(); BufferedImage im = new BufferedImage(width,height,BufferedImage.TYPE_INT_BGR); Graphics2D graphics = im.createGraphics(); graphics.setColor(bg); graphics.fillRect(0,0, width, height); paintComponent(graphics); try{ ImageIO.write(im,”png”,new File(saveToFolder,filename)); }catch(Exception e){ e.printStackTrace(); } } 这会产生分辨率不是特别高的PNG图像。 所以我的问题如下: 是否可以将PNG输出分辨率提高到300 […]