Community
Participate
Working Groups
If you have several nodes in a editor and you switch to the diagram page for the first time all of the nodes will be stacked on top of each other. you have to select and drag each one of them into another area of the diagram. This is more confusing later if you leave one of the nodes in the default postion and then later add a new element/node and switch to diagram page it will once again overlap another node in the default position and it is confusing because you may think the new node wasn't added.
An offset stacking could be used instead. That will at least differentiate the nodes for now. Once we incorporate auto-layout algorithms, those can play a part in this scenario as well.
I thought I placed the nodes added through form editor (or source editor) apart by adding 100 pixels horizontally. I'll double check that.
So when you are in a masterDetail page adding more nodes those are added correctly 100 pixels apart. However, here is a better description of how I saw the overlap. Open new sapphire editor, add several new nodes in masterDetail page, switch to diagram page, you will see the correct 100pixel spacing. Close sapphire editor, open same file in plain text editor, add several new node/elements. Reopen sapphire editor and switch to grapphical diagram and you will notice that all new elements are added at the same location and will overlap one-another.
Update, now it seems that if you add multiple new nodes via source page (or external editor) when they are placed on the diagram only the first one may overlap, the rest will be properly spaced, however it doesn't seem to respect existing nodes. Here is a new test sequence: * Switch to source page * add 3 new nodes that will be rendered on diagram page * switch back to diagram you will see the 3 nodes spaced next to one another * switch back to source page and add 3 new nodes again * switch back and see that the 3 new nodes will overlap exactly the first 3 nodes that were added. I'm wondering if the new node default position should take into account existing nodes on the diagram and make sure that new nodes don't overlap existing nodes, in the same way that you can't drop a node when moving it on-top of an existing node (you get the no-drop cursor).
It's non-trivial effort to make sure the new node position doesn't overlap with existing nodes. If user tends to add many new nodes through the form editor or the source editor and comes to the diagram page once in a while, it probably means the user is interested only in the overview of the model (rather than the exact placement of each node), then he/she can apply auto layout. We do plan to support auto layout actions. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=345179
Sure that makes sense. I guess adopters could on switch to diagram page detect if new nodes have been added and perhaps auto-layout the new nodes automatically once those actions are available. So perhaps I should ask if auto-layout actions will be able to operate on a sub-set of nodes, that would be very handy in this case. If adopters are able to auto-layout any new nodes programatically then I believe this bug could be marked wont fix.
Will address auto layout in https://bugs.eclipse.org/bugs/show_bug.cgi?id=345179
I'd like to see this improved regardless of availability of auto-layout action. The solution doesn't have to be terribly complicated. The only requirement from my perspective is to not place new nodes directly on top of other nodes. The user should be able to see all nodes, but there is no requirement here that the placement must be ideal or not partly overlap existing nodes.
I could not duplicate the behavior described by Greg. If new nodes are added through form editor or text editor, new nodes added to the diagram are not placed on top of each other. They are added 100 pixel apart horizontally.
So Greg's steps in Comment #4 do not repro for you you?
(In reply to comment #10) > So Greg's steps in Comment #4 do not repro for you you? No It didn't repro for me.
Changing the resolution accordingly. Greg, if you are still seeing cases where new nodes are placed directly on top of another node, please re-open and we will need to dig deeper.
Thanks for looking again. New nodes are not placed on top of each other, its that new nodes can and will overlap existing nodes. Here is the simplest case: 1. create a diagram with one node 2. save and close the editor 3. open the editor switch to source 4. add a new node in source 5. switch to diagram Notice that the new node overlaps exactly on top of the one existing node. And in my case I was typing in names that were very similar, e.g. Foo1 and Foo2, and I thought to myself "where is the new node?". Shenxue mentioned that it may be prohibitively difficult to make sure that new nodes don't exactly overlap existing nodes.
(In reply to comment #13) > Thanks for looking again. New nodes are not placed on top of each other, its > that new nodes can and will overlap existing nodes. > > Here is the simplest case: > > 1. create a diagram with one node > 2. save and close the editor > 3. open the editor switch to source > 4. add a new node in source > 5. switch to diagram > > Notice that the new node overlaps exactly on top of the one existing node. And > in my case I was typing in names that were very similar, e.g. Foo1 and Foo2, > and I thought to myself "where is the new node?". > > Shenxue mentioned that it may be prohibitively difficult to make sure that new > nodes don't exactly overlap existing nodes. Right if you don't close the editor, and add new nodes in source/form pages and switch between diagram pages and source/form pages, new nodes won't be placed on top of each other. However, if you close the editor and open it again, the new node will be placed at the same default location. I think it's going to be quite involved and complex and arguably not worth the effort to find a new node position that won't overlap with the existing new nodes. If user keeps adding new nodes via form/source pages, the user is better off doing an auto layout.
I'd like to see the following logic implemented: for each new node { start with some fixed location while proposed position is within let's say 5 pixels of another node's left _or_ top border { add fixed offset to proposed position on both axis } } This shouldn't take more than an hour of work to implement and test...
Re-opening based on the discussion.
Need to defer this.
Implemented what's suggested in Comment 15
Verified with build # 518
Closing based on Greg's verification.