Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » SOUTH_EAST decoration presented in wrong corner
SOUTH_EAST decoration presented in wrong corner [message #1007192] Mon, 04 February 2013 21:27 Go to next message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 831
Registered: July 2009
Senior Member
Hi,

I am trying to use the IDecorationService to decorate locked/conflicted
objects in models stored in CDO, but I have a problem with the
rendering of decorations in the diagrams.

I am specifying PreferedDirection.SOUTH_EAST [sic] as the location of
the decoration, but it ends up in the top-right corner (see below). I
had expected it to end up in the bottom right.

Am I doing something wrong? Is this expected? How can I put the
decoration in the bottom right corner?

I am running Eclipse 4.3 M4 with the latest git master of EMF, CDO, and
UML2, on Mac platform.

Thanks,

Christian
Re: SOUTH_EAST decoration presented in wrong corner [message #1007246 is a reply to message #1007192] Tue, 05 February 2013 09:07 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 504
Registered: February 2011
Senior Member
Hello Christian,

From the source code, I read that the position "North East" is hard-coded for the GMF elements. I will try to get more information to know why it has been forced (It seems that it hasn't always been).


Regards,
Camille


Camille Letavernier
Papyrus developer
Re: SOUTH_EAST decoration presented in wrong corner [message #1007311 is a reply to message #1007246] Tue, 05 February 2013 13:36 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 831
Registered: July 2009
Senior Member
Hi, Camille,

Thanks for looking into it. As it happens, I have had to take a
different approach to my decorations for two reasons: I need to be
able to attach decorations to diagram views only (not the semantic
elements, because notation views can be in conflict with other
transactions) and the DecorationService seems to be geared rather
strongly towards model validation and problem markers.

So, now I actually have a label decorator (GMF-style) in the diagrams
that works well, and have attempted to attach a label decorator to the
ITreeElements in the Model Explorer view. This isn't working because
the first image (decorated or not) for an element is cached and always
used; changes in decorations are always ignored. The problem seems to
be that the string key calculated for image descriptors in the image
registry used by the Model Explorer's label decorator are always the
same, so we never update the image. As the toString() method is used,
and it's implemented by platform-specific SWT classes, it could be that
it only happens this way on Mac platform. I need to continue digging,
then I shall raise a bug and try to fix it.

Thanks!

Christian


On 2013-02-05 09:07:53 +0000, Camille Letavernier said:

> Hello Christian,
>
> From the source code, I read that the position "North East" is
> hard-coded for the GMF elements. I will try to get more information to
> know why it has been forced (It seems that it hasn't always been).
>
>
> Regards,
> Camille
Re: SOUTH_EAST decoration presented in wrong corner [message #1007446 is a reply to message #1007311] Tue, 05 February 2013 21:17 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 831
Registered: July 2009
Senior Member
An update:

It turns out that the problem with my label decorations not showing up
in the Model Explorer was simply that it didn't refresh the viewer when
my label provider fired a change event.

I can work around this by adding the Model Explorer's
DecoratingLabelProviderWTooltips as an observer on the
DecorationService and poking the decoration service to notify its
observers. I think this is something that it should be doing, anyways
(has anyone complained of not seeing problem decorations updated in the
Model Explorer?) but it shouldn't be necessary in my case because I
don't use the decoration service.

I'll continue investigating why my label provider changed event isn't
prompting the Model Explorer to refresh ...

cW


On 2013-02-05 13:36:08 +0000, Christian W. Damus said:

> Hi, Camille,
>
> Thanks for looking into it. As it happens, I have had to take a
> different approach to my decorations for two reasons: I need to be
> able to attach decorations to diagram views only (not the semantic
> elements, because notation views can be in conflict with other
> transactions) and the DecorationService seems to be geared rather
> strongly towards model validation and problem markers.
>
> So, now I actually have a label decorator (GMF-style) in the diagrams
> that works well, and have attempted to attach a label decorator to the
> ITreeElements in the Model Explorer view. This isn't working because
> the first image (decorated or not) for an element is cached and always
> used; changes in decorations are always ignored. The problem seems to
> be that the string key calculated for image descriptors in the image
> registry used by the Model Explorer's label decorator are always the
> same, so we never update the image. As the toString() method is used,
> and it's implemented by platform-specific SWT classes, it could be that
> it only happens this way on Mac platform. I need to continue digging,
> then I shall raise a bug and try to fix it.
>
> Thanks!
>
> Christian
>
>
> On 2013-02-05 09:07:53 +0000, Camille Letavernier said:
>
>> Hello Christian,
>>
>> From the source code, I read that the position "North East" is
>> hard-coded for the GMF elements. I will try to get more information to
>> know why it has been forced (It seems that it hasn't always been).
>>
>>
>> Regards,
>> Camille
SOLVED [Re: SOUTH_EAST decoration presented in wrong corner] [message #1007450 is a reply to message #1007446] Tue, 05 February 2013 21:34 Go to previous message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 831
Registered: July 2009
Senior Member
Hi,

A final update: the root problem in my label updates was that my
label-decorator change events were specifying particular EObjects that
have changed state and needed re-decoration. The problem was that the
Model Explorer doesn't actually visualize the EObjects in the tree, but
rather ITreeElements (from EMF Facet project) that wrap them.

Consequently, the elements referenced in the label-update events didn't
match elements in the tree, and no refresh resulted.

The problem is fixed by simply posting general label-decorator change
events without specifying affected elements (in the context in which I
post the updates, I have no way to know the ITreeElements that wrap
them).

Thanks for your attention,

Christian


On 2013-02-05 21:17:04 +0000, Christian W. Damus said:

> An update:
>
> It turns out that the problem with my label decorations not showing up
> in the Model Explorer was simply that it didn't refresh the viewer when
> my label provider fired a change event.
>
> I can work around this by adding the Model Explorer's
> DecoratingLabelProviderWTooltips as an observer on the
> DecorationService and poking the decoration service to notify its
> observers. I think this is something that it should be doing, anyways
> (has anyone complained of not seeing problem decorations updated in the
> Model Explorer?) but it shouldn't be necessary in my case because I
> don't use the decoration service.
>
> I'll continue investigating why my label provider changed event isn't
> prompting the Model Explorer to refresh ...
>
> cW
>
>
> On 2013-02-05 13:36:08 +0000, Christian W. Damus said:
>
>> Hi, Camille,
>>
>> Thanks for looking into it. As it happens, I have had to take a
>> different approach to my decorations for two reasons: I need to be
>> able to attach decorations to diagram views only (not the semantic
>> elements, because notation views can be in conflict with other
>> transactions) and the DecorationService seems to be geared rather
>> strongly towards model validation and problem markers.
>>
>> So, now I actually have a label decorator (GMF-style) in the diagrams
>> that works well, and have attempted to attach a label decorator to the
>> ITreeElements in the Model Explorer view. This isn't working because
>> the first image (decorated or not) for an element is cached and always
>> used; changes in decorations are always ignored. The problem seems to
>> be that the string key calculated for image descriptors in the image
>> registry used by the Model Explorer's label decorator are always the
>> same, so we never update the image. As the toString() method is used,
>> and it's implemented by platform-specific SWT classes, it could be that
>> it only happens this way on Mac platform. I need to continue digging,
>> then I shall raise a bug and try to fix it.
>>
>> Thanks!
>>
>> Christian
>>
>>
>> On 2013-02-05 09:07:53 +0000, Camille Letavernier said:
>>
>>> Hello Christian,
>>>
>>> From the source code, I read that the position "North East" is
>>> hard-coded for the GMF elements. I will try to get more information to
>>> know why it has been forced (It seems that it hasn't always been).
>>>
>>>
>>> Regards,
>>> Camille
Previous Topic:SysML & ACCELEO
Next Topic:0.10.0M5
Goto Forum:
  


Current Time: Fri Nov 28 02:05:31 GMT 2014

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

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