public void writeToImageFile(String imageFileName) throws AWTException { final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); PersistentLayout pl = (PersistentLayout) vv.getGraphLayout(); int height = pl.getSize().height; int width = pl.getSize().width; panel.setSize(width, height); BufferedImage bufImage = ScreenImage.createImage(panel); panel.setVisible(false); try { File outFile = new File(imageFileName); ImageIO.write(bufImage, "png", outFile); System.out.println("wrote image to " + imageFileName); } catch (Exception e) { System.out.println("writeToImageFile(): " + e.getMessage()); } }
frame.getContentPane().add(new GraphZoomScrollPane(vv)); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
vv.setEdgeToolTipTransformer(new ToStringLabeller()); Container content = getContentPane(); final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); content.add(panel);
GraphZoomScrollPane gzsp = new GraphZoomScrollPane(vv); panel.add(gzsp);
final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); add(panel);
GraphZoomScrollPane gzsp = new GraphZoomScrollPane(vv); content.add(gzsp);
final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); content.add(panel); Supplier<Number> vertexFactory = new VertexFactory();
final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); content.add(panel); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); add(panel); Supplier<Number> nodeFactory = new NodeFactory();
vv.addKeyListener(graphMouse.getModeKeyListener()); GraphZoomScrollPane gzsp = new GraphZoomScrollPane(vv); add(gzsp);
final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); add(panel);
final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); content.add(panel); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); content.add(panel); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GraphZoomScrollPane gzsp = new GraphZoomScrollPane(vv); content.add(gzsp);
vv.getRenderContext().setArrowFillPaintFunction(n -> Color.lightGray); final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); add(panel);
final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); content.add(panel); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
private void createPanel() { final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); this.setLayout(new BorderLayout()); this.add(panel);
panel.add(new GraphZoomScrollPane(vv1)); panel.add(new GraphZoomScrollPane(vv2));
GraphZoomScrollPane scrollPane = new GraphZoomScrollPane(vv); jp.add(scrollPane); gm = new DefaultModalGraphMouse<>();
GraphZoomScrollPane scrollPane = new GraphZoomScrollPane(vv); jp.add(scrollPane); gm = new DefaultModalGraphMouse<Integer, Number>();