|ConnectionDecorator text decoration [message #758536]
||Wed, 23 November 2011 10:35
| Patrick Talbot
Registered: November 2011
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:
> Rectangle ShapeContainer
Alternatively, does someone know how to make the Text box opaque?
Thanks for your help,
[Updated on: Wed, 23 November 2011 12:13]
Report message to a moderator
|Re: ConnectionDecorator text decoration [message #758680 is a reply to message #758536]
||Thu, 24 November 2011 03:25
| Michael Wenz
Registered: July 2009
Location: Walldorf, Germany
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.
Powered by FUDForum
. Page generated in 0.03109 seconds