Bug 398730 - Improve layouting of Manhattan connections
Summary: Improve layouting of Manhattan connections
Status: ASSIGNED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.9.0   Edit
Hardware: All All
: P4 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-22 07:51 EST by Michael Wenz CLA
Modified: 2013-01-23 11:58 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Wenz CLA 2013-01-22 07:51:12 EST
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.
Comment 1 Robert Brodt CLA 2013-01-23 09:21:41 EST
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...
Comment 2 Michael Wenz CLA 2013-01-23 11:09:30 EST
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...
Comment 3 Robert Brodt CLA 2013-01-23 11:34:28 EST
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?
Comment 4 Robert Brodt CLA 2013-01-23 11:42:49 EST
I should have added to my previous comment that the "pushpin" (or whatever) decorator should only appear when the connection is selected.
Comment 5 Michael Wenz CLA 2013-01-23 11:58:25 EST
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.