|Re: Print to PDF - Edge connects multiple nodes [message #1767024 is a reply to message #1766976]
||Thu, 29 June 2017 15:20
|| Matthias Wienand
Registered: March 2015
Hi Du Vu,|
1. Not out-of-the-box, but you can simulate such an edge either via way points (located at the intermediary station), or via two edges. Moreover, Zest (as a grey box framework) can be customized, i.e. you can extend EdgePart to fit your needs (e.g. evaluate a custom attribute holding intermediary nodes), or extend GraphPart to fix the Z-order, so that edges with intermediary stations are drawn above these stations.
2. Not out-of-the-box, but from the top of my head, I can think of three solutions:
a) JavaFX offers a PrinterJob  that can be used to print a JavaFX Node. You need to configure it correctly for printing to PDF, though. The appearance within the PDF will match the drawing on the display.
b) You can convert the JavaFX image to an AWT BufferedImage and print it using the Java AWT Printing API .
c) When Graphviz is available you can delegate to Graphviz for PDF generation. You have to convert the Zest-attributed graph to a Dot-attributed graph (possibly using Zest2DotAttributesConverter, although it is not API), serialize the graph using DotExport#exportDot(Graph), and use Graphviz to generate the PDF. For a code example, you can take a look at DotExecutableUtilsTests#testImageExport(String), which produces a PDF from a Dot input file. Unfortunately, the appearance (colors, thicknesses, etc.) will not be preserved.
PS: I am checking for questions tagged "eclipse-gef" on SO from time to time, but not on a daily basis. OTOH, many people involved are active in this forum, so you have higher chances of getting responses here.
Powered by FUDForum
. Page generated in 0.01934 seconds