Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Update programmatically figure with EditPart
Update programmatically figure with EditPart [message #990822] Fri, 14 December 2012 11:00 Go to next message
excellion fdfds is currently offline excellion fdfdsFriend
Messages: 14
Registered: July 2012
Junior Member
Hello!
I have an rcp application, with gmf model.
So i have somes edit part who contains a model and a figure.

I want update bounds or routing points of a figure, programmatically with using directly the edit part (or the figure).
Directly make a figure.setPoints(pointList); not works (because not persisted in file).

To update a model, i create command with a transactionnal editing domain.

But for update figures, what is the procedure?

Thanks!
Re: Update programmatically figure with EditPart [message #990837 is a reply to message #990822] Fri, 14 December 2012 11:45 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

to make figures react on changes in your ecore model instanze you can do two things. You can use pins in graphical and gmfmap model which will have an OCL expression that is executed to determine whether the pin is executed. The second way is to override handleNotification in your editpart. If you want to persist your changes you should to these in the notation model. You can get the notation model element of a edit part by calling getNotationView on it. http://publib.boulder.ibm.com/infocenter/rsahelp/v7r0m0/topic/org.eclipse.gmf.doc/reference/api/runtime/org/eclipse/gmf/runtime/diagram/ui/editparts/IGraphicalEditPart.html#getNotationView()

Ralph
Re: Update programmatically figure with EditPart [message #1753366 is a reply to message #990837] Sat, 04 February 2017 21:45 Go to previous messageGo to next message
Yin Ya is currently offline Yin YaFriend
Messages: 3
Registered: January 2017
Junior Member
hello did u solve this problem?
i got now a similar problem like u.
i use a recordCommand to resize the figure position.
set bound, set locatioon, set point,translate with the figure
its work fine, but this cant save in the diagram.
when i close the editor and reopen it, the figure will back to their original position. Nothing is changed.
or wenn i drag another Figure, the changed Figure will also back to their original position?
can someone give some help to solve this ?
Re: Update programmatically figure with EditPart [message #1753367 is a reply to message #990837] Sat, 04 February 2017 21:46 Go to previous message
Yin Ya is currently offline Yin YaFriend
Messages: 3
Registered: January 2017
Junior Member
hello did u solve this problem?
i got now a similar problem like u.
i use a recordCommand to resize the figure position.
set bound, set locatioon, set point,translate with the figure
its work fine, but this cant save in the diagram.
when i close the editor and reopen it, the figure will back to their original position. Nothing is changed.
or wenn i drag another Figure, the changed Figure will also back to their original position?
can someone give some help to solve this ?
Previous Topic:Problem in generating Code
Next Topic:selecting one Node (along with inside edges) from CSSDiagramImpl file and saving it in a new file
Goto Forum:
  


Current Time: Thu Oct 03 17:21:09 GMT 2024

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

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

Back to the top