Issue 904 in moose-technology: Roassal dragging subtrees (feature contribution)

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

Issue 904 in moose-technology: Roassal dragging subtrees (feature contribution)

moose-technology
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 904 by [hidden email]: Roassal dragging subtrees (feature  
contribution)
http://code.google.com/p/moose-technology/issues/detail?id=904

With a tree layout, when dragging an element I needed to drag all the  
children at the same time.  I knocked up a solution sufficient to my needs  
in about 40 minutes - see attached changeset.   I might be a nice general  
feature to add to Roassal but its a bit rough. It will likely need some  
critical love to polish it before integration.  Later it might be made to  
work with ROSelection and multi-selected elements - but that is out of my  
scope for the moment.


Attachments:
        RODraggableWithOthers.2.cs  1.3 KB

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

Re: Issue 904 in moose-technology: Roassal dragging subtrees (feature contribution)

moose-technology
Updates:
        Status: Fixed

Comment #1 on issue 904 by [hidden email]: Roassal dragging subtrees  
(feature contribution)
http://code.google.com/p/moose-technology/issues/detail?id=904

Hi Ben,

Thanks for your suggestion. I wrote a contribution inspired from your  
example.

Fixed in 1.457 of Roassal. Try this:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| view elements |
view := ROView new.

0 to: 50 by: 10 do: [ :i |
        elements := (ROBox green size: 10) elementsOn: (i to: i + 9).
        elements do: [ :e | e @ RODraggable @ ROPopup ].
        view addAll: elements.

        ROLine buildEdgesFromElement: elements first from: #yourself toAll: [ :v |  
(v + 1 to: v + 9) ].

        ROTreeLayout on: elements.
       
        (view elementFromModel: i) - ROBox + ROBox red.
        (view elementFromModel: i)
                @ ROAllConnectedNodeDraggable ;
                translateBy: i * 15 @ 10.
].

view open
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 904 in moose-technology: Roassal dragging subtrees (feature contribution)

Ben Coman
A cursory review of the code seems like it would only work for one
layer.  How would ROAllConnectedNodeDraggable work with the three layers
of the following example[1]?   For my project I came up with an
alternative implementation 'LEKDraggableSubtree.'   I'd be interested in
what you think of the attached mcz.

cheers -ben

