1. Bertrand Goetzmann
  2. PlantUMLFX

Wiki

Clone wiki

PlantUMLFX / Home

PlantUMLFX screenshot

About PlantUMLFX

PlantUMLFX is a JavaFX 2 application implemented with a single GroovyFX script, PlantUMLFX.groovy, that allows you to generate UML diagrams with the help of PlantUML.

The PlantUMLFX is compound of two panes: the left one allows you to type UML diagram text based on PlantUML's text language, and the right one will show the result in the form of an image, when you ask the generation (through the menu or the CTRL+G shortcut).

Keep in mind that you don't have to type the enclosing @startuml and @enduml keywords.

At any time, you can save the UML diagram image in .PNG format.

Running PlantUMLFX

In order to run PlantUMLFX you obviously need Groovy and also Graphviz software which is used by PlantUML for all diagrams except sequence diagrams.

GroovyFX and PlantUML are included automatically by the script, thanks to Groovy's Grab annotation, a part of the Grape system.

To execute PlantUMLFX, make sure that an explicit reference to your jfxrt.jar is declared in your classpath (even if you use Java 7, which includes JavaFX 2), e.g. like so:

groovy -cp $JAVA_HOME/jre/lib/jfxrt.jar PlantUMLFX.groovy

On Windows platform, change $JAVA_HOME by %JAVA_HOME%.

Notes

  • JavaFX Scene Builder was used to produce the UI, so the resulting FXML code was included in the ui variable.
  • The script shows how, using fx:ids, GroovyFX allows you to get references on JavaFX UI components.
  • There is also an example of using JavaFX Task and Node's snapshot method to capture image diagram.
  • And last, this script is not perfect! Don't hesitate to fork this project.

Updated