Triggering events in Roassal

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

Triggering events in Roassal

Fabrizio Perin-3
Hi,
is there in roassal any event that triggers right after the layout is applied?

What I'm trying to do is to center on an element after the layout is applied (so after the element have a position in the visualization).

Thanks,
Fabrizio

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

Re: Triggering events in Roassal

abergel
> is there in roassal any event that triggers right after the layout is applied?

Currently no. It would be easy to add this.

> What I'm trying to do is to center on an element after the layout is applied (so after the element have a position in the visualization).


I can't really figure out why you need this. I would understand if the layout would be done in a background thread, but this is not the case. Here an example on how to focus after a layout:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| view nodes dictionaryNode |
view := ROMondrianViewBuilder new.
"enter your script below"
"-------------"
"-------------"

nodes := view nodes: Collection withAllSubclasses.
dictionaryNode := nodes detect: [ :element | element model == Dictionary ].
view open.

ROFocusView on: dictionaryNode.  
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Note that the use of ROFocusView cannot be done before opening the view. The reason is that opening the view triggers the layout. Do you want to open the view after doing the focus ? This is doable, just let me know.

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: Triggering events in Roassal

Tudor Girba-2
Hi,

When you are in the context of Glamour, you do not have access to open.

That is why it would be good to have this even available.

Cheers,
Doru


On 15 Nov 2012, at 16:32, Alexandre Bergel <[hidden email]> wrote:

>> is there in roassal any event that triggers right after the layout is applied?
>
> Currently no. It would be easy to add this.
>
>> What I'm trying to do is to center on an element after the layout is applied (so after the element have a position in the visualization).
>
>
> I can't really figure out why you need this. I would understand if the layout would be done in a background thread, but this is not the case. Here an example on how to focus after a layout:
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> | view nodes dictionaryNode |
> view := ROMondrianViewBuilder new.
> "enter your script below"
> "-------------"
> "-------------"
>
> nodes := view nodes: Collection withAllSubclasses.
> dictionaryNode := nodes detect: [ :element | element model == Dictionary ].
> view open.
>
> ROFocusView on: dictionaryNode.  
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> Note that the use of ROFocusView cannot be done before opening the view. The reason is that opening the view triggers the layout. Do you want to open the view after doing the focus ? This is doable, just let me know.
>
> Cheers,
> Alexandre
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"In a world where everything is moving ever faster,
one might have better chances to win by moving slower."




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

Re: Triggering events in Roassal

abergel
Good point!

I've added ROLayoutBeing and ROLayoutEnd, both subclass of ROLayoutEvent.

Using the Mondrian DSL:

-=-=-=-=-=-=-=-=
view nodes: (1 to: 20).
view horizontalLineLayout
        on: ROLayoutEnd do: [:event | ... ].
-=-=-=-=-=-=-=-=

Or the Roassal API:
-=-=-=-=-=-=-=-=
ROHorizontalLineLayout
        on: ROLayoutEvent do: [ :event | events add: event ];
        applyOn: yourElements
-=-=-=-=-=-=-=-=

Thanks for the suggestion. What we should do also, is to have a ROLayoutStep to have a progress bar while doing layout.

Cheers,
Alexandre

On Nov 15, 2012, at 12:44 PM, Tudor Girba <[hidden email]> wrote:

> Hi,
>
> When you are in the context of Glamour, you do not have access to open.
>
> That is why it would be good to have this even available.
>
> Cheers,
> Doru
>
>
> On 15 Nov 2012, at 16:32, Alexandre Bergel <[hidden email]> wrote:
>
>>> is there in roassal any event that triggers right after the layout is applied?
>>
>> Currently no. It would be easy to add this.
>>
>>> What I'm trying to do is to center on an element after the layout is applied (so after the element have a position in the visualization).
>>
>>
>> I can't really figure out why you need this. I would understand if the layout would be done in a background thread, but this is not the case. Here an example on how to focus after a layout:
>>
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> | view nodes dictionaryNode |
>> view := ROMondrianViewBuilder new.
>> "enter your script below"
>> "-------------"
>> "-------------"
>>
>> nodes := view nodes: Collection withAllSubclasses.
>> dictionaryNode := nodes detect: [ :element | element model == Dictionary ].
>> view open.
>>
>> ROFocusView on: dictionaryNode.  
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>> Note that the use of ROFocusView cannot be done before opening the view. The reason is that opening the view triggers the layout. Do you want to open the view after doing the focus ? This is doable, just let me know.
>>
>> Cheers,
>> Alexandre
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> www.tudorgirba.com
>
> "In a world where everything is moving ever faster,
> one might have better chances to win by moving slower."
>
>
>
>
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Triggering events in Roassal

Tudor Girba-2
Hi,

On 15 Nov 2012, at 18:13, Alexandre Bergel <[hidden email]> wrote:

> Good point!
>
> I've added ROLayoutBeing and ROLayoutEnd, both subclass of ROLayoutEvent.
>
> Using the Mondrian DSL:
>
> -=-=-=-=-=-=-=-=
> view nodes: (1 to: 20).
> view horizontalLineLayout
> on: ROLayoutEnd do: [:event | ... ].
> -=-=-=-=-=-=-=-=
>
> Or the Roassal API:
> -=-=-=-=-=-=-=-=
> ROHorizontalLineLayout
> on: ROLayoutEvent do: [ :event | events add: event ];
> applyOn: yourElements
> -=-=-=-=-=-=-=-=

Excellent!

> Thanks for the suggestion. What we should do also, is to have a ROLayoutStep to have a progress bar while doing layout.

Good point. It would be quite cool.

Cheers,
Doru



> Cheers,
> Alexandre
>
> On Nov 15, 2012, at 12:44 PM, Tudor Girba <[hidden email]> wrote:
>
>> Hi,
>>
>> When you are in the context of Glamour, you do not have access to open.
>>
>> That is why it would be good to have this even available.
>>
>> Cheers,
>> Doru
>>
>>
>> On 15 Nov 2012, at 16:32, Alexandre Bergel <[hidden email]> wrote:
>>
>>>> is there in roassal any event that triggers right after the layout is applied?
>>>
>>> Currently no. It would be easy to add this.
>>>
>>>> What I'm trying to do is to center on an element after the layout is applied (so after the element have a position in the visualization).
>>>
>>>
>>> I can't really figure out why you need this. I would understand if the layout would be done in a background thread, but this is not the case. Here an example on how to focus after a layout:
>>>
>>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>> | view nodes dictionaryNode |
>>> view := ROMondrianViewBuilder new.
>>> "enter your script below"
>>> "-------------"
>>> "-------------"
>>>
>>> nodes := view nodes: Collection withAllSubclasses.
>>> dictionaryNode := nodes detect: [ :element | element model == Dictionary ].
>>> view open.
>>>
>>> ROFocusView on: dictionaryNode.  
>>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>>
>>> Note that the use of ROFocusView cannot be done before opening the view. The reason is that opening the view triggers the layout. Do you want to open the view after doing the focus ? This is doable, just let me know.
>>>
>>> Cheers,
>>> Alexandre
>>>
>>> --
>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>> Alexandre Bergel  http://www.bergel.eu
>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>
>>>
>>>
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>> --
>> www.tudorgirba.com
>>
>> "In a world where everything is moving ever faster,
>> one might have better chances to win by moving slower."
>>
>>
>>
>>
>> _______________________________________________
>> 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

--
www.tudorgirba.com

"Innovation comes in the least expected form.
That is, if it is expected, it already happened."


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