[1]-------------------------------
| view toElement fromElement draggableCase |
draggableCase := RODraggable.
"draggableCase := ROAllConnectedNodeDraggable "
"draggableCase := LEKDraggableSubtree withEdges: [ :selectedElement |
selectedElement view onlyEdges ] . "
view := ROView new.
1 to: 7 do:
[  :n |
   toElement :=   ((ROLabel elementOn: n) extent: 50@50 ) + ROBorder @
draggableCase.
   view add: toElement.
    ((fromElement := view elementFromModel: n // 2) )
    ifNotNil: [ view add:    (ROEdge from: fromElement to: toElement ) +
ROLine ]
].
ROHorizontalTreeLayout new on: view elements.
view open.
-------------------------------


[hidden email] wrote:

> Updates:
>     Status: Fixed
>
> Comment #1 on issue 904 by [hidden email]: Roassal dragging
> subtrees (feature contribution)
> http://code.google.com/p/moose-technology/issues/detail?id=904
>
> Hi Ben,
>
> Thanks for your suggestion. I wrote a contribution inspired from your
> example.
>
> Fixed in 1.457 of Roassal. Try this:
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> | view elements |
> view := ROView new.
>
> 0 to: 50 by: 10 do: [ :i |
>     elements := (ROBox green size: 10) elementsOn: (i to: i + 9).
>     elements do: [ :e | e @ RODraggable @ ROPopup ].
>     view addAll: elements.
>
>     ROLine buildEdgesFromElement: elements first from: #yourself
> toAll: [ :v | (v + 1 to: v + 9) ].
>
>     ROTreeLayout on: elements.
>    
>     (view elementFromModel: i) - ROBox + ROBox red.
>     (view elementFromModel: i)
>         @ ROAllConnectedNodeDraggable ;
>         translateBy: i * 15 @ 10.
> ].
>
> view open
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>

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

BTCRoassalExtension-BenComan.1.mcz (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Issue 904 in moose-technology: Roassal dragging subtrees (feature contribution)

abergel
Hi!

Good point. I have added a new interaction class: ROAllRecursivelyConnectedNodeDraggable
Try the following example
-=-=-=-=-=-=-=-=-=-=-=-=
| view toElement fromElement draggableCase |
draggableCase := RODraggable.
"draggableCase := ROAllConnectedNodeDraggable " "draggableCase := LEKDraggableSubtree withEdges: [ :selectedElement | selectedElement view onlyEdges ] . "
view := ROView new.
1 to: 7 do:
[  :n |
 toElement :=   ((ROLabel elementOn: n) extent: 50@50 ) + ROBorder @ draggableCase.
 view add: toElement.
  ((fromElement := view elementFromModel: n // 2) )
  ifNotNil: [ view add:    (ROEdge from: fromElement to: toElement ) + ROLine ]
].
ROHorizontalTreeLayout new on: view elements.

view elements first @ ROAllRecursivelyConnectedNodeDraggable.
view elements first  - ROBorder + ROBorder red.
view open.
-=-=-=-=-=-=-=-=-=-=-=-=

Your .mcz file goes in the right direction. However I have found a simpler solution I think, which also handle cycles.
Let me know whether this new version helps.

Cheers,
Alexandre




On Oct 21, 2013, at 4:20 PM, Ben Coman <[hidden email]> wrote:

> A cursory review of the code seems like it would only work for one layer.  How would ROAllConnectedNodeDraggable work with the three layers of the following example[1]?   For my project I came up with an alternative implementation 'LEKDraggableSubtree.'   I'd be interested in what you think of the attached mcz.
>
> cheers -ben
>
> [1]-------------------------------
> | view toElement fromElement draggableCase |
> draggableCase := RODraggable.
> "draggableCase := ROAllConnectedNodeDraggable " "draggableCase := LEKDraggableSubtree withEdges: [ :selectedElement | selectedElement view onlyEdges ] . "
> view := ROView new.
> 1 to: 7 do:
> [  :n |
>  toElement :=   ((ROLabel elementOn: n) extent: 50@50 ) + ROBorder @ draggableCase.
>  view add: toElement.
>   ((fromElement := view elementFromModel: n // 2) )
>   ifNotNil: [ view add:    (ROEdge from: fromElement to: toElement ) + ROLine ]
> ].
> ROHorizontalTreeLayout new on: view elements.
> view open.
> -------------------------------
>
>
> [hidden email] wrote:
>> Updates:
>>    Status: Fixed
>>
>> Comment #1 on issue 904 by [hidden email]: Roassal dragging subtrees (feature contribution)
>> http://code.google.com/p/moose-technology/issues/detail?id=904
>>
>> Hi Ben,
>>
>> Thanks for your suggestion. I wrote a contribution inspired from your example.
>>
>> Fixed in 1.457 of Roassal. Try this:
>>
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> | view elements |
>> view := ROView new.
>>
>> 0 to: 50 by: 10 do: [ :i |
>>    elements := (ROBox green size: 10) elementsOn: (i to: i + 9).
>>    elements do: [ :e | e @ RODraggable @ ROPopup ].
>>    view addAll: elements.
>>
>>    ROLine buildEdgesFromElement: elements first from: #yourself toAll: [ :v | (v + 1 to: v + 9) ].
>>
>>    ROTreeLayout on: elements.
>>        (view elementFromModel: i) - ROBox + ROBox red.
>>    (view elementFromModel: i)
>>        @ ROAllConnectedNodeDraggable ;
>>        translateBy: i * 15 @ 10.
>> ].
>>
>> view open
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>
> <BTCRoassalExtension-BenComan.1.mcz>_______________________________________________
> 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