Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Label disappears
Label disappears [message #177526] Sun, 16 March 2008 13:20 Go to next message
Manfred Hahn is currently offline Manfred HahnFriend
Messages: 64
Registered: July 2009
Member
Hi,

I had some problems with refreshing the child of a diagram node containing
a WrapLabel (like the task element in the BPMN example): After a save
operation the label wasn't displayed anymore!

I store all my model elements including the diagram in a database using
teneo. When a new element is stored the database gives an ID to the
element. As a consequence the object reference in the node object (the
element feature) is updated. Since the object in fact doesn't change this
setting is not needed but nevertheless it is not forbidden to do it. The
re-setting of the object leads to an refreshment of the node and it's
children.

The method GraphicalEditPart.refreshChild() does this with a removeChild()
followed by a refreshChild().

The removeChild() method calls the generated removeChildVisual() in the
EditPart of the model element (the task in the BPMN example). Since the
removedFixedChild() returns always false the super method is called, where
the label is removed from the children list of the task figure.

The refreshChild() method calls the generated addChildVisual() in the
EditPart, but there the addFixedChild() has a special handling for the
label-EditPart that resets the label.
It does not add the label to the children list of the node figure!!!
So the label vanishes from the node.

I think the removeChildVisual() and the addChildVisual() has to do exactly
the reverse. As a quick help I returned true from the removeFixedChild()
thus disabling the call to the super method. But I think there has to be
better handling of this situation.

In which way should I change the removeChildVisual() and addChildVisual()
methods for a correct behaviour in these situations?

With regards

Manfred Hahn
Re: Label disappears [message #177721 is a reply to message #177526] Mon, 17 March 2008 16:46 Go to previous message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

Could you please submit a bug?

Manfred Hahn wrote:
> Hi,
>
> I had some problems with refreshing the child of a diagram node
> containing a WrapLabel (like the task element in the BPMN example):
> After a save operation the label wasn't displayed anymore!
>
> I store all my model elements including the diagram in a database using
> teneo. When a new element is stored the database gives an ID to the
> element. As a consequence the object reference in the node object (the
> element feature) is updated. Since the object in fact doesn't change
> this setting is not needed but nevertheless it is not forbidden to do
> it. The re-setting of the object leads to an refreshment of the node and
> it's children.
>
> The method GraphicalEditPart.refreshChild() does this with a
> removeChild() followed by a refreshChild().
>
> The removeChild() method calls the generated removeChildVisual() in the
> EditPart of the model element (the task in the BPMN example). Since the
> removedFixedChild() returns always false the super method is called,
> where the label is removed from the children list of the task figure.
>
> The refreshChild() method calls the generated addChildVisual() in the
> EditPart, but there the addFixedChild() has a special handling for the
> label-EditPart that resets the label. It does not add the label to the
> children list of the node figure!!! So the label vanishes from the node.
>
> I think the removeChildVisual() and the addChildVisual() has to do
> exactly the reverse. As a quick help I returned true from the
> removeFixedChild() thus disabling the call to the super method. But I
> think there has to be better handling of this situation.
>
> In which way should I change the removeChildVisual() and
> addChildVisual() methods for a correct behaviour in these situations?
>
> With regards
>
> Manfred Hahn
Previous Topic:Under the class, another sequence diagram
Next Topic:Absolute position of a Point
Goto Forum:
  


Current Time: Thu Apr 25 17:51:29 GMT 2024

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

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

Back to the top