Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Actions for UI-commands
Actions for UI-commands [message #234713] Thu, 25 June 2009 19:05 Go to next message
Tobias Neef is currently offline Tobias NeefFriend
Messages: 17
Registered: July 2009
Junior Member
Hello,

I added some buttons to the figures I am using in our diagrams in order to
do some layout related stuff. I am currently doing this directly using the
setLayoutConstraint of the editparts. The problem with that is, that I can
not undo the operations I do on the surface. Also the models is not dirty
after I executed that action. Probably there are also other things I
haven't discovered jet.

The question now what is the best way to integrate this stuff in the
GMF-Command model?

Best Regards,
Tobias
Re: Actions for UI-commands [message #234754 is a reply to message #234713] Fri, 26 June 2009 11:49 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Tobias,

You have to modify corresponding layout constraints using Notation model
API (org.eclipse.gmf.runtime.notation.Node.getLayoutConstraint() )

-----------------
Alex Shatalin
Re: Actions for UI-commands [message #234930 is a reply to message #234754] Tue, 30 June 2009 19:50 Go to previous messageGo to next message
Tobias Neef is currently offline Tobias NeefFriend
Messages: 17
Registered: July 2009
Junior Member
Hello Alex,

thanks for your help so far. I implemented a solution where the notational
layout information is set and also the layout hint of the parent layout
manager in order to have a direct refresh on the diagram. The logic of
both is quite similar therefore I wonder if there isn't a unified way in
which GMF supports me on those kind of tasks? Additionally the undo
operations do not work.

Regards,
Tobias
Re: Actions for UI-commands [message #234947 is a reply to message #234930] Wed, 01 July 2009 10:45 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Tobias,

It should be enough to modify notation model layout information - visual
model should be updated by GMF in accordance.
Concerning undo - if you need it working you have to create new AbstractEMFOperation
and execute is in an OperationHistory (you can get it from OperationHistoryFactory).

-----------------
Alex Shatalin
Re: Actions for UI-commands [message #235011 is a reply to message #234947] Wed, 01 July 2009 19:13 Go to previous message
Tobias Neef is currently offline Tobias NeefFriend
Messages: 17
Registered: July 2009
Junior Member
Hello,

this already looks better. The model is dirty when I execute the stuff the
only disadvantage is, that changing the position in the view does not seem
to work alone I have to change the layout information in the EP or refresh
the diagram manually by calling the edit parts refresh method.

Anyway I appreciate you help so far!
Previous Topic:Add child element to compartment on creation
Next Topic:Find/Replace in a Diagram solutions
Goto Forum:
  


Current Time: Sun Mar 07 19:07:47 GMT 2021

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

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

Back to the top