Referring to the attached graph, what is the best way to approach the
following in Roassal.
Currently with Mondrian I produce a produce a custom shape using the
forms builder in #mondrianShape, which is a method of my ModelRoot
class. Referring to the attached graph, as an example this shows the
class name "Substation" above the instance "SS1" and has a space for
contained items to be displayed within it.
>mondrianShape
| builder |
builder := MOFormsBuilder new.
builder column; center; fill; pref; grow.
builder
row; center; pref; fill; grow;
row; center; pref; fill; grow;
row; center; pref; fill; grow.
builder x: 1 y: 1 add: ( MORectangleShape new text:
#strippedClassName; textAlignment: #left; borderColor: Color white ) .
builder x: 1 y: 2 add: ( MORectangleShape new text: #localName;
textAlignment: #left ) .
builder x: 1 y: 3 add: ( MORectangleShape new ) .
builder x: 1 y: 3 add: ( MOChildrenShape new ) .
^builder shape
In conjunction with the use of MOChildrenShape above, class ModelRoot
also has method #addSubViewTo: which descends through contained classes
- for example instance "primary" inside "T1" inside "SS2"
inside "Figure
8..."
>addSubViewTo: aMOViewRenderer
aMOViewRenderer
node: self
using: self mondrianShape
forIt:
[
self children do:
[ :child |
child addSubViewTo: aMOViewRenderer.
]
]
My initial issues in migrating this to Roassal are:
1. Roassal appears to not provide any methods that have "using:" in them.
2. Roassal appears to not support MOFormsBuilder
It may be that I am accessing to much internal methods. The code above
was the result of evolutionary hacking as I was learning Mondrian. I
would be happy to re-architect if someone can advise best practice for
Roassal.
cheers -ben