Skip to main content

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 10:51 Go to next message
Luca Gherardi is currently offline Luca GherardiFriend
Messages: 62
Registered: November 2010
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?

Re: Redraw connections after modification [message #665297 is a reply to message #665117] Thu, 14 April 2011 08:19 Go to previous message
emil salageanu is currently offline emil salageanuFriend
Messages: 94
Registered: June 2010
Location: Nice, France
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)

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

Current Time: Tue Mar 09 05:22:08 GMT 2021

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

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

Back to the top