imageFile.deleteOnExit();
return imageRepresentation;
}
private File exportToImage(Diagram diagram, ImageFileFormat imageFileFormat) {
DiagramEditPart diagramEditPart = OffscreenEditPartFactory
.getInstance().createDiagramEditPart(diagram, new Shell());
File destinationFile = ImageRepresentation
.allocateTempImage(imageFileFormat.toString());
IPath destination = new Path(destinationFile.getAbsolutePath());