[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: problem with update of layout model when changing the semantic model

Hi Alex,

"Alex Shatalin" <vano@xxxxxxxxxxx> schrieb im Newsbeitrag 
news:cd695fb3115388c89efc73d8b10d@xxxxxxxxxxxxxxxxxxx
> Hello Andre,
>
>> "view.getElement().eIsProxy()" returns false and so the layout of the
>> diagram is incorrect.
>  This method works correctly if you reopen the diagram. The problem is: if 
> you remove element from the model it remains in memory, so corresponding 
> view will hold non-null reference to this element and this condition will 
> not trigger delete view process. You can try modifying corresponding 
> method implementation. For example:
>
> view.isSetElement() && view.getElement() != null && 
> (view.getElement().eIsProxy() || view.getElement().eContainer() == null);
>
> If you submitt corresponding request, we'll be able to patch generator to 
> always perform this check.

This works fine with deleted elements! Thank you for this hint.

But there is still a problem with some edges in some cases. Here is an 
example:
I have two nodes A and B connected with an edge e(A- e - B before 
transformation step).
The following changes are done in one step:
I insert a third node C between A and B, the edge e now connects A and C and 
I insert another edge f that connects C and B (A - e - C - f - B after 
transformation step).
The semantic model is changed correctly.
But in the view there is still the edge between A and B whose <element.../> 
tag is still in the layout model and pointing to the changed edge of the 
semantic model. There are now two layout edges pointing to this semantic 
edge.
When I delete the eIsProxy() and eContainer() == null test in 
XYCanonicalEditPolicy's shouldDeleteView method, everything works fine again 
and the edge is deleted correctly.
Do you have any explanation for that?


> -----------------
> Alex Shatalin
>

Thank you again for helping

Andre Crema
TU Berlin - Tiger Project