moosetechnology / Moose

MOOSE - Platform for software and data analysis.
https://moosetechnology.github.io/moose-wiki
MIT License
136 stars 34 forks source link

Roassal refactor RubberBand>>onDrop: #872

Closed seandenigris closed 9 years ago

seandenigris commented 9 years ago

Originally reported on Google Code with ID 872

ROExample>>rubberBandOn: currently has the line... 
    rawView add: (newEdgeRaw + ROLine).

While this is fine in the ROExample script, in my application rawView was not available
at that point, so instead I needed...
    newEdgeRaw from view add: (newEdgeRaw + ROLine).

For a while I confused myself by trying to use...
    newEdgeRaw view add: (newEdgeRaw + ROLine).

but that was not the same view, since the ROEdge created in the sender had a random
default. 

So I now think it is more clear to not create the ROEdge in the sender, but instead
pass the fromElement and toElement and let the user create the ROEdge themselves. 
I think this is conceptually clearer.

See the two methods in the attached changeset.

Reported by benjamin.t.coman on 2012-11-25 04:55:11


seandenigris commented 9 years ago
Not having the rawView available in your code is probably wrong. You should always pass
the builder through your building code. That is why, for example, all visualizations
in Moose have both a viewXYZ unary method for opening the visualization, and a viewXYZOn:
one for composition purposes.

So, I think this is not a valid concern.

Reported by tudor@tudorgirba.com on 2012-11-25 12:26:33

seandenigris commented 9 years ago
It is in Roassal 1.198. This .cs only impact two methods. I would like to see a nice
support of drag and drop in Roassal. This is essential.

Reported by alexandre.bergel on 2012-11-25 14:43:07

seandenigris commented 9 years ago
Doru, I'm glad to receive your advice and so I reviewed my code with a critical eye
against all the viewXYZOn: that I could find.  I note that most of the viewXYZOn: seem
to create a whole view having just one or a few different shapes/interactions/layouts
- whereas I am having over 50 shapes with several nestings each with a different layout,
so I have pushed creation of elements out to their matching model classes.  Perhaps
not he best way but it is what I ended up with at the moment and cannot change right
now as I near the finish line of my Masters.  

In any case, even if rawView was available, I think still clearer this way.   It was
only the other way because that is what I came up with myself, and at the time I was
flipping between the two different implementations, and in hindsight this is better.

Reported by benjamin.t.coman on 2012-11-25 15:36:19

seandenigris commented 9 years ago
Thanks Alexandre. That works fine.

Reported by benjamin.t.coman on 2012-11-25 15:43:05

seandenigris commented 9 years ago

Reported by tudor@tudorgirba.com on 2013-03-03 13:05:26