Hi Alex,

The problem is not complete resolved because RTGroup is not RTElement and layouts are supposed to work on RTElement(s). Hence, for example, applying layouts amongst groups does not work. So, changing the layout in your script exposes the problem:

view := RTView new. es1 := (RTEllipse new color: Color lightRed; size: 20) elementsOn: (1 to: 20). RTForceBasedLayout on: es1. view addAll: es1. es2 := (RTEllipse new color: Color lightGreen; size: 20) elementsOn: (1 to: 20). RTForceBasedLayout on: es2. view addAll: es2. es3 := (RTEllipse new color: Color lightBlue; size: 20) elementsOn: (1 to: 20). RTForceBasedLayout on: es3. view addAll: es3. RTClusterLayout new on: (Array with: es1 with: es2 with: es3). view open

So, some layouts need to be adapted to know how to layout not only elements (RTElement) but also groups (RTGroup).

regards,

usman

On Wed, Aug 6, 2014 at 11:08 PM, Alexandre Bergel <alexandre.bergel@me.com> wrote:
Hi Usman,

In your example, I would expect to have the layout applied on the two groups. Each group should therefore stay grouped. There is a bug, indeed. But I do not see how your version of Roassal2 solves the situation. I have found and fixed the problem. I think it will also work for you. 

Update Roassal and try the following:
-=-=-=-=-=-=-=-=-=-=-=-=
view := RTView new.

es1 := (RTEllipse new color: Color lightRed; size: 20) elementsOn: (1 to: 20).
RTForceBasedLayout on: es1.
view addAll: es1.

es2 := (RTEllipse new color: Color lightGreen; size: 20) elementsOn: (1 to: 20).
RTForceBasedLayout on: es2.
view addAll: es2.

es3 := (RTEllipse new color: Color lightBlue; size: 20) elementsOn: (1 to: 20).
RTForceBasedLayout on: es3.
view addAll: es3.

RTForceBasedLayout new 
charge: -800;
on: (Array with: es1 with: es2 with: es3).
view open
-=-=-=-=-=-=-=-=-=-=-=-=

It will produce the following:

Alexandre

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Aug 1, 2014, at 12:25 PM, Usman Bhatti <usman.bhatti@gmail.com> wrote:

Hi,

We spotted a bug related to edge driven layouts and groups. So, when a view has groups in it, performing an edge driven layout gives MNU: RTGroup>>view.

The bug can be reproduced with the following script in latest Roassal. 

view := RTView new.
group1 := RTGroup new add: (RTBox new elementOn: 1); yourself.
group2 := RTGroup new add: (RTEllipse new elementOn: 2); yourself.
view addAll: group1; addAll: group2.
RTForceBasedLayout on: (RTGroup with: group1 with: group2).
view open

The link to get the version with changes (because problem posting more than 1 mb on this list):

All tests are green after the change.

Alex, can you integrate this in Roassal because it is important for our work.

tx,

Usman & Leo


_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev