Status: New Owner: ---- Labels: Type-Defect Priority-Medium
New issue 900 by benjamin...@gmail.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
Hopefully, I've cracked this. In response to my own query: "Could something like a GLMMorphicRoassalRawRenderer be added to the Glamour-Roassal interface? - which would pass an unencumbered ROView to the paintingBlock. It is not really a Glamour-Roassal interface at the moment, more of a Glamour-Mondrian interface."
With the attached slice you can now go... browser transmit to: #graphic andShow: [ :a | a roassal newView: [ ROView new @ RODraggable ] ; painting: [:view :input | view add: ROElement new] ].
After loading you can first try the new & old tests in 'Glamour-Tests-Roassal' then try 'GLMRawRoassalExamplesBrowser open'
I surprised myself that I got this far. A few times I hit a brick wall and was going to submit a half done proof-of-concept, but then just kept digging. Apart from hopefully getting integrated, some critical feedback would appreciated. A few points for review...
1. I had considered using #viewPrototype: with an instance to copy, but then I wasn't sure how deep I should copy it to produce a new view. So using a block with newView: seemed the safer path (and it also feels like it opens up some interesting possibilities, even if I can't think what they are at the moment)
2. I noticed that GLMRoassalPresentation>>renderOn: had a flag 'This should be the responsibility of the view'. This method was one that I previously copied and modified for GLMRoassalRawPresentation in my "Interactive Roassal" experiment. There I removed the calls to #applyLayout and #populateMenuOn since these were MNU for ROView (which had replaced ROMondrianViewBuilder). This time I pushed these two calls into ROMondrianViewBuilder>>preOpen, where ROView>>preOpen is left empty. I'm note sure I'm happy with #preOpen as a name but it was the best I could come up with, since I also refactored ROMondrianViewBuilder>>open to use it.
3. GLMMorphicRoassalRenderer>>render: had hardcoded reference to #stack with "ROMorph on: view stack" so I pushed the required difference into ROMondrianBuilder>>newMorph and ROView>>newMorph.
4. GLMMorphicRoassalRenderer>>actOnPresentationUpdate had hardcoded use of #stack in "setView: aView stack" so I pushed that into ROMondrianViewBuilder>>onMorph: and ROView>>onMorph:
5. GLMMorphicRoassalRenderer>>actOnPresentationUpdate had hardcoded ROMondrianViewBuilder so I modified this to use the block passed to GLMRoassalPresentation>>newView: .
6. I copied GLMRoassalMorphicTest to GLMRawRoassalMorphicTest with required modifications.
7. I copied GLMRoassalExamplesBrowser to GLMRawRoassalExamplesBrowser with required modifications.
Comment #1 on issue 900 by benjamin...@gmail.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
The slice and dependent files are in the attached SLICE-Issue-900.zip.
Attachments: SLICE-Issue-900.zip 455 KB
Comment #2 on issue 900 by benjamin...@gmail.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
btw, that slice is against a fresh Moose-4.7-beta image downloaded yesterday.
Comment #3 on issue 900 by tu...@tudorgirba.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
I look at your slice, but you broke Glamour with it because newMorph is not present in Roassal
Comment #4 on issue 900 by benjamin...@gmail.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
Thanks for taking the time to have a look at it. #newMorph is in Roassal-BenComan.405.mcz in the SLICE-Issue-900.zip file you downloaded.
Sorry the hiccup. I haven't working with slices very much. It seems strange though. I thought I'd tested loading the SLICE-Issue-900-xxxxxxx.1.mcz file onto a freshly unpacked Moose image - except now I am having trouble loading that slice myself.
I just re-tested loading the individual mcz files in the following order. Roassal-BenComan.405.mcz Glamour-Morphic-Renderer-BenComan.180.mcz Glamour-Roassal-Presentation-BenComan.9.mcz Glamour-Tests-Roassal-BenComan.5.mcz Glamour-Examples-BenComan.253.mcz
Then... * the eight Glamour-Tests-Roassal are all green. * GLMRawRoassalExamplesBrowser open brings up the Glamour browser on ROExample * GLMRoassalExamplesBrowser open brings up the Glamour browser on ROMondrianExample
Could you give it another go.
Comment #5 on issue 900 by benjamin...@gmail.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
Or perhaps I misunderstood you, and you mean it needs Alexandre to approve and integrate my Roassal changes.
Comment #6 on issue 900 by benjamin...@gmail.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
I have had some discussion with Alexandre, and since the methods I was adding to Roassal are 'morph' focused and Roassal is more cross-platform, he suggested these methods be Glamour extensions to Roassal. I'll do up another with regard for that.
Comment #7 on issue 900 by benjamin...@gmail.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
Sorry I never got around to following this up. It is surprisingly long ago. I have been distracted away from Moose for a while, but since there are now a number of builders for Roassal - ROMondrianViewBuilder, ROTreeMapBuilder, ROPunchcardBuilder, ROFranceMapBuilder - now might be a good time to revisit the architecture of the Glamour-Roassal interface.
Currently Glamour is tied tightly with ROMondrianViewBuilder, and I guess the new builders would not work with Glamour. In other words, it is currently a Glamour-ROMondrianViewBuilder interface rather than a Glamour-Roassal interface. It would be really great if future new third-party Roassal builders could be easily plugged into Glamour. This should also include direct use of ROView such as by my LEKtrek application (when I finally release it).
Also, please consider the case where the Roassal view is not completely regenerated each time, but is persistent across invocations of #paint:. This is for where the Glamour-Roassal interface is used mostly for passing selections from Glamour lists to highlight Roassal features. Just off the top of my head, one way of implementing both these behaviours might be to consider whether a class or an instance is passed to #newView:. For example, where.. a roassal newView: [ :oldView | MyRoassalBuilder newViewFrom: oldView ] ;
* regenerate each time MyRoassalBuilder class>>newViewFrom: oldView ^ self new
* persistent MyRoassalBuilder class>>newViewFrom: oldView ^ oldView
Comment #8 on issue 900 by benjamin...@gmail.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
I have updated this to work on Moose 5 build #166 [1] per attached files: * Glamour-Roassal-Presentations-BenComan.16 * Glamour-Morphic-Renderer-BenComan.216
The Roassal parts have been made extensions from package Glamour-Roassal-Presentations.
After loading evaluate... GLMOtherExamples new roassalDirect openOn: (1 to: 20).
[1] https://ci.inria.fr/moose/job/moose-5.0/166/
cheers -ben
Attachments: Issue-900.2.cs 7.8 KB
Comment #9 on issue 900 by benjamin...@gmail.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
(No comment was entered for this change.)
Attachments: Glamour-Roassal-Presentations-BenComan.16.mcz 5.3 KB Glamour-Morphic-Renderer-BenComan.216.mcz 52.0 KB
Comment #10 on issue 900 by benjamin...@gmail.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
Here is an overview of the changes...
Package Glamour-Roassal-Presentations extensions to Roassal
* ROMondrianViewBuilder
newMorph(new) - factored out GLMMorphicRoassalRenderer>>render: -
returns new ROMorph on its #stack.
onMorph:(new) - sets view of existing ROMorph on its #stack
* ROView
newMorph(new) - returns new ROMorph on itself onMorph:(new) - sets view of existing ROMorph on itself applyLayout(new) - does nothing, just be polymorphic with
ROMondrianBuilder
Package Glamour-Roassal-Presentations
* GLMRoassalPresentation - added ivar 'newViewBlock'
newViewBlock/newViewBlock:(new) - getter/setter for added ivar renderOn:(mod)
- changed #raw to #view, since this is polymorphic between ROView & ROMondrianViewBuilder
view(mod) - removed hardcoded ROMondrianViewBuilder. Instead
evaluate 'newViewBlock'.
Package Glamour-Morphic-Renderer
* GLMMorphicRoassalRenderer
actOnPresentationUpdate:(mod) - removed hardcoded
ROMondrianViewBuilder. Instead evaluate 'newViewBlock'
render:(mod) - removed hardcoded ROMorph on #stack. Factored out to
ROMondrianViewBuilder>>newMorph.
Comment #11 on issue 900 by benjamin...@gmail.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
A usage example can be defining the following method, then evaluating the comment.
GLMOtherExample>>roassalCountries "self new roassalCountries openOn: ROSVGPath countries"
| browser | ROPlatform setCurrent: 'morphic'. browser := GLMTabulator withStatusbar. browser column: #list; column: #roassalRaw. browser transmit to: #list; andShow: [ :a | a list title: 'Select country' ]. browser transmit from: #list; to: #roassalRaw; andShow: [ :a | a roassal title: 'Country Shape'; newViewBlock: [ ROView new @ RODraggable ] ; "<----------" painting: [ :view :country | |path element| path := ROSVGPath path: (ROSVGPath perform: country). element := path elementOn: country. view add: element. view translateTo: path topLeftFromSVG negated. ]. ]. ^browser
Attachments: Issue-900-use-case.png 12.3 KB
Updates: Status: Fixed Cc: alexandr...@gmail.com Labels: -Type-Defect Type-Enhancement Component-Glamour Milestone-5.0
Comment #12 on issue 900 by tu...@tudorgirba.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
Thanks Ben.
I integrated your solution for now with one modification: we have initializeView: instead of newViewBlock:.
We can iterate from this point on: we need to make all builders polymorphic.
Now, this works:
GLMWrapper new with: [ :browser | browser show: [ :a | a roassal initializeView: [ ROView new @ RODraggable ] ; painting: [ :view :numbers | numbers do: [ :number | view add: (ROElement spriteOn: number) + ROLabel ]. ROTreeLayout on: view elements ] ] ]; openOn: (1 to: 10)
moose-technology@googlecode.com wrote:
Updates: Status: Fixed Cc: alexandr...@gmail.com Labels: -Type-Defect Type-Enhancement Component-Glamour Milestone-5.0
Comment #12 on issue 900 by tu...@tudorgirba.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
Thanks Ben.
I integrated your solution for now with one modification: we have initializeView: instead of newViewBlock:.
We can iterate from this point on: we need to make all builders polymorphic.
Now, this works:
GLMWrapper new with: [ :browser | browser show: [ :a | a roassal initializeView: [ ROView new @ RODraggable ] ; painting: [ :view :numbers | numbers do: [ :number | view add: (ROElement spriteOn: number) + ROLabel ]. ROTreeLayout on: view elements ] ] ]; openOn: (1 to: 10)
Cool. #initializeView: is a good change. I was never completely happy with my choice, but could not think of better.
Following on from that I have been considering how to have a permanent ROView that does not get replaced by a #new one each transmission. For example, if there are two panes (list-pane & roassal-pane) the double-clicking on items in the list-pane could add them to the roassal-pane, then the could drag it around, then add a second item from the list-pane, and so on...
So I wonder about some like... | roview | GLMWrapper new with: [ :browser | browser show: [ :a | a roassal initializeView: [ roview ifNil: [ roview := ROView new @ RODraggable ] ] ; painting: [ :view :numbers | numbers do: [ :number | view add: (ROElement spriteOn: number) + ROLabel ]. ROTreeLayout on: view elements ] ] ]; openOn: (1 to: 10)
but that seems a bit hackish. Maybe using #andShowIfNone: would be better and transmitting the strong selection from the list-pane to the roassal-pane a different port - maybe an #add port could be matched with a #delete port or something. What do you think?
cheers -ben
Hi Ben,
You raise a good point: how to update the visualization without redrawing it. This is particularly important if you want to animate or adjust animations from outside.
In the Glamour spirit, it is the job of the transmission to clear or not the target pane. For example, in the case of an accumulator browser, you want to use andShowIfNone: rather than andShow:. Like this, you only install the presentation the first time, and afterwards you reuse it.
For example:
GLMCompositePresentation new tabulator with: [ :t | t column: #index; column: #details. t transmit to: #index; andShow: [:a | a list]. t transmit from: #index; to: #details; andShowIfNone: [:an | an accumulator show: [ :a | a text; title: #asString ] ]]; openOn: (1 to: 100)
An accumulator is typically used together with andShowIfNone: because you want them to accumulate entities as you passed them to it.
A similar approach should probably be applied to working with Roassal as well. Would you like to give it a try?
Cheers, Doru
On Wed, Dec 18, 2013 at 5:50 PM, Ben Coman btc@openinworld.com wrote:
moose-technology@googlecode.com wrote:
Updates: Status: Fixed Cc: alexandr...@gmail.com Labels: -Type-Defect Type-Enhancement Component-Glamour Milestone-5.0
Comment #12 on issue 900 by tu...@tudorgirba.com: Glamour-Roassal should be able to work with raw ROView not just ROMondrianBuilder http://code.google.com/p/moose-technology/issues/detail?id=900
Thanks Ben.
I integrated your solution for now with one modification: we have initializeView: instead of newViewBlock:.
We can iterate from this point on: we need to make all builders polymorphic.
Now, this works:
GLMWrapper new with: [ :browser | browser show: [ :a | a roassal initializeView: [ ROView new @ RODraggable ] ; painting: [ :view :numbers | numbers do: [ :number | view add: (ROElement spriteOn: number) + ROLabel ]. ROTreeLayout on: view elements ] ] ]; openOn: (1 to: 10)
Cool. #initializeView: is a good change. I was never completely happy
with my choice, but could not think of better.
Following on from that I have been considering how to have a permanent ROView that does not get replaced by a #new one each transmission. For example, if there are two panes (list-pane & roassal-pane) the double-clicking on items in the list-pane could add them to the roassal-pane, then the could drag it around, then add a second item from the list-pane, and so on...
So I wonder about some like... | roview |
GLMWrapper new with: [ :browser | browser show: [ :a | a roassal initializeView: [ roview ifNil: [ roview := ROView new @ RODraggable ] ] ;
painting: [ :view :numbers | numbers do: [ :number | view add: (ROElement spriteOn: number) + ROLabel ]. ROTreeLayout on: view elements ] ] ];
openOn: (1 to: 10)
but that seems a bit hackish. Maybe using #andShowIfNone: would be better and transmitting the strong selection from the list-pane to the roassal-pane a different port - maybe an #add port could be matched with a #delete port or something. What do you think?
cheers -ben
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Excellent!!!
Alexandre
Le 17-11-2013 à 14:32, Ben Coman btc@openinworld.com a écrit :
After loading the following packages attached to Issue 900 (http://code.google.com/p/moose-technology/issues/detail?id=900)
Glamour-Roassal-Presentations-BenComan.16.mcz 5.3 KB Glamour-Morphic-Renderer-BenComan.216.mcz 52.0 KB
then adding the method defined below and evaluating its comment, from a list you can select to display individual countries as per attached image. cheers -ben
<moz-screenshot-15.jpg>
GLMOtherExamples>>roassalCountries "self new roassalCountries openOn: ROSVGPath countries"
| browser | ROPlatform setCurrent: 'morphic'. browser := GLMTabulator withStatusbar. browser column: #list; column: #roassalRaw. browser transmit to: #list; andShow: [ :a | a list title: 'Select country' ]. browser transmit from: #list; to: #roassalRaw; andShow: [ :a | a roassal title: 'Country Shape'; newViewBlock: [ ROView new @ RODraggable ] ; painting: [ :view :country | |path element| path := ROSVGPath path: (ROSVGPath perform: country). element := path elementOn: country. view add: element. view translateTo: path topLeftFromSVG negated. ]. ]. ^browser
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Cool!
On Nov 17, 2013, at 14:32, Ben Coman btc@openinworld.com wrote:
After loading the following packages attached to Issue 900 (http://code.google.com/p/moose-technology/issues/detail?id=900)
Glamour-Roassal-Presentations-BenComan.16.mcz 5.3 KB Glamour-Morphic-Renderer-BenComan.216.mcz 52.0 KB
then adding the method defined below and evaluating its comment, from a list you can select to display individual countries as per attached image. cheers -ben
<moz-screenshot-15.jpg>
GLMOtherExamples>>roassalCountries "self new roassalCountries openOn: ROSVGPath countries"
| browser | ROPlatform setCurrent: 'morphic'. browser := GLMTabulator withStatusbar. browser column: #list; column: #roassalRaw. browser transmit to: #list; andShow: [ :a | a list title: 'Select country' ]. browser transmit from: #list; to: #roassalRaw; andShow: [ :a | a roassal title: 'Country Shape'; newViewBlock: [ ROView new @ RODraggable ] ; painting: [ :view :country | |path element| path := ROSVGPath path: (ROSVGPath perform: country). element := path elementOn: country. view add: element. view translateTo: path topLeftFromSVG negated. ]. ]. ^browser
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev