|Re: Connection between nodes in different compartments disappear [message #987263 is a reply to message #987014]
||Sun, 25 November 2012 11:19
| Spiros S
Registered: November 2012
Andreas Muelder wrote on Thu, 22 November 2012 16:19|
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.
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 :
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.
Thanks for the effort!
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.02259 seconds