Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » View creation during deleting View
View creation during deleting View [message #88097] Thu, 28 December 2006 08:18
Eclipse UserFriend
Hello,
I have some strange behaviour.
I make my diagram showing only these net elements which has attribute
Layer set to Layer selected in EMF outline tree.
I modified my NetCanonicalEditPolicy methods: shouldDeleteView &
getSemanticChildrenList, I debugged them they return correct results.

When I change layer: new elements appear, old disappear.
But when I move element on one layer, and switch layer, than the each
element from this second layer has 2 views !!! (two figures & two nodes
in notation model).

The only strange thing which happens after moving of element is that the
node element in model changes its position from last to first children.


I was debugging code and found some strange behaviour:



class CanonicalEditPolicy {
(...)

protected final List refreshSemanticChildren() {
(...)
// current views
ok1 List viewChildren = getViewChildren();
ok2 List semanticChildren = new ArrayList(getSemanticChildrenList());

ok3 List orphaned = cleanCanonicalSemanticChildren(viewChildren,
semanticChildren);
boolean changed = false;
//
// delete all the remaining oprphaned views
ok4 if ( !orphaned.isEmpty() ) {
changed = deleteViews(orphaned.iterator());
notOK5 }

//
// create a view for each remaining semantic element.
List createdViews = Collections.EMPTY_LIST;
if ( !semanticChildren.isEmpty() ) {
notok6 createdViews = createViews( semanticChildren );
(...)
}



till ok4 everything seems to be ok. after cleanCanonicalSemanticChildren
I have correct orphaned view list for old views which are going to be
removed and semanticChildren contains elements for which new view should
be created.

in deleteViews(orphaned.iterator());
orphaned elements are removed correctly, but there is REFRESH and
another thread takes semanticChildren and creates views for them

in notok6 semanticChildren has its view (created in deleteView) and here
they are created one more !


when element on last layer has not been moved deleteView does no refresh
on canonical edit policy.

Why it happens?
What is the best solution - a lot of methods are final and i can not
override them.


I found that I can override handleNotificationEvent in my NetEditPolicy
to stop this refreshing in the middle, but maybe i can not call it somehow?

Thanx for any suggestions
Wiktor
Previous Topic:Custom Property Tab
Next Topic:Any plan on multiple page editor?
Goto Forum:
  


Current Time: Tue Jul 22 16:22:47 EDT 2025

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

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

Back to the top