Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Strange problem: Element disappears on second selection of a diagram
Strange problem: Element disappears on second selection of a diagram [message #227593] Fri, 08 December 2006 01:36 Go to next message
Eclipse UserFriend
Originally posted by: wolffischer.gmx.de

Hi there,

i didnt want to write an entry in here - i cant provide any of my code,
because i cant figure out where my problem lies. However i write this
text (some act of desperation...), because i hope to get some input on
where to search or what to try...

So, that is the situation:
We have a modelling tool for workflows. So far, so good. In it, there
are some actions, that are connected via edges. These edges can contain
conditions, i.e. a so called "Guard" that is returned as a child. This
Guard is just some kind of container for one GuardSpecification (an
element, that can hold a complete boolean statement or even consist of
several GuardSpecifications --> kind of a tree).
So, a Guard will get notified if there were some changes made to any of
its GuardSpecifications, lying anywhere underneath it (because the Guard
has to update its graphical representation, i.e. the text that it
displays - only the Guard has a graphical representation in the diagram
- not the guardspecifications itself). So on activation of one of the
GuardSpecification i search for its Guard-Parent and add its adapter to
the GuardSpecification's notification-adapters (and on deactivation i
remove it from this list).
In the Guard itself i have overriden the getModelChildren method to
simply return the only GuardSpecification that the Guard can contain.

That is the problem:
The editor has the capability of switching btw. different activities aka
processes ("wow" ;). If i open an activity that contains at least one
Guard with one GuardSpecification as a child, the first displaying of
this activity works flawless, i.e. everything works as it should. If i
now switch to another activity and return to this activity, the guard
suddenly disappeared in the diagram itself (no exception or error
entry), but still remains in the outline. If i now try to switch away to
another process again, i get an errormessage dialog (that contains no
details) in eclipse and the switch to the other activity will be
intercepted.
The problem is that i cannot see this exception in the error log or
anywhere else. I stepped through it with the debugger and all i found
out is, that there is a null-pointer exception being thrown - no
stacktrace or anything else.
I traced this error down to the method "removeChild" in
AbstractEditPart.class in our RootEditPart. There it fails anywhere in
child.removeNotify (line 811 in AbstractEditPart.class in GEF 3.2.1).

Any hints what i could try?
Help would be greatly appreciated!

