Sunday, October 18, 2015

j2og -- Java To OmniGraffle, Updated

Three years ago, I wrote a small plugin called "j2og" (for Java To OmniGraffle) which can create OmniGraffle drawings from your existing Java files. At that time, I used AppleScript to create the drawing. Unfortunately this mechanism was a little bit fragile, and somehow it didn't work with new versions of OmniGraffle / Mac OS X. Instead of fixing the AppleScript problem, I rewrote the export.

The new version now directly exports to OmniGraffle files. That means OmniGraffle is no longer needed to export your files to an OmniGraffle drawing. Actually, there are several tools which can open the exported drawings now:
  • OmniGraffle, of course; only available for Mac OS X
  • Diagrammix, via "Import"; only available for Mac OS X
  • Lucidchar, not tested yet; available for Mac OS X and Windows
The overall functionality was not changed. E.g., you can export classes and interfaces with or without attributes or operations, attributes can be transformed to associations, context of classes can be exported as well. The screenshot shows a sample drawing exported from the j2og sources. Since j2og does not layout the drawing (I was too lazy to write an layout algorithm), you have to manually layout the diagram. E.g., use the auto-layout of OmniGraffle as I did for the sample screenshot.



You can either install j2og from the Eclipse marketplace or the update site (see j2og homepage at github for details).

2 comments:

Torquil said...

Really keen to use this - as much to help me discipline my coding as anything else, but can you advise me - I have installed the plug in [version 0.4.1], but do not see the option to use it in the context menu of Eclipse Mars 2

[Version: Mars.2 Release (4.5.2) Build id: 20160218-0600]...

Also, in Eclipse preferences, the settings options gfor j2og is blank, but I can set some settings in eclipse installation details view.
Marketplace has it marked as installed.

Jens v.P. said...

I never experienced any such problems. Could you try to use the update site http://jevopi.de/updatesite/de.jevopi.j2og to install the tool directly?

Also, ensure that you have at least J2OG Base and one (or both) of J2OG JDT and J2OG EMF installed.

The context menu should be available (in case of JDT) on every package and java class in the "Package Explorer" or "Project Explorer" view.

If you have other problems, please create an issue at https://github.com/jpilgrim/eclipsetools/issues with a prefix "[j2og]".