ELTE-Soft / txtUML

Textual, eXecutable, Translatable UML
http://txtuml.inf.elte.hu
Eclipse Public License 1.0
26 stars 9 forks source link

Link layout arrange: smart links #245

Open GregoBalu opened 8 years ago

GregoBalu commented 8 years ago

The link arrangement is currently not manageable by the user (despite priority() and north(), east(), ...). We can either come up with new statements that could help this (for example: link L(A->B) should go on the right side of C, if column(A, C, B) is the layout) or pump up the auto-part of the algorithm. The later would include something like this:

devaigergely81 commented 8 years ago

I thought that links are only laid out in the "corridor area" and not inside the cells of the boxes (even if a given box is smaller than its cell). Is there any major disadvantage of this clean rule?

GregoBalu commented 8 years ago

It was proposed back sometime (by you ;) ) that we should be able to handle "different sized boxes" by using same sized cells and smaller boxes inside. As a side effect (this was the main advantage) lines that would otherwise get around a box between the two other one (with 2 turns), it could go straight through the cell of the small box beside that one.

But this "discouraged" zone would also affect boxes that are as big as their cell, so the actual "corridor area" would be narrowed.

devaigergely81 commented 8 years ago

If links go only in the corridors, then the minimal distance of a link and an independent box will be at least one unit in the grid used for laying out links. Now, if we want to allow links to enter into the cells of small boxes, we have to do it similarly: grid points closer to the box than a unit of the grid are not allowed. This solution guarantees to avoid bug #242, does not produce unpredictable results (like "random" constants given to an A* algorithm) and is relatively simple. So my current suggestion is basically the "discouraged area" proposal above, but with "forbidden" instead of "discouraged" and with "area" = 1 unit.

I think there is no need to do the same for links, since the grid guarantees at least 1 unit between them.

GregoBalu commented 8 years ago

Plus: long awaited "short" reflexive links become "longer" - visually more appealing. (Bigger U shapes)

GregoBalu commented 8 years ago

Updated original post with the idea about giving points in the center of a box's side less cost.

devaigergely81 commented 8 years ago

I suggest to put this on hold for a while for two reasons:

GregoBalu commented 8 years ago

specify