|
|
|
|
Re: EMF decorators [message #893571 is a reply to message #893570] |
Wed, 04 July 2012 15:48 |
becks m Messages: 59 Registered: June 2012 |
Member |
|
|
Ed Merks wrote on Wed, 04 July 2012 11:35Comments below.
On 04/07/2012 3:44 PM, becks m wrote:
> Ed,
> Where to use it ?
I pointed to it as an example of how to use ComposedImage.
> I've looked at it but I don't know where exactly should I use this
> method.
You don't use it, you look at how it works.
>
>
> I've the generated item provider adapters for all classes ( edit plugin)
>
> should I use this in getImage method ?
You'll want to specialize your getImage method to use ComposedImage.
> also, this class ETypedElementItemProvider where to extend it or what
> to change in the current generated model.
>
>
> all I wanted to add flag icon on an existing icon upon if condition.
Much like we want to add multiplicity decorations to a basic image...
Great, I went through it, and I reached something , wanted to share it with you.
In the edit plugin I override the method overlayImage which is used in each getImage method.
and used it easily by setting the image in it with the one i wanted to add on the original image. so, task was done there.
protected Object overlayImage(Object object, Object image)
{
List<Object> images = new ArrayList<Object>(2);
images.add(image);
images.add(getResourceLocator().getImage("full/obj16/requiredImagetoBeAddedOnOriginal"));
image = new ComposedImage(images);
return image;
}
Thanks Ed.
[Updated on: Wed, 04 July 2012 15:50] Report message to a moderator
|
|
|
Re: EMF decorators [message #893578 is a reply to message #893571] |
Wed, 04 July 2012 16:42 |
Ed Merks Messages: 33133 Registered: July 2009 |
Senior Member |
|
|
That method is intended to adding the "controlled object" overlay so
reusing it for something else will disable it for that purpose. As you
can see, that method too simply uses ComposedImage so you could add your
own utility method just like that...
On 04/07/2012 5:48 PM, becks m wrote:
> Ed Merks wrote on Wed, 04 July 2012 11:35
>> Comments below.
>>
>> On 04/07/2012 3:44 PM, becks m wrote:
>> > Ed,
>> > Where to use it ?
>> I pointed to it as an example of how to use ComposedImage.
>> > I've looked at it but I don't know where exactly should I use this
>> > method.
>> You don't use it, you look at how it works.
>> >
>> >
>> > I've the generated item provider adapters for all classes ( edit
>> plugin)
>> >
>> > should I use this in getImage method ?
>> You'll want to specialize your getImage method to use ComposedImage.
>> > also, this class ETypedElementItemProvider where to extend it or
>> what > to change in the current generated model.
>> >
>> >
>> > all I wanted to add flag icon on an existing icon upon if condition.
>> Much like we want to add multiplicity decorations to a basic image...
>
>
>
> Great, I went through it, and I reached to something, wanted to share
> it with you.
>
> In the edit plugin I override the method overlayImage which is used in
> each getImage method.
>
> and used it easily by setting the image in it with the one i wanted to
> add on the original image. so, task was done there.
>
> Thanks Ed.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: EMF decorators [message #893649 is a reply to message #893578] |
Thu, 05 July 2012 06:41 |
becks m Messages: 59 Registered: June 2012 |
Member |
|
|
Yes I disabled its default action for a certain class which I wanted to add decoration for. as I don't need to track the controlled object thing in my program.
but it still affects the rest of classes.
this was very helpful.
Thanks!
Ed Merks wrote on Wed, 04 July 2012 12:42That method is intended to adding the "controlled object" overlay so
reusing it for something else will disable it for that purpose. As you
can see, that method too simply uses ComposedImage so you could add your
own utility method just like that...
On 04/07/2012 5:48 PM, becks m wrote:
> Ed Merks wrote on Wed, 04 July 2012 11:35
>> Comments below.
>>
>> On 04/07/2012 3:44 PM, becks m wrote:
>> > Ed,
>> > Where to use it ?
>> I pointed to it as an example of how to use ComposedImage.
>> > I've looked at it but I don't know where exactly should I use this
>> > method.
>> You don't use it, you look at how it works.
>> >
>> >
>> > I've the generated item provider adapters for all classes ( edit
>> plugin)
>> >
>> > should I use this in getImage method ?
>> You'll want to specialize your getImage method to use ComposedImage.
>> > also, this class ETypedElementItemProvider where to extend it or
>> what > to change in the current generated model.
>> >
>> >
>> > all I wanted to add flag icon on an existing icon upon if condition.
>> Much like we want to add multiplicity decorations to a basic image...
>
>
>
> Great, I went through it, and I reached to something, wanted to share
> it with you.
>
> In the edit plugin I override the method overlayImage which is used in
> each getImage method.
>
> and used it easily by setting the image in it with the one i wanted to
> add on the original image. so, task was done there.
>
> Thanks Ed.
[Updated on: Thu, 05 July 2012 06:49] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.01970 seconds