Connection with given point array [message #1080756] |
Tue, 06 August 2013 10:47 |
John Cole Messages: 66 Registered: June 2013 |
Member |
|
|
Hello everyone,
I am trying to add a connection, which runs through some predefined points, which are stored in an array.
So actually I am trying to do this in the AddConnectionFeature. My code looks like this:
@Override
public PictogramElement add(IAddContext context, int[] points) {
IAddConnectionContext addConContext = (IAddConnectionContext) context;
IPeCreateService peCreateService = Graphiti.getPeCreateService();
IGaService gaService = Graphiti.getGaService();
ConnectClause clause = (ConnectClause) context.getNewObject();
Connection connection = peCreateService.createFreeFormConnection((Diagram) context.getTargetContainer());
connection.setStart(addConContext.getSourceAnchor());
connection.setEnd(addConContext.getTargetAnchor());
Polyline polyline = gaService.createPolyline(connection, points);
polyline.setLineWidth(3);
return connection;
}
Although I assign the array with the points to the method createPolyline, it has no effect and the break points are not visible.
What am I doing wrong?
Thanks in advance!
[Updated on: Wed, 07 August 2013 09:21] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02660 seconds