ConnectionDecorator text decoration [message #758536] |
Wed, 23 November 2011 10:35  |
Eclipse User |
|
|
|
I attach a Text to a Connection using a ConnectionDecorator (the same way this is done in the tutorials) but it seems that the text box is always transparent.
I tried to set a background color, I tried setFilled(true), I tried setting it using a Style, I even tried setTransparency() but nothing works.
I thought of using a simple rectangle Shape but I didn't find out how to add a ShapeContainer to a ConnectionDecorator.
What I try to achieve is to have this kind of hierarchy:
ConnectionDecorator
> Rectangle ShapeContainer
>> Text
Alternatively, does someone know how to make the Text box opaque?
Thanks for your help,
-Patrick
[Updated on: Wed, 23 November 2011 12:13] by Moderator
|
|
|
Re: ConnectionDecorator text decoration [message #758680 is a reply to message #758536] |
Thu, 24 November 2011 03:25  |
Eclipse User |
|
|
|
Patrick,
this should be possible by setting a rectangle as graphics algorithm to the
connection decorator and adding a text as child. Somthing like that:
ConnectionDecorator textDecorator =
peCreateService.createConnectionDecorator(connection, true, 0.5, true);
Rectangle rectangle = gaService.createRectangle(textDecorator);
Text text = gaService.createPlainText(rectangle);
Don't forget to set colors, sizes and location accordingly.
HTH,
Michael
|
|
|
Powered by
FUDForum. Page generated in 0.03280 seconds