Wolf
Re: Strange problem: Element disappears on second selection of a diagram [message #227610 is a reply to message #227593] Fri, 08 December 2006 14:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wolffischer.gmx.de

Some additional informations:
The problem does not occur, if i do not register my "parent guard"s
adapters on activating a GuardSpecification. That means, if the
following code in a GuardSpecification is commented out:
public void activate()
{
if (isActive()) return;

try
{
super.activate();
GuardEditPart gep = (GuardEditPart)getGuardParent(this);
EList adapters = ((Notifier)getModel()).eAdapters();
Object adapter = gep.getAdapter();
adapters.add(adapter);
}
catch (Exception ex)
{
ex.printStackTrace();
}
}

My problem is that i need to get notified in my Guard if one of its
GuardSpecifications changes... Any ideas?

Could it be that this guardspecification extends the
AbstractGraphicalEditPart although it is not shown in the diagram itself?


Wolf



> Hi there,
>
> i didnt want to write an entry in here - i cant provide any of my code,
> because i cant figure out where my problem lies. However i write this
> text (some act of desperation...), because i hope to get some input on
> where to search or what to try...
>
> So, that is the situation:
> We have a modelling tool for workflows. So far, so good. In it, there
> are some actions, that are connected via edges. These edges can contain
> conditions, i.e. a so called "Guard" that is returned as a child. This
> Guard is just some kind of container for one GuardSpecification (an
> element, that can hold a complete boolean statement or even consist of
> several GuardSpecifications --> kind of a tree).
> So, a Guard will get notified if there were some changes made to any of
> its GuardSpecifications, lying anywhere underneath it (because the Guard
> has to update its graphical representation, i.e. the text that it
> displays - only the Guard has a graphical representation in the diagram
> - not the guardspecifications itself). So on activation of one of the
> GuardSpecification i search for its Guard-Parent and add its adapter to
> the GuardSpecification's notification-adapters (and on deactivation i
> remove it from this list).
> In the Guard itself i have overriden the getModelChildren method to
> simply return the only GuardSpecification that the Guard can contain.
>
> That is the problem:
> The editor has the capability of switching btw. different activities aka
> processes ("wow" ;). If i open an activity that contains at least one
> Guard with one GuardSpecification as a child, the first displaying of
> this activity works flawless, i.e. everything works as it should. If i
> now switch to another activity and return to this activity, the guard
> suddenly disappeared in the diagram itself (no exception or error
> entry), but still remains in the outline. If i now try to switch away to
> another process again, i get an errormessage dialog (that contains no
> details) in eclipse and the switch to the other activity will be
> intercepted.
> The problem is that i cannot see this exception in the error log or
> anywhere else. I stepped through it with the debugger and all i found
> out is, that there is a null-pointer exception being thrown - no
> stacktrace or anything else.
> I traced this error down to the method "removeChild" in
> AbstractEditPart.class in our RootEditPart. There it fails anywhere in
> child.removeNotify (line 811 in AbstractEditPart.class in GEF 3.2.1).
>
> Any hints what i could try?
> Help would be greatly appreciated!
>
> Wolf
Re: Strange problem: Element disappears on second selection of a diagram [message #227617 is a reply to message #227610] Fri, 08 December 2006 16:30 Go to previous message
Eclipse UserFriend
Originally posted by: wolffischer.gmx.de

Hi there,

"solved" it.
I simply removed the active and deactivate methods. Instead, on a
notification in one of my guardspecifications, i pass the notification
object directly on to my GuardEditPart.notifyChanged()... Thats not
nice, i know, but it works for now...

Wolf


> Some additional informations:
> The problem does not occur, if i do not register my "parent guard"s
> adapters on activating a GuardSpecification. That means, if the
> following code in a GuardSpecification is commented out:
> public void activate()
> {
> if (isActive()) return;
>
> try
> {
> super.activate();
> GuardEditPart gep = (GuardEditPart)getGuardParent(this);
> EList adapters = ((Notifier)getModel()).eAdapters();
> Object adapter = gep.getAdapter();
> adapters.add(adapter);
> }
> catch (Exception ex)
> {
> ex.printStackTrace();
> }
> }
>
> My problem is that i need to get notified in my Guard if one of its
> GuardSpecifications changes... Any ideas?
>
> Could it be that this guardspecification extends the
> AbstractGraphicalEditPart although it is not shown in the diagram itself?
>
>
> Wolf
>
>
>
>> Hi there,
>>
>> i didnt want to write an entry in here - i cant provide any of my
>> code, because i cant figure out where my problem lies. However i write
>> this text (some act of desperation...), because i hope to get some
>> input on where to search or what to try...
>>
>> So, that is the situation:
>> We have a modelling tool for workflows. So far, so good. In it, there
>> are some actions, that are connected via edges. These edges can
>> contain conditions, i.e. a so called "Guard" that is returned as a
>> child. This Guard is just some kind of container for one
>> GuardSpecification (an element, that can hold a complete boolean
>> statement or even consist of several GuardSpecifications --> kind of a
>> tree).
>> So, a Guard will get notified if there were some changes made to any
>> of its GuardSpecifications, lying anywhere underneath it (because the
>> Guard has to update its graphical representation, i.e. the text that
>> it displays - only the Guard has a graphical representation in the
>> diagram - not the guardspecifications itself). So on activation of one
>> of the GuardSpecification i search for its Guard-Parent and add its
>> adapter to the GuardSpecification's notification-adapters (and on
>> deactivation i remove it from this list).
>> In the Guard itself i have overriden the getModelChildren method to
>> simply return the only GuardSpecification that the Guard can contain.
>>
>> That is the problem:
>> The editor has the capability of switching btw. different activities
>> aka processes ("wow" ;). If i open an activity that contains at least
>> one Guard with one GuardSpecification as a child, the first displaying
>> of this activity works flawless, i.e. everything works as it should.
>> If i now switch to another activity and return to this activity, the
>> guard suddenly disappeared in the diagram itself (no exception or
>> error entry), but still remains in the outline. If i now try to switch
>> away to another process again, i get an errormessage dialog (that
>> contains no details) in eclipse and the switch to the other activity
>> will be intercepted.
>> The problem is that i cannot see this exception in the error log or
>> anywhere else. I stepped through it with the debugger and all i found
>> out is, that there is a null-pointer exception being thrown - no
>> stacktrace or anything else.
>> I traced this error down to the method "removeChild" in
>> AbstractEditPart.class in our RootEditPart. There it fails anywhere in
>> child.removeNotify (line 811 in AbstractEditPart.class in GEF 3.2.1).
>>
>> Any hints what i could try?
>> Help would be greatly appreciated!
>>
>> Wolf
Previous Topic:Drawing sections of graph at a time
Next Topic:internationalization
Goto Forum:
  


Current Time: Wed Apr 24 17:35:47 GMT 2024

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

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

Back to the top