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 <btc(a)openInWorld.com> 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.
-------------------------------
moose-technology(a)googlecode.com wrote:
Updates:
Status: Fixed
Comment #1 on issue 904 by alexandr...(a)gmail.com: 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
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.