How to generate diagrams from *.aird through code

104 Views Asked by At

I have drawn an image in the Obeo Designer. And I can export the image through right-click the image and click the "Export as a Diagram". Now I want to export the diagrams through java code instead of interacting with the Obeo Designer because my program will generate some .aird files during the runtime and I want to turn these .aird files into diagrams in the form of JPG or JPEG automatically. Is there any way to implement the idea?

1

There are 1 best solutions below

0
On

You could call:

org.eclipse.sirius.ui.business.api.dialect.DialectUIManager.INSTANCE.export(representation, 
session, filePath, exportFormat,progressMonitor);

where exportFormat can be for example:

ExportFormat exportFormat = new ExportFormat(ExportDocumentFormat.NONE, ImageFileFormat.PNG);