Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » How to add an ImageDecorator to a connection
How to add an ImageDecorator to a connection [message #635372] Tue, 26 October 2010 11:22 Go to next message
Daniele is currently offline Daniele
Messages: 45
Registered: August 2010
Member
Hi,

I am trying to add an image to a connection:


public PictogramElement add(IAddContext context) {
...


ConnectionDecorator imageDecorator = peCreateService.createConnectionDecorator(connection, true, 0.8, true);
Image image = gaService.createImage(imageDecorator, ImageProvider.IMG_MEASURE);

gaService.setLocation(image, 10, 0);
...
}

but no image is displayed. Am I doing something wrong?

Thank you in advance for any help Smile
Daniele
Re: How to add an ImageDecorator to a connection [message #635521 is a reply to message #635372] Wed, 27 October 2010 03:48 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1267
Registered: July 2009
Location: Walldorf, Germany
Senior Member
In contrast to Text GAs, Image GAs have a default size of 0. Simply add size
information to the image and it will appear, e.g.:
gaService.setLocationAndSize(image, 10, 0, 16, 16);



Michael



"Daniele" <barone.daniele@gmail.com> wrote in message
news:ia6rg6$cjm$1@news.eclipse.org...
> Hi,
> I am trying to add an image to a connection:
>
>
> public PictogramElement add(IAddContext context) {
> ..
>
>
> ConnectionDecorator imageDecorator =
> peCreateService.createConnectionDecorator(connection, true, 0.8, true);
> Image image = gaService.createImage(imageDecorator,
> ImageProvider.IMG_MEASURE);
>
> gaService.setLocation(image, 10, 0);
> ..
> }
>
> but no image is displayed. Am I doing something wrong?
>
> Thank you in advance for any help :)
> Daniele
>
Re: How to add an ImageDecorator to a connection [message #635610 is a reply to message #635521] Wed, 27 October 2010 09:50 Go to previous message
Daniele is currently offline Daniele
Messages: 45
Registered: August 2010
Member
Great it works pefectly Very Happy
Thanks
Daniele
Previous Topic:filled ellipse renders with small gap
Next Topic:Drawing composite on
Goto Forum:
  


Current Time: Sat May 18 11:08:42 EDT 2013

Powered by FUDForum. Page generated in 0.01596 seconds