Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Render in-memory GMF Diagram on a SWT Composite/Canvas
Render in-memory GMF Diagram on a SWT Composite/Canvas [message #697037] Fri, 15 July 2011 07:26 Go to next message
Eclipse UserFriend
I would like to render a GMF diagram on a SWT Composite at run time, i.e. the diagram is read from a file/db/... and needs to be visualized.
Moreover, I need to be able to change the figure properties (e.g. background color) programmatically once it has been rendered.

It is a BPMN diagram from the BPMN project which has an gmf editor, but I do not need the editing functionality at run time.
I am not familiar with gmf, just a basic understanding of it: Is rendering a gmf diagram decoupled from its editor possible? Any examples?

I could figure out how the Export to Image operations work, but I need to be able to select single figures of the diagram once it has been rendered...

[Updated on: Fri, 15 July 2011 07:30] by Moderator

Re: Render in-memory GMF Diagram on a SWT Composite/Canvas [message #697064 is a reply to message #697037] Fri, 15 July 2011 08:58 Go to previous message
Eclipse UserFriend
When using the method org.eclipse.gmf.runtime.diagram.ui.render.util.DiagramRenderUtil.renderToSWTImage(Diagram) to generate an SWT image, I get the following Exception:


Caused by: java.lang.NullPointerException
at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker.initializeDiagramEventBroker(DiagramEventBroker.java:243)
at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker.startListening(DiagramEventBroker.java:230)
at org.eclipse.gmf.runtime.diagram.ui.OffscreenEditPartFactory.createDiagramEditPart(OffscreenEditPartFactory.java:126)
at org.eclipse.gmf.runtime.diagram.ui.OffscreenEditPartFactory.createDiagramEditPart(OffscreenEditPartFactory.java:77)
at org.eclipse.gmf.runtime.diagram.ui.render.util.DiagramRenderUtil.renderToSWTImage(DiagramRenderUtil.java:79)
at aero.pag.praesto.workflows.WorkflowDiagramRenderer.renderWorkflow(WorkflowDiagramRenderer.java:94)
Previous Topic:is there any video tutorial on how to model with GMF?
Next Topic:How can I create the connection line like in the figure
Goto Forum:
  


Current Time: Sat Jul 12 22:33:39 EDT 2025

Powered by FUDForum. Page generated in 0.04210 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top