Skip to main content

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 15:35 Go to next message
Patrick Talbot is currently offline Patrick TalbotFriend
Messages: 36
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
>> Text

Alternatively, does someone know how to make the Text box opaque?

Thanks for your help,

[Updated on: Wed, 23 November 2011 17:13]

Report message to a moderator

Re: ConnectionDecorator text decoration [message #758680 is a reply to message #758536] Thu, 24 November 2011 08:25 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1890
Registered: July 2009
Location: Walldorf, Germany
Senior Member

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.

Previous Topic:Text foreground color always red?
Next Topic:Selection Listeners
Goto Forum:

Current Time: Sun May 27 01:10:57 GMT 2018

Powered by FUDForum. Page generated in 0.01576 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top