Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » decorating visual representation of business objects with icons provided from outside of the editor
decorating visual representation of business objects with icons provided from outside of the editor [message #1062451] Fri, 07 June 2013 19:37 Go to next message
Becir Basic is currently offline Becir BasicFriend
Messages: 2
Registered: June 2013
Junior Member
Hi,
I am looking for a way to decorate pictogram elements with image decorations that come from outside the editor plug-in.
The usage would be, e.g., application of stereotypes (from UML Profile) to classes/attributes of the domain model. Now, this application of a stereotype to a bo is done through another plug-in. Stereotype holds a path attribute to an icon with which it should be visualized as an icon decoration, when it is applied to a bo. The editor is stereotype agnostic and should stay that way, but still it would be great if there is a way to somehow say to the editor to add the image decoration on the visual representation of the bo. Something in a way what can be achieved in GMF with usage of the Decoration Service.

Does Graphiti in any way support this?
or if there are any suggestions on how this could be done in any other way, would be very helpful.

Thanks,
Becir

Re: decorating visual representation of business objects with icons provided from outside of the edi [message #1062691 is a reply to message #1062451] Mon, 10 June 2013 11:55 Go to previous messageGo to next message
Andrej K is currently offline Andrej KFriend
Messages: 26
Registered: March 2013
Location: germany
Junior Member
Hey!
if I understood right, you want to "say" this and this elements have this and this icons, and this icons are in some folder. And at the start you need to put specific icons for specific elements which are in the editor? something like that?

all elements need to know which image(id) they have...
I create my images at the start and put them in some folder( you need to find out how to get the path of this folder, it must be relative) then you look/find out how many images are there and just put them into your ImageProvider, maybe like this:
for(int i=0;i<imagesNames.length;i++)
	addImageFilePath(imagesNames[i],"/images/"+imagesNames[i]);

put/create all images inside of the images folder
during your add() you put the right image into the right shape

hope it was helpfull
Re: decorating visual representation of business objects with icons provided from outside of the edi [message #1062720 is a reply to message #1062691] Mon, 10 June 2013 13:38 Go to previous messageGo to next message
Becir Basic is currently offline Becir BasicFriend
Messages: 2
Registered: June 2013
Junior Member
Hi Andrej,
first, I want to thank you for your reply.

But, I am not sure if you understood me correctly.
I'll try to explain it differently:

What I want is to implement a plug-in that will extend Graphiti editors. Its sole purpose would be to amend the visual representation of business object by setting/removing decorations (e.g., ImageDecorator).

As I already mention, and afaik, in GMF this can be done by implementing the DecoratorService extension point. And as I was looking into Graphiti API I was unable to find anything equivalent that would help me.

As far as I know, in Graphiti, decorations must be provided in the editor code implementation (with the business logic when to show/hide them). Is this correct?

So, I was wondering if Graphiti API provides services or supports this in any other way, unknown to me, which could help me?

Becir
Re: decorating visual representation of business objects with icons provided from outside of the edi [message #1064069 is a reply to message #1062451] Mon, 17 June 2013 13:35 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Becir,

did you come accross Bugzilla 366452? In comment 8
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=366452#c8) several options
how to access images are described.

Michael
Previous Topic:How to keep active the model outline
Next Topic:Anchors
Goto Forum:
  


Current Time: Tue Apr 23 09:40:02 GMT 2024

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

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

Back to the top