Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Redraw connections after modification
Redraw connections after modification [message #665117] Wed, 13 April 2011 06:51 Go to next message
Luca Gherardi is currently offline Luca Gherardi
Messages: 59
Registered: November 2010
Member
I have a problem with my editor.

I have two class A and B.
A contains one or more instances of B.

The connection between an element A and an element B is represented by using two different figures, according to a property of B. If this property value is true the editor uses a figure X otherwise it uses a figure Y.

Now the problem is that if I change the value of this property, the connection is redrawn only when I press F5.

I'd like that it to happen automatically.

I ovverided the handleNotificationEvent method of the BEditPart class and I tried to call the refreshChild method. I also tried to get the target connections and call the refresh on those objects but it doesn't work.

Does anyone can help me please?

Thanks,
Luca
Re: Redraw connections after modification [message #665297 is a reply to message #665117] Thu, 14 April 2011 04:19 Go to previous message
emil salageanu is currently offline emil salageanu
Messages: 94
Registered: June 2010
Location: Nice, France
Member
Try to refresh the entire diagram, like this:

EditPart mainEditPart = (EditPart)(anyOfMyEditParts.getRoot().getChildren().get(0));
CanonicalEditPolicy cep = (CanonicalEditPolicy)mainEditPart.getEditPolicy(EditPolicyRoles.CANONICAL_ROLE);
if (cep!=null)
cep.refresh();



Previous Topic:Java Heap Space error during code generation
Next Topic:Create NODE and EDGE togther
Goto Forum:
  


Current Time: Sun Apr 20 19:36:43 EDT 2014

Powered by FUDForum. Page generated in 0.01979 seconds