Connection between nodes created in the model, don't appear in the graphical editor [message #986916] |
Thu, 22 November 2012 11:11 |
Spiros S Messages: 7 Registered: November 2012 |
Junior Member |
|
|
Hello!
I have an issue when creating connection between some bordered nodes. These bordered nodes belong to elements that exist in different compartments.
The problem is that when I create my connection with the creation tool, it is visible and the model is updated with the new connection and its source and target properties.
But when if I close and reopen the diagram tab, then the connection is not visualized anymore although it is still in the model.
My connection has one atribute called ports with multiplicity of 2 that holds the source and target port.
I am trying to follow the path of the creation and refresh of the diagram to see what goes wrong but I have failed so far.
Any hints to where to look exactly?
I am also wondering if my meta-model makes things impossible by having source and target on the same attribute (ports[2]).
Thanks!
[Updated on: Sun, 25 November 2012 12:15] Report message to a moderator
|
|
|
|
|
Re: Connection between nodes in different compartments disappear [message #987263 is a reply to message #987014] |
Sun, 25 November 2012 11:19 |
Spiros S Messages: 7 Registered: November 2012 |
Junior Member |
|
|
Andreas Muelder wrote on Thu, 22 November 2012 16:19Hi!
Do you have canonical behavior in your diagram?
Then this may be an issue with your implementation of CanonicalConnectionEditPolicy.
If one CanonicalConnectionEditPolicy does not return the semantic connection in
getSemanticConnectionList() it may think that the edge in your notation model is orphaned and deletes it. For testing, you could override shouldDeleteView() returning false and check if the edge is still deleted.
Regards,
Andreas
I found what you said about the Canonical behaviour. My canvas element has a CanonicalEditPolicy.java file but the Link has an ItemSemanticPolicy.
Then I overridden the shouldDeleteView() in my canvas CanonicalEditPolicy to return always false and not what I create in the graphical editor stays remains there when I close and reopen it. But still, if I add a link in the model it does not get visualized in the graphical editor. And also when I delete from the model, the link stays in the graphical editor with an "X" circle on top of the link.
Then I followed the solution on this post :
http://www.eclipse.org/forums/index.php/t/204942/
and I replaced the superclass in every editpart canonical policy(not sure if needed everywhere or only in the canvas policy) from CanonicalEditPolicy to CanonicalConnectionEditPolicy and implemented the 3 needed methods(left empty as they are not called).
Now the behaviour is fine and when I delete from model they are deleted from graphical representation and vice versa.
The only problem left now is when I create in the model, they are not displayed in the graphical editor. I suppose it follows a different path.
Any ideas?
Thanks for the effort!
Spiros
[update]
I am debugging the CanonicalEditPolicy of my diagram and I see that even if I have connections in my model, the getHost().getChildren() method in the refreshOnActivate() never returns connection editparts but only node editparts. I tried to force it to return also connections so that I could activate them but I have not succeed.
[Updated on: Mon, 26 November 2012 10:23] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03291 seconds