Updates:
Labels: Component-Roassal
Comment #2 on issue 849 by alexandr...(a)gmail.com: Roassal rubber-banding
http://code.google.com/p/moose-technology/issues/detail?id=849
I spent a few minutes on this:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"Preambule. It includes the initialization. "
| rawView view el1 el2 line tmpElement |
rawView := ROView new.
view := ROMondrianViewBuilder view: rawView.
"enter your script below"
"-------------"
"-------------"
el1 := ROElement new + ROBorder red.
el2 := ROElement new + ROBorder red.
el1 extent: 50 @ 50.
el2 extent: 50 @ 50.
rawView add: el1.
rawView add: el2.
el2 translateTo: 250 @ 80.
el1 on: ROMouseDragging do: [ :event |
line ifNil: [
tmpElement := ROElement new.
line := ROEdge lineFrom: event element to: tmpElement.
rawView add: line.
rawView add: tmpElement. ].
tmpElement translateTo: (event position - ( 0 @ 30)).
rawView signalUpdate
].
"-------------"
"-------------"
"Below is the initiation of the menu and opening the visualization"
ROEaselMorphic new populateMenuOn: view.
view open
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
I think a number of points have to be considered:
- You need to have a mode when you want to drag the edge. Maybe a button
that set the "draw line" modes, and another to drag and drop the element.
Or maybe using the right click for this.
- You need to look for the nodes in which the invisible element is
dragged into. If there is an element, then you remove the invisible
element, and make the edge
- I have the impression we need a finer way to tell what is going on when
drag and dropping. It is important to have a precise idea about what we
need. This is tricky but important.