Hi Alex,
You use RoassalModel just like a regular ComposableModel (which it is
subclass of) and then use methods #script: [ :view :canvas | ] to fill in
your visualization. (And use #refresh or something, but I am triggering
updates manually).
So for example
~~~~~~~~~~~~~~~~~~~~~
ui := DynamicComposableModel new.
ui instantiateModels: #(
button ButtonModel
view RoassalModel
).
ui button label: 'I am a button'.
ui extent: 600 @ 480.
ui view script: [ :view :canvas |
|es|
es := RTEllipse new size: 20; elementsOn: (1 to: 6).
view addAll: es.
RTCircleLayout on: es.
RTEdgeBuilder new
view: view;
elements: es;
connectToAll: [ :value | { value + 1. (value + 1) % 6 } ].
canvas camera focusOnCenter.
].
layout := SpecLayout composed
newColumn: [ :col |
col
add: #button height: ComposableModel toolbarHeight;
add: #view.
];
yourself.
ui openWithSpecLayout: layout.
~~~~~~~~~~~~~~~~~~~~~
If you use ComposableModel (as you should), you just move it to methods as
appropriate (#initializeWidgets, #initializePresenters, etc...)
You can also look at Johan's LRP
http://pleiad.cl/research/software/lrp#downloads
(or DynaCASE, but our usage of RoassalModel is quite complex so it's _not_
a good example).
I believe Johan was working on an example.
Peter
On Tue, Jul 21, 2015 at 3:57 PM, Alexandre Bergel <alexandre.bergel(a)me.com>
wrote:
Hi!
How can I embed a Roassal visualization in Spec? There is the package
Roassal2Spec, but since it does not contains any documentation or example,
hard to use it :-)
Johan, an hello world example please :-)
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev