Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » refreshing/repainting figures in a diagram
refreshing/repainting figures in a diagram [message #822232] Fri, 16 March 2012 10:35 Go to next message
Chris B. is currently offline Chris B.Friend
Messages: 37
Registered: November 2011
Member
Hello everyone,

i have a wrapping label in a compartment and i want to associate it with a model property. I solved this by subclassing the GraphicalEditPolicy, which sends a GEF command that sets the new value manually after selecting it from the property sheet. This works fine but the new value isn't visible before performing an action on the figure, like dragging or collapsing it. My question is how can i convince GMF to refresh the figure (the editpart which contains the label) or also the whole diagram.

regards
bj

[Updated on: Fri, 16 March 2012 10:50]

Report message to a moderator

Re: refreshing/repainting figures in a diagram [message #822254 is a reply to message #822232] Fri, 16 March 2012 11:15 Go to previous messageGo to next message
Andreas Muelder is currently offline Andreas MuelderFriend
Messages: 73
Registered: July 2011
Member
Hi,

you can override the notifyChanged in your EditPart like this:
@Override
public void notifyChanged(Notification notification) {
   super.notifyChanged(notification);
   if (notification.getFeature() == MyPackage.Literals.MY_TEXT_FEATURE) {
       // Update the label text
	getLabel().setText(resolveSemanticElement().getText());
   }
}


Regards,
Andreas


Re: refreshing/repainting figures in a diagram [message #822312 is a reply to message #822254] Fri, 16 March 2012 13:05 Go to previous message
Chris B. is currently offline Chris B.Friend
Messages: 37
Registered: November 2011
Member
Perfect! Thank you very much Andreas!! Razz

regards
bj
Previous Topic:Creating a workflow automatically
Next Topic:Restricting attribute value choice
Goto Forum:
  


Current Time: Tue Apr 16 08:00:22 GMT 2024

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

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

Back to the top