/** * */ public static BufferedImage createBufferedImage(mxGraph graph, Object[] cells, double scale, Color background, boolean antiAlias, mxRectangle clip) { return createBufferedImage(graph, cells, scale, background, antiAlias, clip, new mxGraphics2DCanvas()); }
/** * */ public static Document createVmlDocument(mxGraph graph, Object[] cells, double scale, Color background, mxRectangle clip) { mxVmlCanvas canvas = (mxVmlCanvas) drawCells(graph, cells, scale, clip, new CanvasFactory() { public mxICanvas createCanvas(int width, int height) { return new mxVmlCanvas(mxDomUtils.createVmlDocument()); } }); return canvas.getDocument(); }
mxSvgCanvas canvas = (mxSvgCanvas) mxCellRenderer.drawCells(graph, null, 1, null, new CanvasFactory() { @Override public mxICanvas createCanvas(int width, int height) { mxUtils.writeFile(mxXmlUtils.getXml(mxCellRenderer.createVmlDocument(graph, null, 1, null, null).getDocumentElement()), filename); mxUtils.writeFile(mxXmlUtils.getXml(mxCellRenderer.createHtmlDocument(graph, null, 1, null, null).getDocumentElement()), filename); saveXmlPng(trackScheme.getGUI(), filename, bg); } else { BufferedImage image = mxCellRenderer.createBufferedImage(graph, null, 1, bg, graphComponent.isAntiAlias(), null, graphComponent.getCanvas());
@Override public void windowClosing(final WindowEvent e) { final Document doc = mxCellRenderer.createSvgDocument(KaxVizFrame.this.graph, null, 1d, Color.WHITE, KaxVizFrame.this.graph.getGraphBounds()); try { mxUtils.writeFile(mxXmlUtils.getXml(doc), outFilename); } catch (final IOException ex) { LOGGER.error("Failed to save Visualization of kax-File.", ex); } } });
mxSvgCanvas canvas = (mxSvgCanvas) mxCellRenderer.drawCells(graph, null, 1, null, new CanvasFactory() { @Override public mxICanvas createCanvas(int width, int height) { mxUtils.writeFile(mxXmlUtils.getXml(mxCellRenderer.createVmlDocument(graph, null, 1, null, null).getDocumentElement()), filename); mxUtils.writeFile(mxXmlUtils.getXml(mxCellRenderer.createHtmlDocument(graph, null, 1, null, null).getDocumentElement()), filename); saveXmlPng(trackScheme.getGUI(), filename, bg); } else { BufferedImage image = mxCellRenderer.createBufferedImage(graph, null, 1, bg, graphComponent.isAntiAlias(), null, graphComponent.getCanvas());
@Override public void windowClosing(final WindowEvent e) { final Document doc = mxCellRenderer.createSvgDocument(KaxVizFrame.this.graph, null, 1d, Color.WHITE, KaxVizFrame.this.graph.getGraphBounds()); try { mxUtils.writeFile(mxXmlUtils.getXml(doc), outFilename); } catch (final IOException ex) { LOG.error("Failed to save Visualization of kax-File.", ex); } } });
@Override public void generatePng(@Nonnull FlowDefinition<?> definition, @Nullable ExecutionHistoryForRendering history, @Nonnull OutputStream out) throws IOException { mxGraph graph = renderGraph(definition); RenderedImage img = mxCellRenderer.createBufferedImage(graph, null, 1, Color.WHITE, false, null); ImageIO.write(img, "png", out); }
/** * */ public static Document createVmlDocument(mxGraph graph, Object[] cells, double scale, Color background, mxRectangle clip) { mxVmlCanvas canvas = (mxVmlCanvas) drawCells(graph, cells, scale, clip, new CanvasFactory() { public mxICanvas createCanvas(int width, int height) { return new mxVmlCanvas(mxDomUtils.createVmlDocument()); } }); return canvas.getDocument(); }
private static byte[] renderGraphImpl(ProcessDefinition<?> definicao) { final mxGraph graph = renderGraph(definicao); final RenderedImage img = mxCellRenderer.createBufferedImage(graph, null, 1, Color.WHITE, false, null); final ByteArrayOutputStream out = new ByteArrayOutputStream(); try { ImageIO.write(img, "png", out); } catch (final IOException e) { throw Throwables.propagate(e); } return out.toByteArray(); }
/** * */ public static Document createHtmlDocument(mxGraph graph, Object[] cells, double scale, Color background, mxRectangle clip) { mxHtmlCanvas canvas = (mxHtmlCanvas) drawCells(graph, cells, scale, clip, new CanvasFactory() { public mxICanvas createCanvas(int width, int height) { return new mxHtmlCanvas(mxDomUtils.createHtmlDocument()); } }); return canvas.getDocument(); }
/** * */ public static BufferedImage createBufferedImage(mxGraph graph, Object[] cells, double scale, Color background, boolean antiAlias, mxRectangle clip) { return createBufferedImage(graph, cells, scale, background, antiAlias, clip, new mxGraphics2DCanvas()); }
/** * */ public static Document createHtmlDocument(mxGraph graph, Object[] cells, double scale, Color background, mxRectangle clip) { mxHtmlCanvas canvas = (mxHtmlCanvas) drawCells(graph, cells, scale, clip, new CanvasFactory() { public mxICanvas createCanvas(int width, int height) { return new mxHtmlCanvas(mxDomUtils.createHtmlDocument()); } }); return canvas.getDocument(); }
@Override public void generatePng(@Nonnull FlowDefinition<?> definition, @Nullable ExecutionHistoryForRendering history, @Nonnull OutputStream out) throws IOException { mxGraph graph = renderGraph(definition); RenderedImage img = mxCellRenderer.createBufferedImage(graph, null, 1, Color.WHITE, false, null); ImageIO.write(img, "png", out); }
/** * */ public static Document createSvgDocument(mxGraph graph, Object[] cells, double scale, Color background, mxRectangle clip) { mxSvgCanvas canvas = (mxSvgCanvas) drawCells(graph, cells, scale, clip, new CanvasFactory() { public mxICanvas createCanvas(int width, int height) { return new mxSvgCanvas(mxDomUtils.createSvgDocument(width, height)); } }); return canvas.getDocument(); }
@Override public void generatePng(@Nonnull FlowDefinition<?> definition, @Nullable ExecutionHistoryForRendering history, @Nonnull OutputStream out) throws IOException { mxGraph graph = renderGraph(definition); RenderedImage img = mxCellRenderer.createBufferedImage(graph, null, 1, Color.WHITE, false, null); ImageIO.write(img, "png", out); }
/** * */ public static Document createSvgDocument(mxGraph graph, Object[] cells, double scale, Color background, mxRectangle clip) { mxSvgCanvas canvas = (mxSvgCanvas) drawCells(graph, cells, scale, clip, new CanvasFactory() { public mxICanvas createCanvas(int width, int height) { return new mxSvgCanvas(mxDomUtils.createSvgDocument(width, height)); } }); return canvas.getDocument(); }
private FileEntry createScreenshotEntry(File imageFile, mxGraph graph, ReporterConfiguration reporterConfiguration) throws IOException { final BufferedImage bufferedImage = mxCellRenderer.createBufferedImage(graph, null, 1, Color.WHITE, true, null); ImageIO.write(bufferedImage, "PNG", imageFile); final Path rootDir = Paths.get(reporterConfiguration.getRootDirectory()); final Path relativize = rootDir.relativize(imageFile.toPath()); return new FileEntry(relativize); }
/** * */ public static BufferedImage createBufferedImage(mxGraph graph, Object[] cells, double scale, final Color background, final boolean antiAlias, mxRectangle clip, final mxGraphics2DCanvas graphicsCanvas) { mxImageCanvas canvas = (mxImageCanvas) drawCells(graph, cells, scale, clip, new CanvasFactory() { public mxICanvas createCanvas(int width, int height) { return new mxImageCanvas(graphicsCanvas, width, height, background, antiAlias); } }); return (canvas != null) ? canvas.destroy() : null; }
@Override public BufferedImage generateBufferedImage() { mxGraph graph = getGraph(); return mxCellRenderer.createBufferedImage(graph, null, 1, Color.WHITE, true, null, createGraphComponent(graph).getCanvas()); }
/** * */ public static BufferedImage createBufferedImage(mxGraph graph, Object[] cells, double scale, final Color background, final boolean antiAlias, mxRectangle clip, final mxGraphics2DCanvas graphicsCanvas) { mxImageCanvas canvas = (mxImageCanvas) drawCells(graph, cells, scale, clip, new CanvasFactory() { public mxICanvas createCanvas(int width, int height) { return new mxImageCanvas(graphicsCanvas, width, height, background, antiAlias); } }); return (canvas != null) ? canvas.destroy() : null; }