As Doru said, Roassal does not provide a way to compose shapes. I will work on it soon, but right now you can't compose. One easy way to render something that looks like what you have shown is to nest nodes:
view node: 'UML' forIt: [ view shape rectangle withText. view node: 'ROShape'.
view shape label text: [:el | el model selector]. view nodes: ROShape methods.
view verticalLineLayout ].
Soon we will have more...
Cheers, Alexandre
On Jul 29, 2012, at 10:48 AM, Ben Coman btc@openInWorld.com wrote:
Okay. What is the next best approach for what is available at the moment? Subclass one of the other ROShapes... ?
I noticed "ROElement>>addShape: " What is the philosophy/architecture there? Reviewing all the senders shows that 90% only call #addShape: once. The only case where #addShape: is called multiple times on an object it always looks like this... node addShape: ROBox new; addShape: ROBorder new.
cheers, -ben
Tudor Girba wrote:
Currently, there is no support for complex shapes. This is definitely a direction in which we have to invest.
Cheers, Doru
On 28 Jul 2012, at 18:06, Ben Coman wrote:
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:
- Roassal appears to not provide any methods that have "using:" in them.
- 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
<MOFormsBuilder.png>_______________________________________________ Moose-dev mailing list
Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"Some battles are better lost than fought."
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