Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Additional diagram initialization (with OpenDiagramPolicy)
Additional diagram initialization (with OpenDiagramPolicy) [message #228829] Tue, 05 May 2009 09:10 Go to next message
TL is currently offline TLFriend
Messages: 22
Registered: July 2009
Junior Member
Hello,

We are trying to develop an editor for models, which look like this one:
http://www.shrani.si/f/2x/HE/2fGA1g80/procgraph-model.png

There are 3 different views (diagram types), which represent parts of
the information contained in the whole model. Some of the views
represent the same information. The views were realized through diagram
partitioning. The current challenge is how to initialize the 3rd view
with the information (states and transitions), which was added to the
2nd view and (eventually also how to synchronize these two views). To
accomplish this task I have currently 2 main problems:

1. How to initialize (draw the states and the transitions of two 2nd
views) 3dr view, when create the 3rd view through an
OpenDiagramBehaviour? I have tried to do this in the
OpenDiagramEditPolicy#intializeNewDiagram()method, with the approach
which was suggested in some of the other posts. Is this the right place
to do it? The approaches suggested in the past mailing list posts seemed
complicated and unfortunately did not work, because I ran into this problem:
- I can't get the EditPart form the Diagram (View) object. How could
I get the EditPart of the diagram?

2. How can I get the Node EditParts (source and target), form the Edge
EditPart, which connects two Nodes? I haven't figured this out.
Semantically the Edge is represented with an EObject called
Relationship, which is has two connections (sourceNode and targetNode)
to a Node EObject.

Could someone help me to answer this questions?
Thank you.
Re: Additional diagram initialization (with OpenDiagramPolicy) [message #229415 is a reply to message #228829] Mon, 11 May 2009 15:45 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello T,

> which was suggested in some of the other posts. Is this the right
> place to do it?
It's ok to perform diagram initialization there, nevertheless if you are
generating synchronized diagram for 3-rd view then diagram content should
be automatically created by diagram updater on diagram openning.

> - I can't get the EditPart form the Diagram (View) object. How
> could I get the EditPart of the diagram?
EditParts will be created for each notation model element on diagram editor
openning, so if you are trying to access EditParts then the editor was not
open yet then it is not possible. BTW, why do you need EditParts? You can
modify notation model instead.
> 2. How can I get the Node EditParts (source and target), form the Edge
> EditPart, which connects two Nodes? I haven't figured this out.
See ConnectionEditPart.getSource()/getTarget().

-----------------
Alex Shatalin
Previous Topic:sharing a third-party editingDomain
Next Topic:how to reposition a figure
Goto Forum:
  


Current Time: Sun Nov 19 21:51:34 GMT 2017

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

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