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
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=