Using Roassal and Spec

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using Roassal and Spec

abergel
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
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Using Roassal and Spec

Peter Uhnak
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 <[hidden email]> 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
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Using Roassal and Spec

abergel
Thanks Peter!!!

Cheers,
Alexandre


> On Jul 21, 2015, at 5:09 PM, Peter Uhnák <[hidden email]> wrote:
>
> 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 <[hidden email]> 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
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

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




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev