Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF diagram elements movement should affect underlying EMF model
GMF diagram elements movement should affect underlying EMF model [message #494119] Thu, 29 October 2009 09:27 Go to next message
Timothy Tune is currently offline Timothy TuneFriend
Messages: 3
Registered: July 2009
Junior Member
Hi,

I implemented a grid layout for the compartment contents; the behaviour
is as expected, I can drag&drop the nodes within a comparment, and can
reorder them in this way.

Of course, the order within the list of the visual IFigures is not
synchronized with the underlying model; what is a suitable practice to
achieve a reordering on EMF level?

(I want the .model-file to reflect the order that I dragged within the
diagram - so reordering needs to be on model-layer, too)

Do i have to create a specific command for this?

Thanks,
Timothy
Re: GMF diagram elements movement should affect underlying EMF model [message #494120 is a reply to message #494119] Thu, 29 October 2009 09:28 Go to previous messageGo to next message
Timothy Tune is currently offline Timothy TuneFriend
Messages: 3
Registered: July 2009
Junior Member
This is all related to containments, not compartments, sorry for the typo.


> Hi,
>
> I implemented a grid layout for the compartment contents; the behaviour
> is as expected, I can drag&drop the nodes within a comparment, and can
> reorder them in this way.
>
> Of course, the order within the list of the visual IFigures is not
> synchronized with the underlying model; what is a suitable practice to
> achieve a reordering on EMF level?
>
> (I want the .model-file to reflect the order that I dragged within the
> diagram - so reordering needs to be on model-layer, too)
>
> Do i have to create a specific command for this?
>
> Thanks,
> Timothy
>
Re: GMF diagram elements movement should affect underlying EMF model [message #495300 is a reply to message #494119] Wed, 04 November 2009 14:20 Go to previous message
Alex Shatalin is currently offline Alex ShatalinFriend
Messages: 141
Registered: July 2009
Senior Member
Hello Timothy,

To store some specific layout constraints in EMF you can either create own
subclass of org.eclipse.gmf.runtime.notation.LayoutConstraint (in separate
..ecore model + generate plugin for it) or store this info directly in underlying
domain model properties. In addition you have to modify ???EditPart.refreshChildren()
method to properly handle these constraints..

Another option is to rely on an actual sequence of model children in correspondign
containment feature. Looks like this code is already present in default ???EditPart.refreshChildren()
implementation.

-----------------
Alex Shatalin
Previous Topic:Can't find genClass for class 'InputAssociation' in package cakefeed
Next Topic:Synchronize edit part with domain model
Goto Forum:
  


Current Time: Fri Apr 26 20:41:57 GMT 2024

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

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

Back to the top