I made a bit more investigation. Can someone revise it?
There are two new methods in order to make UML diagram with instVars and methods:
----
MOShapeSelector>>umlClassWithTitle: aBlock instVars: aBlock2 methods: aBlock3
| builder |
builder := MOFormsBuilder new.
builder column; fill.
builder
row;
row;
row.
builder x: 1 y: 1 add: (MORectangleShape new text: aBlock).
builder x: 1 y: 2 add: (MORectangleShape new text: aBlock2).
builder x: 1 y: 3 add: (MORectangleShape new text: aBlock3).
^ view shape: builder asShape
---
and another one just for better printing (I have not found better solution):
---
MOShapeSelector>>fullUmlClass
| printBlock |
printBlock := [ :collection | String streamContents: [ :stream |
collection do: [ :each | stream nextPutAll: each ] separatedBy: [ stream cr ]
]
].
^ self
umlClassWithTitle: #printString
instVars: [:model | printBlock value: model instVarNames]
methods: [:model | printBlock value: model selectors]
---
Then I can make UML diagram like on the picture (fullUMLClass.png):
Is it a good solution?
I did not find out how to force instVars to be on the left as methods. Any idea?
Can someone explain me MOChildrenShape? I do not understand it.
Thank you,
Jura
PS: in the previous post I have forget to attach picture. Here it is (UMLClassWithName.png).