Home » Modeling » Graphiti » How can I place a connection decorator on top of the connection?(Need help to place the connection decorator on top of the connection)
How can I place a connection decorator on top of the connection? [message #1406037] |
Fri, 08 August 2014 17:03  |
Eclipse User |
|
|
|
When I add a connection decorator it appears behind the connection. Is there any way I can bring the decorator to the top of the connection? I want to get the effect of the second connection in the attached image.

This is how I'm creating my connection decorator:
ConnectionDecorator decorator = peService.createConnectionDecorator(connection, true, 0.5, true);
Rectangle rectangle = gaService.createRectangle(decorator);
rectangle.setLineWidth(2);
rectangle.setFilled(false);
gaService.setLocationAndSize(rectangle, -6, -6, 12, 12);
ConnectionDecorator plusSymbol = peService.createConnectionDecorator(connection, true, 0.5, true);
gaService.createPolyline(plusSymbol, new int[] {-4,0, 4,0, 0,0, 0,-4, 0,4 });
|
|
|
Re: How can I place a connection decorator on top of the connection? [message #1410342 is a reply to message #1406037] |
Wed, 20 August 2014 09:38  |
Eclipse User |
|
|
|
Unless I am mistaken all you need to do is make your decorator not active.
ConnectionDecorator decorator = peService.createConnectionDecorator(connection, false, 0.5, true);
Rectangle rectangle = gaService.createRectangle(decorator);
rectangle.setLineWidth(2);
rectangle.setFilled(true);
arrow.setBackground(gservice.manageColor(diagram, IColorConstant.WHITE));
gaService.setLocationAndSize(rectangle, -6, -6, 12, 12);
ConnectionDecorator plusSymbol = peService.createConnectionDecorator(connection, false, 0.5, true);
gaService.createPolyline(plusSymbol, new int[] {-4,0, 4,0, 0,0, 0,-4, 0,4 });
But then the user can't move your decorator around.
Also note calling ConnectionDecorator.setLocation does not seem to do anything on non active connection decorators.
[Updated on: Wed, 20 August 2014 09:38] by Moderator
|
|
|
Goto Forum:
Current Time: Sat Jul 05 11:52:06 EDT 2025
Powered by FUDForum. Page generated in 0.09322 seconds
|