To prevent spam users, you can only post on this forum after registration, which is by invitation. If you want to post on the forum, please send me a mail (h DOT m DOT w DOT verbeek AT tue DOT nl) and I'll send you an invitation in return for an account.

ProM Command Line Interface CLI : export JComponent to PDF or Image (PNG/JPEG)

Hello

We are using the ProM command line interface (CLI) to execute batch tasks. We have set it up on a Linux Server. We see that a number of the APIs return a JComponent, for example, _1_log_summary(XLog, XLogInfo) -> JComponent.

We want to know if this JComponent can be exported to a PDF or an image (JPG/PNG). Basically we want the information that is shown on the screen to be obtained without actually displaying it on the screen as ProM is running on a server without a windowing environment.

We tried checking if a JComponent object can be serialized etc but these do not help. Also, most of the
returned JComponents are added to a JPanel and displayed and here there is an "export ..." button in the rendered GUI,
is it possible to access this export functionality directly without rendering the JComponent on the screen?

There are certain export* methods, but not for all. For instance, in the above example, _1_log_summary, there is no "export summary to pdf"  or "export bpmn diagram to pdf" and so on.

Thanks.


Comments

  • Hi,

    I have implemented such functionality in the Inductive visual Miner as follows:
    - create a BufferedImage
    - get a Graphics2D object from it using img.createGraphics()
    - give this Graphics2D object to your JComponent: component.paint(graphics2d)

    That's the basic idea. Hope it helps ;)

    Sander

    Ps. example code can be found in org.processmining.plugins.inductiveVisualMiner.export.ExportAnimation

    Lecturer at Queensland University of Technology
Sign In or Register to comment.