|
|
Re: EOpposite in diagram editor [message #1023901 is a reply to message #1022378] |
Mon, 25 March 2013 08:31   |
Eclipse User |
|
|
|
Hi Thomas,
What i want to achieve is a link that goes both ways
1) so i can connect Goal-Object but also Object-Goal
2) the recursive relation is automatically mapped, so if I connect Goal A-Object A,
the opposite relation is also mapped, so i can't create an additional link
Object A - Goal A.
With this EOpposite relation as you can see below how i mapped that in ecore, that aspect works. I create a single graphical def, and have two link mappings so i can make the link starting from either type of node.

If i only have one relation on the domain level e.g. from goal-object, i won't be able to draw links from object-goal in the editor right?
So it does everything i want now but displays the recursive relation in an unwanted way when i add a new node (as seen in first post). Because I'm an Eclipse beginner, i also don't know how to find the problem in the DiagramEditPart or other code..
Any help would be immensely appreciated
Attachment: Knipsel.PNG
(Size: 8.45KB, Downloaded 667 times)
|
|
|
|
|
Re: EOpposite in diagram editor [message #1036463 is a reply to message #1027116] |
Mon, 08 April 2013 08:25   |
Eclipse User |
|
|
|
Hi,
i think the discussion is more or less a graph theory one.
GMF's notational model semantically (and syntactically) only understands directed graphs, which explicitely require a source and a target.
In my eyes, this only makes sense. Take a look at an UML-Class diagram. It really does matter, from what class you are drawing a composition-relation.
Just an idea:
In order to better support the user, you could raise the abstraction of your elements (Goal and Object) to a common super-class/interface IConcern.
Give the IConcern the relations concern1 and concern2 reference to itself.
In your mapping model, add ocl-contraints to the linkmappings, that prevent the source from being the target at the same time.
This would take care of enabling the user to draw the relation from either Goal or Object to the counter part.
Once a user creates a relation, you would have to complete concern1 or concern2 programmatically (the eopposite-approach) and take care of the canonical behavior for the Relation, you do not want to be displayed.
Tweaky, but could be worth a try.
If you feel, GMF is lacking this kind of feature, you are always free to file feature requests and push discussions or even provide improvements.
Regards
Thomas
|
|
|
Re: EOpposite in diagram editor [message #1036491 is a reply to message #1036463] |
Mon, 08 April 2013 08:53  |
Eclipse User |
|
|
|
Hi Thomas, thanks for the feedback
the topic is actually more related to http://www.eclipse.org/forums/index.php/t/470258/
where I want eclipse to realize it really is one recursive relation, and where it doesn't matter which node is source/target. Don't you agree Eclipse should support such a feature?
I currently limited my editor using OCL so it's not possible anymore to make 2 recursive relations between two nodes. To solve the graphical problem of the two links i deleted the connections refresh semantics in the canonical policy. currently all is working fine, i just hope this won't cause any problems.
|
|
|
Powered by
FUDForum. Page generated in 0.12687 seconds