Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » ConnectionDecorator text decoration
ConnectionDecorator text decoration [message #758536] Wed, 23 November 2011 10:35 Go to next message
Patrick Talbot is currently offline Patrick Talbot
Messages: 36
Registered: November 2011
Member
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]

Report message to a moderator

Re: ConnectionDecorator text decoration [message #758680 is a reply to message #758536] Thu, 24 November 2011 03:25 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1577
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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
Previous Topic:Text foreground color always red?
Next Topic:Selection Listeners
Goto Forum:
  


Current Time: Sat Aug 02 00:57:54 EDT 2014

Powered by FUDForum. Page generated in 0.03109 seconds