Community
Participate
Working Groups
Manhattan connections should offer a better layout, the GEF Manhattan router is not good enough in some cases. One option could be to use another router, another would be to add some kind of fixed Manhattan layouting to free form connections.
One solution that has worked well with the eclipse BPMN2 Modeler project is to create a layout feature for connections. The editor uses FreeFormConnections which are updated whenever a bendpoint handle is added, moved or removed, or when an attached shape is moved or resized. The routing algorithm considers the bendpoint handle location (if it was moved by the user) so it is possible for the user to adjust the routing instead of forcing a predetermined route. The problem is that if an attached shape is moved, the entire route is recalculated and any adjustments a user may have made to the route are lost. This is still experimental, and work is ongoing...
Enabling users with that option would be a big advantage over standard Manhattan connections, but that last issue is tricky. An idea would be to tag the bendpoints that the user has placed (e.g. with properties) and when re-layouting after a shape has been moved try to reflect e.g. the position of the bendpoint on the complete connection when positioning those bendpoints adjusted by the user. Not sure if that is enough for a good user experience or even feasible for implementing...
This is exactly how the "interesting" bendpoint (the one that was moved by the user) is passed to the routing algorithm: by adding a String property to the connection. However, once the router has done its job, that property is removed from the connection. It would be simple enough to keep that property and add new bendpoints as they are touched by the user, but then it becomes difficult for the user to remember which points are "fixed". It would be nice to be able to decorate those fixed bendpoints (with pushpins maybe?) and make the decorators removable, but I don't know if it is possible to do in GEF/draw2d. There's also the problem of persisting those fixed bendpoints in the model; the BPMN2 metamodel does not provide for this kind of granularity in what are called Edge "waypoints" other than using model extensions, which I am reluctant to do. Maybe these fixed bendpoints simply "disappear" at the end of the editing session?
I should have added to my previous comment that the "pushpin" (or whatever) decorator should only appear when the connection is selected.
Using decorators to tag such user placed bendpoints would be good and that's possible in GEF. Unfortunatly Graphiti currently only supports decorators for shapes and not yet on connections and their decorators; there's an open enhancement request though: https://bugs.eclipse.org/bugs/show_bug.cgi?id=365338 I don't knwo the BPMN2 model well, but do the positions of the bendpoints really need to be persisted in the BPMN2 model? Would that not just be some additional information within the diagram? In that case it would be enough to store them in the Graphiti pictogram model.