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 07:17 Go to next message
Deepak P is currently offline Deepak P
Messages: 18
Registered: January 2012
Junior 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 07:47 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1527
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 09:07 Go to previous messageGo to next message
Deepak P is currently offline Deepak P
Messages: 18
Registered: January 2012
Junior 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 12:05 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard Traetteberg
Messages: 582
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 06:22 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1527
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 12:18 Go to previous message
Hallvard Traetteberg is currently offline Hallvard Traetteberg
Messages: 582
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: Fri Apr 18 10:08:37 EDT 2014

Powered by FUDForum. Page generated in 0.01597 seconds