Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » How to have an icon on a Rectangle/ Container Shape?
How to have an icon on a Rectangle/ Container Shape? [message #912332] Thu, 13 September 2012 11:17 Go to next message
Deepak P is currently offline Deepak PFriend
Messages: 32
Registered: January 2012
Member
Hello All,
I have a scenario in which i need to have an icon on top of the Rectangle/ Container Shape.
Regarding this I have few questions

1) Is it possible to have an icon on top of a Rectangle / Container Shape ??

2) If Yes , then how is it possible??

3) If No then on what graphical element can we place an icon ??

Thanks in adavance

Regards,
Deepak P
Re: How to have an icon on a Rectangle/ Container Shape? [message #912345 is a reply to message #912332] Thu, 13 September 2012 11:47 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Deepak,

that's possible, and there are several ways to do it:
- each GraphicsAlgorithm (rectangle, ellipse,...) can have children, simply
a an Image GraphicsAlgorithm as child
- a container shape cna have several child shapes, each of theses shapes
needs a GraphicsAlgorithm, simply use a Image for one of the shapes
- there are decorators that can be added on top of each
shape/GraphicsAlgorithm without changing a diagram (can e.g. be used to
visualize errors).

HTH,
Michael
Re: How to have an icon on a Rectangle/ Container Shape? [message #912381 is a reply to message #912345] Thu, 13 September 2012 13:07 Go to previous messageGo to next message
Deepak P is currently offline Deepak PFriend
Messages: 32
Registered: January 2012
Member
Hello Michael,

Thanks for your reply Smile

I am able to create the image using the API

"Graphiti.getGaService().createImage(gaContainer, imageId)"

Regards,
Deepak P
Re: How to have an icon on a Rectangle/ Container Shape? [message #912458 is a reply to message #912345] Thu, 13 September 2012 16:05 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
A follow-up question about images: I would like to use a URL instead of
an ID (key into map of resource paths). I see that graphiti internally
uses an ImageDescriptor, since it supports resource paths. However, (if)
I have an ImageDescriptor that supports URLs and would like to extend
graphiti with it, to support URLImages, how could I do that?

Hallvard

On 13.09.12 04.47, Michael Wenz wrote:
> Deepak,
>
> that's possible, and there are several ways to do it:
> - each GraphicsAlgorithm (rectangle, ellipse,...) can have children,
> simply a an Image GraphicsAlgorithm as child
> - a container shape cna have several child shapes, each of theses shapes
> needs a GraphicsAlgorithm, simply use a Image for one of the shapes
> - there are decorators that can be added on top of each
> shape/GraphicsAlgorithm without changing a diagram (can e.g. be used to
> visualize errors).
>
> HTH,
> Michael
Re: How to have an icon on a Rectangle/ Container Shape? [message #912876 is a reply to message #912458] Fri, 14 September 2012 10:22 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hallvard,

the Graphiti image provider is currently not flexible enough. It will only
support local images stored in the plugin. There's an open enhancement
request for opening that up, see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=366452 .

Michael
Re: How to have an icon on a Rectangle/ Container Shape? [message #913027 is a reply to message #912876] Fri, 14 September 2012 16:18 Go to previous message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 14.09.12 03.22, Michael Wenz wrote:
> Hallvard,
>
> the Graphiti image provider is currently not flexible enough. It will
> only support local images stored in the plugin. There's an open
> enhancement request for opening that up, see
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=366452 .

I've added a comment to the bug, which includes the source for a JFace
ImageDescriptor that supports URLs. If this could be used in cases where
the path is a valid URL, it would help a lot!

Hallvard
Previous Topic:Graphiti as View instead of Editor?
Next Topic:Advanced proprety sheet page for EClass
Goto Forum:
  


Current Time: Thu Apr 25 23:30:56 GMT 2024

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

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

Back to the top