Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » How to replace currently displayed diagram with another diagram
How to replace currently displayed diagram with another diagram [message #1718294] Tue, 22 December 2015 08:31 Go to next message
Lars Heinemann is currently offline Lars HeinemannFriend
Messages: 8
Registered: July 2015
Location: Germany
Junior Member

Hi,

I wrote my own multipage editor which lets users choose between a source view and a design view. The design view shows the diagram and the source view displays the XML source of the model.

When I change my source I want to update the diagram with all the changes from the source editor. What would be the best / cleanest way to do it? Is it possible to hot swap diagram objects in the diagram editor somehow? (not sure if that matters, but I am not using EMF but a pojo model)

Thanks for any pointers,
Lars

[Updated on: Tue, 22 December 2015 08:33]

Report message to a moderator

Re: How to replace currently displayed diagram with another diagram [message #1718342 is a reply to message #1718294] Tue, 22 December 2015 16:20 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1894
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Lars,

you can call the method refresh on the DiagramBehavior instance of your diagram editor, that will update the complete diagram. However, depending on what happened in the text file, this might lead to exceptions because the source might not be in a consistant state.

Michael
Re: How to replace currently displayed diagram with another diagram [message #1718374 is a reply to message #1718342] Wed, 23 December 2015 07:12 Go to previous messageGo to next message
Lars Heinemann is currently offline Lars HeinemannFriend
Messages: 8
Registered: July 2015
Location: Germany
Junior Member

Hi Michael,

that only works if all your changes are directly propagated into the text file, right? (means saved before creating the diagram)
In my case I do the changes in the source editor and those are not yet saved when loading it into the diagram. (kind of a round trip editor)

Lars
Re: How to replace currently displayed diagram with another diagram [message #1718601 is a reply to message #1718374] Mon, 28 December 2015 08:20 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1894
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Lars,

not necessarily. All it requires is an up-to-date Graohiti diagram model. The content of that model will appear in the editor.

Michael
Previous Topic:Confused about GEF, GMF and Graphiti
Next Topic:Can't correctly position anchor on the border of the shape
Goto Forum:
  


Current Time: Mon Jul 16 02:51:53 GMT 2018

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

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

Back to the top