Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » problem with managing layout model
problem with managing layout model [message #84525] Sun, 10 December 2006 12:16 Go to next message
Wiktor is currently offline WiktorFriend
Messages: 55
Registered: July 2009
Member
I do not know how to properly manage my layout model.
In my emf tree i can add elements and they correctly appear on diagram.

In order to delete layout model when I delete model I changed method:

protected boolean shouldDeleteView(View view) {
//return view.isSetElement() ; && view.getElement() != null && //
view.getElement().eIsProxy();
if (view.isSetElement()) {
return view.getElement() != null ?
view.getElement().eIsProxy() || view.getElement().eContainer() ==
null : true;
}
return false;
}

And now delete from emf tree works.
But when I move a subelement(for example: ship small item) from one ship
to another, on emf tree the item is moved, but on diagram it is
duplicated. If next step will be the 'undo in emf tree' both models are
changed correctly (on diagram I have again one small item) !!!

Because in my emf tree i can also see my layout model, so I noticed,
that in the operations i described above thet Node elements in
taipan_diagram file are not alwys updated after my operation on taipan
model.

I suppose that probably I should notify some listeners - but which one,
and where I can find it?


many thanx for help
Wiktor
Re: problem with managing layout model [message #84544 is a reply to message #84525] Sun, 10 December 2006 22:21 Go to previous messageGo to next message
Wiktor is currently offline WiktorFriend
Messages: 55
Registered: July 2009
Member
I solved my problem with moving elements in emf tree.

I changed this method in ShipLargeCargoCanonicalEditPolicy and
ShipSmallCargoCanonicalEditPolicy

/**
* @generated NOT
*/
protected boolean shouldDeleteView(View view) {
boolean result = view.isSetElement() && view.getElement() != null
&& view.getElement().eIsProxy();
result |= getHost().getModel() != view;
return result = true;
}

Now it works.

I am only interested, why when I was moving elements on diagram the old
view was removed automatically (or maybe it was moved to another parent
and there was no create&remove operation?) and while moving using emf -
I had to do it by hand?

Maybe this method is not the best place to solve such a problem?
Re: problem with managing layout model [message #84558 is a reply to message #84544] Mon, 11 December 2006 10:14 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Wiktor,

Looks like the proble you found was reported in: https://bugs.eclipse.org/bugs/show_bug.cgi?id=157148,
so you've correted right place in the code.

-----------------
Alex Shatalin
Previous Topic:How can I generate children for a node?
Next Topic:Custom Decoration code generation
Goto Forum:
  


Current Time: Tue Jul 16 17:58:08 GMT 2024

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

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

Back to the top