Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Connection Decorator with Text
Connection Decorator with Text [message #1007999] Fri, 08 February 2013 14:42 Go to next message
Jon Kurisu is currently offline Jon Kurisu
Messages: 3
Registered: July 2009
Junior Member
I am trying to create a Connection Decorator, a circle with some text inside the circle, along a Connection. I am able to display the circle, but for some unknown reason the text inside the circle is not being displayed.

Here is the code that I am trying to use.


ConnectionDecorator cd = peCreateService.createConnectionDecorator(connection, false, 0.7, true);
Ellipse ellipse = gaService.createEllipse(cd);
ellipse.setForeground(manageColor(IColorConstant.BLACK));
ellipse.setBackground(manageColor(IColorConstant.WHITE));
ellipse.setLineWidth(0);
gaService.setSize(ellipse, 15, 15);

Text text = gaService.createPlainText(ellipse, "AA");
text.setStyle(StyleUtils.getStyleForTextDecorator((getDiagram())));
gaService.setLocation(text, 0, 0);


I am wondering what I am doing wrong? or if it is possible to have text inside a Connection Decoration?

Thanks
Re: Connection Decorator with Text [message #1008284 is a reply to message #1007999] Mon, 11 February 2013 08:05 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1618
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Jon,

this is a limitation within Graphiti. For connection decorators only a very
limited set of shapes is supported (basically the ones that support rotation
out of the box in GEF already, like ellipses, polylines). Nested shapes are
currently not supported here.

There is an open enhancement request for this, that unfortunatly didn't make
it into Kelper: https://bugs.eclipse.org/bugs/show_bug.cgi?id=369373

Michael
Re: Connection Decorator with Text [message #1008701 is a reply to message #1008284] Wed, 13 February 2013 16:07 Go to previous messageGo to next message
Jon Kurisu is currently offline Jon Kurisu
Messages: 3
Registered: July 2009
Junior Member
Thanks Michael for the answer.

If I wanted to try to contribute a fix for this, could you point me in a direction as to where I would look and give me a hint or two?

-Jon
Re: Connection Decorator with Text [message #1009722 is a reply to message #1008701] Fri, 15 February 2013 15:34 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1618
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Jon,

it would be great if you would contribute that.

If you mean with respect to the sources and how to set up a Graphiti
workspace you should check our wiki at
http://wiki.eclipse.org/GMP/Graphiti#Working_on_Bugzillas_.28Contributions_and_Commiting.29

If you mean with respect to coding the functionality against GEF, that will
be more difficult. The functionality itself could become quite tricky as it
would involve implementing rotation functionality for different kinds of GEF
shapes. But you might start with the editing parts
(ConnectionDecoratorEditPart) and figures (GFAbstractRotatableDecoration
AFAIK from the top of my mind) for the connection decorators.

HTH,
Michael
Previous Topic:Newbie Question
Next Topic:Graphiti Diagram doesn't load on startup
Goto Forum:
  


Current Time: Sat Oct 25 16:53:34 GMT 2014

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

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