I'm working with the Java eaapi.jar and use the convenience method below to perform an auto-layout and image export in one step:
/**
* @param diagramGUID
* @param imageExportFile
* @param l
*/
public static void layoutAndImageExport(String diagramGUID, String imageExportFile, EaDiagramLayout l) {
File imageExport = new File(imageExportFile);
Diagram diagram = getDiagram(diagramGUID);
if (!imageExport.getParentFile().exists())
imageExport.getParentFile().mkdirs();
try {
repository.GetProjectInterface().LayoutDiagramEx(diagramGUID, l.getLayoutStyle().getId(), l.getIterations(),
l.getLayerSpacing(), l.getColumnSpacing(), false);
repository.GetProjectInterface().PutDiagramImageToFile(diagramGUID, imageExport.getAbsolutePath(), 1);
if (logger.isDebugEnabled())
logger.debug("Exported '" + diagram.GetName() + "' to file " + imageExport + " [" + imageExport.length() + " Bytes]");
} catch (Exception e) {
logger.error("Error occured layouting/exporting diagram " + diagram.GetName() + ": "
+ repository.GetProjectInterface().GetLastError(), e);
}
}
In most cases this works absolutely well. But in some cases my Java application will freeze as an invisible modal popup dialog appears. You can get to the dialog using <Alt-Tab> and sometimes it reveals its content, which is always: A required resource was - Nothing more, just this text and an "Ok" button which I must activate to dismiss the dialog - and then my Java application resumes it's work - until the next diagram causes this dialog to pop up.
Has anyone of you ever experienced something like this? Can you tell me that this - obviously incomplete - error message is telling me?