Dear all,

I have created a class RTConditionalLayout and it is into the Layout Builder. 
Consider the following example:


-=-=-=-=-=-=-=-=-=
v := RTView new.
es := (RTEllipse new
size: 30;
color: [ :value | value odd ifTrue: [ Color red ] ifFalse: [ Color blue ] ])
elementsOn: (1 to: 4).
v addAll: es.

l := RTConditionalLayout new
condition: [ :element | element model odd ];
thenLayout: RTVerticalLineLayout new;
elseLayout: RTHorizontalLineLayout new.
l on: es.
v
-=-=-=-=-=-=-=-=-=

The idea is to have a layout that segregate some elements that match a particular condition. 

This is supported in the Layout builder, which allows one to do (using RTMondrian in that case):
-=-=-=-=-=-=-=-=-=
b := RTMondrian new.
b shape rectangle
fillColor: Color white;
borderColor: Color lightGray;
withTextAbove: #name.
b nodes: Collection withAllSubclasses forEach: [ :cls |
b nodes: cls methods.
b edges connectToAll: #dependentMethods.
b layout 
ifElement: #isConnected then: RTTreeLayout new;
else: RTGridLayout new.
 ].

b edges connectFrom: #superclass.
b layout tree.
b
-=-=-=-=-=-=-=-=-=

The issue here is that I have introduced a mechanism to do ‘if’ statements. I am not sure this is the best things…

Comments are welcome :-)

Cheers,
Alexandre

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