|
|
Re: zigzag connection shape [message #871566 is a reply to message #857349] |
Mon, 14 May 2012 12:31 |
Erdal Karaca Messages: 854 Registered: July 2009 |
Senior Member |
|
|
I tried to use this:
{
FreeFormConnection ffc = peCreateService
.createFreeFormConnection(getDiagram());
connection = ffc;
connection.setStart(addConContext.getSourceAnchor());
connection.setEnd(addConContext.getTargetAnchor());
ffc.getBendpoints().addAll(
calcBendPoints((IAddConnectionContext) context));
ffc.setActive(false);
Polyline polyline = gaService.createPlainPolyline(connection);
polyline.setStyle(StyleUtil.getStyleForEClass(getDiagram()));
}
private Collection<? extends Point> calcBendPoints(
IAddConnectionContext context) {
List<Point> points = new ArrayList<Point>();
IGaService gaService = Graphiti.getGaService();
int x = 0;
int y = 0;
points.add(gaService.createPoint(x + 10, y + 10));
points.add(gaService.createPoint(x + 20, y + -10));
points.add(gaService.createPoint(x + 30, y + 10));
points.add(gaService.createPoint(x + 40, y + -10));
points.add(gaService.createPoint(x + 50, y + 10));
points.add(gaService.createPoint(x + 60, y + -10));
points.add(gaService.createPoint(x + 70, y + 10));
points.add(gaService.createPoint(x + 80, y + -10));
points.add(gaService.createPoint(x + 90, y + 10));
return points;
}
The x and y of the IAddConnectionContext are both -1, so, how do I get the origin coord of the connection's start?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03945 seconds