Community
Participate
Working Groups
When gets beyond a few nodes and connections, it would be very helpful to provide a way for the user to invoke one-time auto-layout. After auto-layout, the user should be able to resume manually positioning nodes and connections.
It would be nice if there was an API for adopters to be able to call auto-layout on a subset of nodes instead of doing all nodes on the diagram.
For context of comment#2 see bug#345199#c6
That's an interesting approach to auto layout. The problem I see here is if the subset of nodes all overlap each other, then they'd only occupy a small area of the diagram canvas. The auto layout algorithm either calculates the bounding box of the region its nodes are supposed to occupy by doing a union on all the nodes or would allow caller to specify that. The former approach would not do a good job if all the nodes are overlapping. In the latter approach, if you pass the diagram canvas region to the layout algorithm, then ultimately the subset of the nodes that are involved in the auto layout may intersect with the nodes that didn't participate in the auto layout. I don't see a good possibility to do auto layout on subset of nodes...
Added two more diagram page actions: auto layout horizontally and auto layout vertically. It applies Draw2D's directed graph layout algorithm. When a sapphire diagram editor is opened, if it can't find diagram layout file, it'll attempt to apply horizontal layout algorithm.
Rather than two separate actions, I'd like to see a single "Sapphire.Diagram.Layout" action with two action handlers for vertical and horizontal layouts. This will also make it easier to add other layouts (whether in the framework or by adopters. The auto-layout operation that happens when geomentry data is not found can be defined as using the first active layout handler. That should be sufficiently flexible since action handler order is controllable in the definition.
Fixed as suggested.
Two issues: 1. Terminology. "Auto layout" suggests a persistent toggle that places the editor into a mode where layout is automatically controlled, which is not what we are doing here. Let's replace "auto layout" with just "layout". Also, the handlers should be labeled just "horizontally" and "vertically" instead of repeating the "layout" verb. 2. Layout of connection labels. When using horizontal layout, the start of the label is placed at the center of the connection which isn't optimal. When the connection is running exactly horizontally, the center of the label should be placed at the midpoint of the connection. The easiest way to repro this is to create A -> B -> C diagram in map sample and don't fill anything in for connection labels.
The action label has been addressed. The connection label placement is tracked by https://bugs.eclipse.org/bugs/show_bug.cgi?id=356535
Looks good. Verified. Closing.