Cool

Copy and paste the code in a new section of the Roassal Chapter

On Apr 7, 2013, at 2:07 PM, Alexandre Bergel <alexandre.bergel@me.com> wrote:

Hi!

Having edges that show up when you enter a node is a recurrent need.
I have worked on some easy way to make this possible.

Using the Roassal low level api:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| view rawView el1 el2 el3 |
rawView := ROView new.
rawView add: (el1 := ROBox element size: 20).
rawView add: (el2 := ROBox element size: 20).
rawView add: (el3 := ROBox element size: 20).
ROCircleLayout on: (Array with: el1 with: el2 with: el3).

el1 @ RODraggable.
el2 @ RODraggable.
el3 @ RODraggable.

el1 @ (RODynamicEdge toAll: (Array with: el2 with: el3) using: (ROLine arrowed color: Color red)).

rawView open
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Screenshot:
<Screen Shot 2013-04-07 at 1.24.25 AM.png>


Using the Mondrian builder:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
view interaction 
dynamicEdge: [ :model | (Array with: 10 with: 20 with: 30) copyWithout: model ]
using: (ROLine arrowed color: Color red).
view shape rectangle size: 20.
view nodes: (Array with: 10 with: 20 with: 30).
view circleLayout.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Cheers,
Alexandre


On Feb 6, 2013, at 9:18 AM, Usman Bhatti <usman.bhatti@gmail.com> wrote:

Hello Martin,

Here is a script that did work for me in the past.

|view|
view := ROMondrianViewBuilder new.
       
 
        view interaction on: ROMouseEnter do: [ :event |
                                view shape line color: Color blue.
view edgesFrom: [ :i | i // 2 ].
view raw signalUpdate.
                           
                        ].
view interaction on: ROMouseLeave do: [:event |
view raw allElementsDo: [ :el | el isEdge ifTrue: [el remove] ].
view raw signalUpdate].

 view shape rectangle size: 20.
 view nodes: (1 to: 20).
 
        view gridLayout.
        view open

 I tried in the newest Roassal and it does not work (edges are not removed from the canvas). So, if you want to see it in action, you can do so with Roassal 1.147, which corresponds to (ConfigurationOfRoassal project version: '1.148') load. 

I'll have a look into what broke this feature in latest Roassal.

Usman


On Tue, Feb 5, 2013 at 7:27 PM, Martin Dias <tinchodias@gmail.com> wrote:
Hello,

I have some nodes on a view, and I would like that on ROMouseEnter,
some edges are shown, and on ROMouseLeave they disappear.

My code is a bit complex, but I can recreate the scenario in a script
if you need.

Best regards,
Martin
_______________________________________________
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

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



_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev