Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Generate Diagram from Domain model file
Generate Diagram from Domain model file [message #1062338] Fri, 07 June 2013 09:31 Go to next message
Heeren Sharma is currently offline Heeren SharmaFriend
Messages: 7
Registered: May 2013
Junior Member
Hello,
I have separated the domain model data and diagram file data into two separate files. (as mentioned in FAQs). Lets say I have my model data in file extension .x (which is a a structured XML file)and my diagram data in .newdiagram file extensions. Now, I am able to generate every time the new diagram file and respective model file is also generated at the same time.
But, I am wondering is it possible that I open the model file i.e. anyname.x file and generate equivalent diagram file i.e anyname.newdiagram file?
Any suggestions in any direction will be helpful.
Thanks,
Heeren
Re: Generate Diagram from Domain model file [message #1062791 is a reply to message #1062338] Mon, 10 June 2013 18:21 Go to previous message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Hi,

You can register your diagram editor (as a non-default editor) for the
..x extension, and use the Open with-><your diagram editor> command for
opening it on a domain model data file. Then, in your persistency
behavior class you check if the editor input has the x extension, and in
that case create the diagram on the fly and pass is along. Here's a
sketch of the code:

public Diagram loadDiagram(URI uri) {
String fileExtension = uri.fileExtension();
if (fileExtension.equals("x")) {
uri = uri.trimFileExtension().appendFileExtension("newdiagram");
// a helper method that you must write,
// that typically is also part of a wizard
// it must create the diagram file that will be loaded
CreateActorDiagramWizard.createDiagramFile(uri, DIAGRAM_TYPE_ID);
}
return super.loadDiagram(uri);
}


On 07.06.13 02.31, Heeren Sharma wrote:
> Hello,
> I have separated the domain model data and diagram file data into two
> separate files. (as mentioned in FAQs). Lets say I have my model data in
> file extension .x (which is a a structured XML file)and my diagram data
> in .newdiagram file extensions. Now, I am able to generate every time
> the new diagram file and respective model file is also generated at the
> same time.
> But, I am wondering is it possible that I open the model file i.e.
> anyname.x file and generate equivalent diagram file i.e
> anyname.newdiagram file? Any suggestions in any direction will be helpful.
> Thanks,
> Heeren
Previous Topic:parent element and child element relationship in graphiti
Next Topic:Creating new diagram based on my project
Goto Forum:
  


Current Time: Thu Apr 25 17:51:45 GMT 2024

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

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

Back to the top