Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 21:03 Go to next message
Jorge Padilla is currently offline Jorge PadillaFriend
Messages: 6
Registered: August 2013
Junior Member
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.

index.php/fa/18835/0/


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 13:38 Go to previous message
Simon Sperl is currently offline Simon SperlFriend
Messages: 21
Registered: May 2014
Junior Member
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 13:38]

Report message to a moderator

Previous Topic:Saving hyperlink in pictogram element description
Next Topic:Joining the Mars train?
Goto Forum:
  


Current Time: Tue Mar 19 03:56:36 GMT 2024

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

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

Back to the top