Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 11:26 Go to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 853
Registered: July 2009
Senior Member
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 11:30]

Report message to a moderator

Re: Render in-memory GMF Diagram on a SWT Composite/Canvas [message #697064 is a reply to message #697037] Fri, 15 July 2011 12:58 Go to previous message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 853
Registered: July 2009
Senior Member
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: Thu Feb 25 20:09:15 GMT 2021

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

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

Back to the top