Issue 849 in moose-technology: Roassal rubber-banding

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

Issue 849 in moose-technology: Roassal rubber-banding

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

New issue 849 by [hidden email]: Roassal rubber-banding
http://code.google.com/p/moose-technology/issues/detail?id=849

As a new feature for Roassal, I would like to be able to interactively drag  
what I term a rubberband (you may have a better one?) from one element to  
another to create and edge between them.

I had previously implemented this on original Mondrian but I think only in  
my image. I don't think it made it to the Mondrian trunk.

As a starting point of discussion I have attached an extracted changeset  
from my image - mostly so that it can be browsed for inspiration in a plain  
text editor.

One key part of the Mondrian implementation was using MOCanvas>>drawOn: to  
draw the rubberband every cycle as well as being outside of the main  
graph.  However there is no corresponding #drawOn: on any of the  
RO-canvases.

The changeset shows the use by the application of two entry points  
#dropRubberBandFrom and #dropRubberBandOn:.  Rubber bands can be dragged  
from EpcimTerminal elements to EpcimConnectivityNode elements.  Method  
#addSubViewTo: was my own application-way of splitting up graph creation to  
the elements of the graph.  I've done this a bit different for updating my  
application from Mondrian to Roassal and the reference implementation for  
this should preferably use "GLMRossalInteractive"

I have manually re-ordered the changeset so that the order that methods are  
used go generally from top to bottom. However the best starting point would  
be to scroll down to look at MOCanvas>>drawOn: and MOCanvas>>rubberBand:,  
then back up to look at the EpCim* classes,
the the two MOAnnouncer methods.

_______________________________________________
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 849 in moose-technology: Roassal rubber-banding

moose-technology

Comment #1 on issue 849 by [hidden email]: Roassal rubber-banding
http://code.google.com/p/moose-technology/issues/detail?id=849

oh, the changeset attached.

Attachments:
        Mondrian Rubberband.4.cs  7.7 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 849 in moose-technology: Roassal rubber-banding

moose-technology
Updates:
        Labels: Component-Roassal

Comment #2 on issue 849 by [hidden email]: 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.

_______________________________________________
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 849 in moose-technology: Roassal rubber-banding

moose-technology

Comment #3 on issue 849 by [hidden email]: Roassal rubber-banding
http://code.google.com/p/moose-technology/issues/detail?id=849

The following scripts seems to do the thing

"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 |
        | relativePosition |
        line ifNil: [
                tmpElement := ROElement new.
                line := ROEdge lineFrom: event element to: tmpElement.
                rawView add: line.
                rawView add: tmpElement. ].
       
        relativePosition := rawView camera realToVirtualPoint: (event position).
        tmpElement translateTo: (relativePosition   ).
        rawView signalUpdate
].

el1 on: ROMouseDragged do: [ :event |
        | element |
        tmpElement remove.
        line remove.
        line := nil.
        tmpElement := nil.
       
        element := (rawView elementAtRealPosition: event position) .
        (element isKindOf: ROElement)
                ifTrue: [ rawView add: (ROEdge lineFrom: event element to: element )].
       
        rawView signalUpdate.
].

"-------------"
"-------------"
"Below is the initiation of the menu and opening the visualization"
ROEaselMorphic new populateMenuOn: view.
view open

_______________________________________________
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 849 in moose-technology: Roassal rubber-banding

moose-technology

Comment #4 on issue 849 by [hidden email]: Roassal rubber-banding
http://code.google.com/p/moose-technology/issues/detail?id=849

Alexandre,  I have implemented your example as an interaction  
RORubberBanding, as well as an example ROExample>>rubberBanding.  I hope  
I've achieved a good balance of conciseness and flexibility in the  
application code. In particular, I have left opportunity for the  
application code to apply a shape to the new edge.  However there is a  
problem with this in ROExample>>rubberBandingOn: that I could not work  
out...
---
rawNewEdge + (ROLine "new attachPoint: ROVerticalAttachPoint " ).   "Bit  
commented out is locking image"
---
I have attached a mcz of this.


Attachments:
        Roassal-BenComan.341.mcz  254 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 849 in moose-technology: Roassal rubber-banding

moose-technology
Updates:
        Status: Fixed

Comment #5 on issue 849 by [hidden email]: Roassal rubber-banding
http://code.google.com/p/moose-technology/issues/detail?id=849

In your .mcz, the class ROAbstractCanvas has been augmented with two  
variables: rubberBandStart rubberBandEnd
Is there a reason for this? I've removed it and included it in Roassal 1.161

_______________________________________________
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 849 in moose-technology: Roassal rubber-banding

moose-technology

Comment #6 on issue 849 by [hidden email]: Roassal rubber-banding
http://code.google.com/p/moose-technology/issues/detail?id=849

> In your .mcz, the class ROAbstractCanvas has been augmented with two  
> variables: rubberBandStart rubberBandEnd
> Is there a reason for this? I've removed it and included it in Roassal  
> 1.161

They were a leftover from my attempt to move my original-Mondrian  
implementation to Roassal, that I failed to remove.  The solution you came  
up with is much better, that made those instance variables redundant.

_______________________________________________
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 849 in moose-technology: Roassal rubber-banding

moose-technology
Updates:
        Labels: Milestone-4.7

Comment #7 on issue 849 by [hidden email]: Roassal rubber-banding
http://code.google.com/p/moose-technology/issues/detail?id=849

(No comment was entered for this change.)

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