Hi folks, Happy new year to you all. I have a question in Glamour: We want a browser with two panes: browser row: [ :row | row column: #classmap; column: #bugmap]. the two panes show two point of view on the same thing. When we select something in #classmap we want too highlight something related in #bugmap browser transmit from: #classmap; to: #bugmap; The reverse is true to: browser transmit from: #bugmap; to: #classmap; It works somehow: we can open the browser and click on one side (either one) to update the other side. The problem is that if we start selecting in one side, then we can only select on this side, selecting on the other side blanks everything and we need to restart the whole browser. - Is this a know issue? - with a known solution? - do you need more code? nicolas -- Nicolas Anquetil -- RMod team INRIA Lille Nord Europe _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi,
This is a bit a tricky use case, but it should be supported. If you just want to highlight something, then you want to: - start both lists with the some start input, and then - connect the #selection ports of the two panes (supposing you have list presentations) Here is an example: browser := GLMTabulator new. browser column: #one; column: #two. browser transmit to: #one; andShow: [ :a | a list]. browser transmit to: #two; andShow: [ :a | a list]. browser transmit from: #one; to: #two port: #selection. browser transmit from: #two; to: #one port: #selection. browser openOn: (1 to: 42) But, please point me to the whole code so that I can take a look. Cheers, Doru On Wed, Jan 4, 2012 at 4:53 PM, Nicolas Anquetil <[hidden email]> wrote: > > Hi folks, > > Happy new year to you all. > > I have a question in Glamour: > We want a browser with two panes: > > browser > row: [ :row | row column: #classmap; column: #bugmap]. > > the two panes show two point of view on the same thing. > When we select something in #classmap we want too highlight something related > in #bugmap > > browser transmit > from: #classmap; > to: #bugmap; > > The reverse is true to: > > browser transmit > from: #bugmap; > to: #classmap; > > > It works somehow: we can open the browser and click on one side (either one) > to update the other side. > The problem is that if we start selecting in one side, then we can only select > on this side, selecting on the other side blanks everything and we need to > restart the whole browser. > > - Is this a know issue? > - with a known solution? > - do you need more code? > > nicolas > > -- > Nicolas Anquetil -- RMod team > INRIA Lille Nord Europe > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev -- www.tudorgirba.com "Every thing has its own flow" _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
In reply to this post by Nicolas Anquetil
My name is Cesar Couto and I am working with Nicolas Anquetil at INRIA. |browser| browser := GLMTabulator new. browser column: #one; column: #two.
browser transmit to: #one; andShow: [ :a | a mondrian painting: [ :view :bug | view shape label. view node: 'one'. view shape rectangle. view node:1 ] ].
browser transmit to: #two; andShow: [ :a | a mondrian painting: [ :view :bug | view shape label. view node: 'two'. view shape rectangle. view node:2 ] ].
browser transmit from: #one; to: #two port: #selection; andShow: [ :a |
a mondrian title: [ :entity | 'one clicked']; painting: [ :view :class | view shape label. view node: 'one clicked'. view shape rectangle. view node:3 ]].
browser transmit from: #two; to: #one port: #selection; andShow: [ :a |
a mondrian title: [ :entity | 'two clicked']; painting: [ :view :bug | view shape label. view node: 'two clicked'. view shape rectangle. view node:4]].
browser openOn: MooseModel root allModels first. Both of the panes open correctly. But when I click on the entities in one pane, the other pane turn gray and nothing happens.
What do you think? Cesar Couto _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi Cesar,
Welcome in Moose-land :) The problem in your script is that you are sending andShow: with your transmissions as well. For the record, the semantics of andShow: are: - delete the existing presentations - delete the value of all ports - install the new value in the port - install the new presentations Try this: browser := GLMTabulator new. browser column: #one; column: #two. browser transmit to: #one; andShow: [ :a | a mondrian painting: [:view :list | view shape label text: #asString. view nodes: list. view verticalLineLayout ]]. browser transmit to: #two; andShow: [ :a | a mondrian painting: [:view :list | view shape label text: #asString. view nodes: list. view verticalLineLayout ]]. browser transmit from: #one; to: #two port: #selection. browser transmit from: #two; to: #one port: #selection. browser openOn: (1 to: 42) Note that there is no andShow: related to the last two transmissions. Only the values get moved. Does this work for you? Cheers, Doru On Thu, Jan 5, 2012 at 2:50 PM, Cesar Couto <[hidden email]> wrote: > My name is Cesar Couto and I am working with Nicolas Anquetil at INRIA. > > I think this code just works with list, but it does not work mondrian > painting. Look this simple code using mondrian: > > |browser| > browser := GLMTabulator new. > browser column: #one; column: #two. > > browser transmit to: #one; > andShow: [ :a | a mondrian painting: [ :view :bug | view shape label. view > node: 'one'. view shape rectangle. view node:1 ] ]. > > browser transmit to: #two; > andShow: [ :a | a mondrian painting: [ :view :bug | view shape label. view > node: 'two'. view shape rectangle. view node:2 ] ]. > browser transmit from: #one; to: #two port: #selection; > andShow: [ :a | > a mondrian > title: [ :entity | 'one clicked']; > painting: [ :view :class | view shape label. view node: 'one clicked'. view > shape rectangle. view node:3 ]]. > > browser transmit from: #two; to: #one port: #selection; > andShow: [ :a | > a mondrian > title: [ :entity | 'two clicked']; > painting: [ :view :bug | view shape label. view node: 'two clicked'. view > shape rectangle. view node:4]]. > browser openOn: MooseModel root allModels first. > > > Both of the panes open correctly. But when I click on the entities in one > pane, the other pane turn gray and nothing happens. > > What do you think? > > Cesar Couto > > -- > http://www.decom.cefetmg.br/cesar > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev > -- www.tudorgirba.com "Every thing has its own flow" _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi Doru,
thanks for the reply, but unfortunately did not work. If you put the command halt: |browser | browser := GLMTabulator new. browser column: #one; column: #two.
browser transmit to: #one; andShow: [ :a | a mondrian painting: [:view :list | view shape label text: #asString. view nodes: list. self halt.
view verticalLineLayout ]]. browser transmit to: #two; andShow: [ :a | a mondrian painting: [:view :list | view shape label text: #asString.
view nodes: list. self halt. view verticalLineLayout ]]. browser transmit from: #one; to: #two port: #selection.
browser transmit from: #two; to: #one port: #selection. browser openOn: (1 to: 42) you will realize that the block is executed only once. I want the block is executed always there is a selection.
César Couto
On Thu, Jan 5, 2012 at 4:28 PM, Tudor Girba <[hidden email]> wrote: Hi Cesar, http://www.decom.cefetmg.br/cesar _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi,
I know it is executed only once. But, I do not know what you want :). Please provide the whole scenario so that I can get a better idea. Cheers, Doru On 5 Jan 2012, at 17:36, César Couto wrote: > Hi Doru, > > thanks for the reply, but unfortunately did not work. If you put the command halt: > > |browser | > browser := GLMTabulator new. > browser column: #one; column: #two. > browser transmit to: #one; andShow: [ :a | > a mondrian painting: [:view :list | > view shape label text: #asString. > view nodes: list. > self halt. > view verticalLineLayout ]]. > browser transmit to: #two; andShow: [ :a | > a mondrian painting: [:view :list | > view shape label text: #asString. > view nodes: list. > self halt. > view verticalLineLayout ]]. > browser transmit from: #one; to: #two port: #selection. > browser transmit from: #two; to: #one port: #selection. > browser openOn: (1 to: 42) > > you will realize that the block is executed only once. I want the block is executed always there is a selection. > > César Couto > > On Thu, Jan 5, 2012 at 4:28 PM, Tudor Girba <[hidden email]> wrote: > Hi Cesar, > > Welcome in Moose-land :) > > The problem in your script is that you are sending andShow: with your > transmissions as well. > > For the record, the semantics of andShow: are: > - delete the existing presentations > - delete the value of all ports > - install the new value in the port > - install the new presentations > > Try this: > browser := GLMTabulator new. > browser column: #one; column: #two. > browser transmit to: #one; andShow: [ :a | > a mondrian painting: [:view :list | > view shape label text: #asString. > view nodes: list. > view verticalLineLayout ]]. > browser transmit to: #two; andShow: [ :a | > a mondrian painting: [:view :list | > view shape label text: #asString. > view nodes: list. > view verticalLineLayout ]]. > browser transmit from: #one; to: #two port: #selection. > browser transmit from: #two; to: #one port: #selection. > browser openOn: (1 to: 42) > > Note that there is no andShow: related to the last two transmissions. > Only the values get moved. > > Does this work for you? > > Cheers, > Doru > > > On Thu, Jan 5, 2012 at 2:50 PM, Cesar Couto <[hidden email]> wrote: > > My name is Cesar Couto and I am working with Nicolas Anquetil at INRIA. > > > > I think this code just works with list, but it does not work mondrian > > painting. Look this simple code using mondrian: > > > > |browser| > > browser := GLMTabulator new. > > browser column: #one; column: #two. > > > > browser transmit to: #one; > > andShow: [ :a | a mondrian painting: [ :view :bug | view shape label. view > > node: 'one'. view shape rectangle. view node:1 ] ]. > > > > browser transmit to: #two; > > andShow: [ :a | a mondrian painting: [ :view :bug | view shape label. view > > node: 'two'. view shape rectangle. view node:2 ] ]. > > browser transmit from: #one; to: #two port: #selection; > > andShow: [ :a | > > a mondrian > > title: [ :entity | 'one clicked']; > > painting: [ :view :class | view shape label. view node: 'one clicked'. view > > shape rectangle. view node:3 ]]. > > > > browser transmit from: #two; to: #one port: #selection; > > andShow: [ :a | > > a mondrian > > title: [ :entity | 'two clicked']; > > painting: [ :view :bug | view shape label. view node: 'two clicked'. view > > shape rectangle. view node:4]]. > > browser openOn: MooseModel root allModels first. > > > > > > Both of the panes open correctly. But when I click on the entities in one > > pane, the other pane turn gray and nothing happens. > > > > What do you think? > > > > Cesar Couto > > > > -- > > http://www.decom.cefetmg.br/cesar > > > > _______________________________________________ > > Moose-dev mailing list > > [hidden email] > > https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > > > > > -- > www.tudorgirba.com > > "Every thing has its own flow" > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > > > -- > http://www.decom.cefetmg.br/cesar > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev -- www.tudorgirba.com "It's not what we do that matters most, it's how we do it." _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
In summary, the whole scenario is the following: - on the left we have classes, on the right we have commits. One class can be changed by several commits. One commit can change several classes. - initially, the panes show just the classes and just the commits. (There are some additional information with polymetric, but this is irrelevant to the problem) - if we select on a class, we want to highlight all the commits that impacted it. If we select a commit, we want to highlight all the classes that it impacts. The first implementation recomputed the whole pane with some "if: [ :aClass | aClass commits includes: aCommit ] fillColor: Color black." at the right place to "highlight" the proper entities. We understand that we should not recompute the entire pane, but somehow update it by way of ports. Can you give some insight? thank you very much nicolas On Thursday 05 January 2012 19:10:27 Tudor Girba wrote: > Hi, > > I know it is executed only once. > > But, I do not know what you want :). Please provide the whole scenario so > that I can get a better idea. > > Cheers, > Doru > > On 5 Jan 2012, at 17:36, César Couto wrote: > > Hi Doru, > > > > thanks for the reply, but unfortunately did not work. If you put the > > |browser | > > > > browser := GLMTabulator new. > > browser column: #one; column: #two. > > browser transmit to: #one; andShow: [ :a | > > > > a mondrian painting: [:view :list | > > > > view shape label text: #asString. > > view nodes: list. > > > > self halt. > > > > view verticalLineLayout ]]. > > > > browser transmit to: #two; andShow: [ :a | > > > > a mondrian painting: [:view :list | > > > > view shape label text: #asString. > > view nodes: list. > > > > self halt. > > > > view verticalLineLayout ]]. > > > > browser transmit from: #one; to: #two port: #selection. > > browser transmit from: #two; to: #one port: #selection. > > browser openOn: (1 to: 42) > > > > you will realize that the block is executed only once. I want the block > > is executed always there is a selection. > > > > César Couto > > > > On Thu, Jan 5, 2012 at 4:28 PM, Tudor Girba <[hidden email]> > > wrote: > > Hi Cesar, > > > > Welcome in Moose-land :) > > > > The problem in your script is that you are sending andShow: with your > > transmissions as well. > > > > For the record, the semantics of andShow: are: > > - delete the existing presentations > > - delete the value of all ports > > - install the new value in the port > > - install the new presentations > > > > Try this: > > browser := GLMTabulator new. > > browser column: #one; column: #two. > > browser transmit to: #one; andShow: [ :a | > > > > a mondrian painting: [:view :list | > > > > view shape label text: #asString. > > view nodes: list. > > view verticalLineLayout ]]. > > > > browser transmit to: #two; andShow: [ :a | > > > > a mondrian painting: [:view :list | > > > > view shape label text: #asString. > > view nodes: list. > > view verticalLineLayout ]]. > > > > browser transmit from: #one; to: #two port: #selection. > > browser transmit from: #two; to: #one port: #selection. > > browser openOn: (1 to: 42) > > > > Note that there is no andShow: related to the last two transmissions. > > Only the values get moved. > > > > Does this work for you? > > > > Cheers, > > Doru > > > > On Thu, Jan 5, 2012 at 2:50 PM, Cesar Couto <[hidden email]> wrote: > > > My name is Cesar Couto and I am working with Nicolas Anquetil at > > > INRIA. > > > > > > I think this code just works with list, but it does not work > > > mondrian > > > > > > painting. Look this simple code using mondrian: > > > |browser| > > > > > > browser := GLMTabulator new. > > > browser column: #one; column: #two. > > > > > > browser transmit to: #one; > > > andShow: [ :a | a mondrian painting: [ :view :bug | view shape > > > label. view node: 'one'. view shape rectangle. view node:1 ] ]. > > > > > > browser transmit to: #two; > > > andShow: [ :a | a mondrian painting: [ :view :bug | view shape > > > label. view node: 'two'. view shape rectangle. view node:2 ] ]. > > > browser transmit from: #one; to: #two port: #selection; > > > andShow: [ :a | > > > a mondrian > > > title: [ :entity | 'one clicked']; > > > painting: [ :view :class | view shape label. view node: 'one > > > clicked'. view shape rectangle. view node:3 ]]. > > > > > > browser transmit from: #two; to: #one port: #selection; > > > andShow: [ :a | > > > a mondrian > > > title: [ :entity | 'two clicked']; > > > painting: [ :view :bug | view shape label. view node: 'two clicked'. > > > view shape rectangle. view node:4]]. > > > browser openOn: MooseModel root allModels first. > > > > > > > > > Both of the panes open correctly. But when I click on the entities > > > in one pane, the other pane turn gray and nothing happens. > > > > > > What do you think? > > > > > > Cesar Couto > > > > > > -- > > > http://www.decom.cefetmg.br/cesar > > > > > > _______________________________________________ > > > Moose-dev mailing list > > > [hidden email] > > > https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > > > -- > > www.tudorgirba.com > > > > "Every thing has its own flow" > > > > _______________________________________________ > > Moose-dev mailing list > > [hidden email] > > https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > -- > www.tudorgirba.com > > "It's not what we do that matters most, it's how we do it." > > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev Nicolas Anquetil -- RMod team INRIA Lille Nord Europe _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Ok, this is really tricky, but it almost works.
Try this: browser := GLMTabulator new. browser column: #one; column: #two. browser transmit to: #one; fromOutsidePort: #entity; from: #two; andShow: [ :a | a mondrian allowNil; painting: [:view :list :numberToSelect | view shape label text: #asString; fontColor: [:each | (numberToSelect notNil and: [each < numberToSelect]) ifTrue: [Color red] ifFalse: [Color black] ]. view nodes: list. view verticalLineLayout ]]. browser transmit to: #two; fromOutsidePort: #entity; from: #one; andShow: [ :a | a mondrian allowNil; painting: [:view :list :numberToSelect | view shape label text: #asString; fontColor: [:each | (numberToSelect notNil and: [each < numberToSelect]) ifTrue: [Color red] ifFalse: [Color black] ]. view nodes: list. view verticalLineLayout ]]. browser openOn: (1 to: 42) Here you have two lists of numbers that could be anything, and based on one selection you highlight elements in the other list based on a rule (in this case it's a simple less than). I saw it almost works, because when you switch from one side to the other, first it clears everything and only after the second time you select it works. Is this better? Cheers, Doru On Fri, Jan 6, 2012 at 10:05 AM, Nicolas Anquetil <[hidden email]> wrote: > > In summary, the whole scenario is the following: > - on the left we have classes, on the right we have commits. > One class can be changed by several commits. One commit can change several > classes. > > - initially, the panes show just the classes and just the commits. (There are > some additional information with polymetric, but this is irrelevant to the > problem) > > - if we select on a class, we want to highlight all the commits that impacted > it. If we select a commit, we want to highlight all the classes that it > impacts. > > > The first implementation recomputed the whole pane with some > > "if: [ :aClass | aClass commits includes: aCommit ] fillColor: Color black." > > at the right place to "highlight" the proper entities. > > We understand that we should not recompute the entire pane, but somehow update > it by way of ports. > Can you give some insight? > > thank you very much > > nicolas > > > On Thursday 05 January 2012 19:10:27 Tudor Girba wrote: >> Hi, >> >> I know it is executed only once. >> >> But, I do not know what you want :). Please provide the whole scenario so >> that I can get a better idea. >> >> Cheers, >> Doru >> >> On 5 Jan 2012, at 17:36, César Couto wrote: >> > Hi Doru, >> > >> > thanks for the reply, but unfortunately did not work. If you put the > command halt: >> > |browser | >> > >> > browser := GLMTabulator new. >> > browser column: #one; column: #two. >> > browser transmit to: #one; andShow: [ :a | >> > >> > a mondrian painting: [:view :list | >> > >> > view shape label text: #asString. >> > view nodes: list. >> > >> > self halt. >> > >> > view verticalLineLayout ]]. >> > >> > browser transmit to: #two; andShow: [ :a | >> > >> > a mondrian painting: [:view :list | >> > >> > view shape label text: #asString. >> > view nodes: list. >> > >> > self halt. >> > >> > view verticalLineLayout ]]. >> > >> > browser transmit from: #one; to: #two port: #selection. >> > browser transmit from: #two; to: #one port: #selection. >> > browser openOn: (1 to: 42) >> > >> > you will realize that the block is executed only once. I want the block >> > is executed always there is a selection. >> > >> > César Couto >> > >> > On Thu, Jan 5, 2012 at 4:28 PM, Tudor Girba <[hidden email]> >> > wrote: >> > Hi Cesar, >> > >> > Welcome in Moose-land :) >> > >> > The problem in your script is that you are sending andShow: with your >> > transmissions as well. >> > >> > For the record, the semantics of andShow: are: >> > - delete the existing presentations >> > - delete the value of all ports >> > - install the new value in the port >> > - install the new presentations >> > >> > Try this: >> > browser := GLMTabulator new. >> > browser column: #one; column: #two. >> > browser transmit to: #one; andShow: [ :a | >> > >> > a mondrian painting: [:view :list | >> > >> > view shape label text: #asString. >> > view nodes: list. >> > view verticalLineLayout ]]. >> > >> > browser transmit to: #two; andShow: [ :a | >> > >> > a mondrian painting: [:view :list | >> > >> > view shape label text: #asString. >> > view nodes: list. >> > view verticalLineLayout ]]. >> > >> > browser transmit from: #one; to: #two port: #selection. >> > browser transmit from: #two; to: #one port: #selection. >> > browser openOn: (1 to: 42) >> > >> > Note that there is no andShow: related to the last two transmissions. >> > Only the values get moved. >> > >> > Does this work for you? >> > >> > Cheers, >> > Doru >> > >> > On Thu, Jan 5, 2012 at 2:50 PM, Cesar Couto <[hidden email]> wrote: >> > > My name is Cesar Couto and I am working with Nicolas Anquetil at >> > > INRIA. >> > > >> > > I think this code just works with list, but it does not work >> > > mondrian >> > > >> > > painting. Look this simple code using mondrian: >> > > |browser| >> > > >> > > browser := GLMTabulator new. >> > > browser column: #one; column: #two. >> > > >> > > browser transmit to: #one; >> > > andShow: [ :a | a mondrian painting: [ :view :bug | view shape >> > > label. view node: 'one'. view shape rectangle. view node:1 ] ]. >> > > >> > > browser transmit to: #two; >> > > andShow: [ :a | a mondrian painting: [ :view :bug | view shape >> > > label. view node: 'two'. view shape rectangle. view node:2 ] ]. >> > > browser transmit from: #one; to: #two port: #selection; >> > > andShow: [ :a | >> > > a mondrian >> > > title: [ :entity | 'one clicked']; >> > > painting: [ :view :class | view shape label. view node: 'one >> > > clicked'. view shape rectangle. view node:3 ]]. >> > > >> > > browser transmit from: #two; to: #one port: #selection; >> > > andShow: [ :a | >> > > a mondrian >> > > title: [ :entity | 'two clicked']; >> > > painting: [ :view :bug | view shape label. view node: 'two clicked'. >> > > view shape rectangle. view node:4]]. >> > > browser openOn: MooseModel root allModels first. >> > > >> > > >> > > Both of the panes open correctly. But when I click on the entities >> > > in one pane, the other pane turn gray and nothing happens. >> > > >> > > What do you think? >> > > >> > > Cesar Couto >> > > >> > > -- >> > > http://www.decom.cefetmg.br/cesar >> > > >> > > _______________________________________________ >> > > Moose-dev mailing list >> > > [hidden email] >> > > https://www.iam.unibe.ch/mailman/listinfo/moose-dev >> > >> > -- >> > www.tudorgirba.com >> > >> > "Every thing has its own flow" >> > >> > _______________________________________________ >> > Moose-dev mailing list >> > [hidden email] >> > https://www.iam.unibe.ch/mailman/listinfo/moose-dev >> >> -- >> www.tudorgirba.com >> >> "It's not what we do that matters most, it's how we do it." >> >> >> _______________________________________________ >> Moose-dev mailing list >> [hidden email] >> https://www.iam.unibe.ch/mailman/listinfo/moose-dev > -- > Nicolas Anquetil -- RMod team > INRIA Lille Nord Europe > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.iam.unibe.ch/mailman/listinfo/moose-dev -- www.tudorgirba.com "Every thing has its own flow" _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
And here is a version that improves the situation a bit more:
browser := GLMTabulator new. browser column: #one; column: #two. browser transmit to: #one; fromOutsidePort: #entity; fromOutsidePort: #toSelectFromTwo; andShow: [ :a | a mondrian allowNil; painting: [:view :list :numberToSelect | view shape label text: #asString; fontColor: [:each | (numberToSelect notNil and: [each < numberToSelect]) ifTrue: [Color red] ifFalse: [Color black] ]. view nodes: list. view verticalLineLayout ]]. browser transmit to: #two; fromOutsidePort: #entity; fromOutsidePort: #toSelectFromOne; andShow: [ :a | a mondrian allowNil; painting: [:view :list :numberToSelect | view shape label text: #asString; fontColor: [:each | (numberToSelect notNil and: [each < numberToSelect]) ifTrue: [Color red] ifFalse: [Color black] ]. view nodes: list. view verticalLineLayout ]]. browser transmit from: #one; toOutsidePort: #toSelectFromOne. browser transmit from: #two; toOutsidePort: #toSelectFromTwo. browser openOn: (1 to: 42) Cheers, Doru On Fri, Jan 6, 2012 at 11:02 AM, Tudor Girba <[hidden email]> wrote: > Ok, this is really tricky, but it almost works. > > Try this: > browser := GLMTabulator new. > browser column: #one; column: #two. > browser transmit to: #one; fromOutsidePort: #entity; from: #two; andShow: [ :a | > a mondrian > allowNil; > painting: [:view :list :numberToSelect | > view shape label text: #asString; > fontColor: [:each | > (numberToSelect notNil and: [each < numberToSelect]) > ifTrue: [Color red] > ifFalse: [Color black] ]. > view nodes: list. > view verticalLineLayout ]]. > browser transmit to: #two; fromOutsidePort: #entity; from: #one; andShow: [ :a | > a mondrian > allowNil; > painting: [:view :list :numberToSelect | > view shape label text: #asString; > fontColor: [:each | > (numberToSelect notNil and: [each < numberToSelect]) > ifTrue: [Color red] > ifFalse: [Color black] ]. > view nodes: list. > view verticalLineLayout ]]. > browser openOn: (1 to: 42) > > > Here you have two lists of numbers that could be anything, and based > on one selection you highlight elements in the other list based on a > rule (in this case it's a simple less than). > > I saw it almost works, because when you switch from one side to the > other, first it clears everything and only after the second time you > select it works. > > Is this better? > > Cheers, > Doru > > > On Fri, Jan 6, 2012 at 10:05 AM, Nicolas Anquetil > <[hidden email]> wrote: >> >> In summary, the whole scenario is the following: >> - on the left we have classes, on the right we have commits. >> One class can be changed by several commits. One commit can change several >> classes. >> >> - initially, the panes show just the classes and just the commits. (There are >> some additional information with polymetric, but this is irrelevant to the >> problem) >> >> - if we select on a class, we want to highlight all the commits that impacted >> it. If we select a commit, we want to highlight all the classes that it >> impacts. >> >> >> The first implementation recomputed the whole pane with some >> >> "if: [ :aClass | aClass commits includes: aCommit ] fillColor: Color black." >> >> at the right place to "highlight" the proper entities. >> >> We understand that we should not recompute the entire pane, but somehow update >> it by way of ports. >> Can you give some insight? >> >> thank you very much >> >> nicolas >> >> >> On Thursday 05 January 2012 19:10:27 Tudor Girba wrote: >>> Hi, >>> >>> I know it is executed only once. >>> >>> But, I do not know what you want :). Please provide the whole scenario so >>> that I can get a better idea. >>> >>> Cheers, >>> Doru >>> >>> On 5 Jan 2012, at 17:36, César Couto wrote: >>> > Hi Doru, >>> > >>> > thanks for the reply, but unfortunately did not work. If you put the >> command halt: >>> > |browser | >>> > >>> > browser := GLMTabulator new. >>> > browser column: #one; column: #two. >>> > browser transmit to: #one; andShow: [ :a | >>> > >>> > a mondrian painting: [:view :list | >>> > >>> > view shape label text: #asString. >>> > view nodes: list. >>> > >>> > self halt. >>> > >>> > view verticalLineLayout ]]. >>> > >>> > browser transmit to: #two; andShow: [ :a | >>> > >>> > a mondrian painting: [:view :list | >>> > >>> > view shape label text: #asString. >>> > view nodes: list. >>> > >>> > self halt. >>> > >>> > view verticalLineLayout ]]. >>> > >>> > browser transmit from: #one; to: #two port: #selection. >>> > browser transmit from: #two; to: #one port: #selection. >>> > browser openOn: (1 to: 42) >>> > >>> > you will realize that the block is executed only once. I want the block >>> > is executed always there is a selection. >>> > >>> > César Couto >>> > >>> > On Thu, Jan 5, 2012 at 4:28 PM, Tudor Girba <[hidden email]> >>> > wrote: >>> > Hi Cesar, >>> > >>> > Welcome in Moose-land :) >>> > >>> > The problem in your script is that you are sending andShow: with your >>> > transmissions as well. >>> > >>> > For the record, the semantics of andShow: are: >>> > - delete the existing presentations >>> > - delete the value of all ports >>> > - install the new value in the port >>> > - install the new presentations >>> > >>> > Try this: >>> > browser := GLMTabulator new. >>> > browser column: #one; column: #two. >>> > browser transmit to: #one; andShow: [ :a | >>> > >>> > a mondrian painting: [:view :list | >>> > >>> > view shape label text: #asString. >>> > view nodes: list. >>> > view verticalLineLayout ]]. >>> > >>> > browser transmit to: #two; andShow: [ :a | >>> > >>> > a mondrian painting: [:view :list | >>> > >>> > view shape label text: #asString. >>> > view nodes: list. >>> > view verticalLineLayout ]]. >>> > >>> > browser transmit from: #one; to: #two port: #selection. >>> > browser transmit from: #two; to: #one port: #selection. >>> > browser openOn: (1 to: 42) >>> > >>> > Note that there is no andShow: related to the last two transmissions. >>> > Only the values get moved. >>> > >>> > Does this work for you? >>> > >>> > Cheers, >>> > Doru >>> > >>> > On Thu, Jan 5, 2012 at 2:50 PM, Cesar Couto <[hidden email]> wrote: >>> > > My name is Cesar Couto and I am working with Nicolas Anquetil at >>> > > INRIA. >>> > > >>> > > I think this code just works with list, but it does not work >>> > > mondrian >>> > > >>> > > painting. Look this simple code using mondrian: >>> > > |browser| >>> > > >>> > > browser := GLMTabulator new. >>> > > browser column: #one; column: #two. >>> > > >>> > > browser transmit to: #one; >>> > > andShow: [ :a | a mondrian painting: [ :view :bug | view shape >>> > > label. view node: 'one'. view shape rectangle. view node:1 ] ]. >>> > > >>> > > browser transmit to: #two; >>> > > andShow: [ :a | a mondrian painting: [ :view :bug | view shape >>> > > label. view node: 'two'. view shape rectangle. view node:2 ] ]. >>> > > browser transmit from: #one; to: #two port: #selection; >>> > > andShow: [ :a | >>> > > a mondrian >>> > > title: [ :entity | 'one clicked']; >>> > > painting: [ :view :class | view shape label. view node: 'one >>> > > clicked'. view shape rectangle. view node:3 ]]. >>> > > >>> > > browser transmit from: #two; to: #one port: #selection; >>> > > andShow: [ :a | >>> > > a mondrian >>> > > title: [ :entity | 'two clicked']; >>> > > painting: [ :view :bug | view shape label. view node: 'two clicked'. >>> > > view shape rectangle. view node:4]]. >>> > > browser openOn: MooseModel root allModels first. >>> > > >>> > > >>> > > Both of the panes open correctly. But when I click on the entities >>> > > in one pane, the other pane turn gray and nothing happens. >>> > > >>> > > What do you think? >>> > > >>> > > Cesar Couto >>> > > >>> > > -- >>> > > http://www.decom.cefetmg.br/cesar >>> > > >>> > > _______________________________________________ >>> > > Moose-dev mailing list >>> > > [hidden email] >>> > > https://www.iam.unibe.ch/mailman/listinfo/moose-dev >>> > >>> > -- >>> > www.tudorgirba.com >>> > >>> > "Every thing has its own flow" >>> > >>> > _______________________________________________ >>> > Moose-dev mailing list >>> > [hidden email] >>> > https://www.iam.unibe.ch/mailman/listinfo/moose-dev >>> >>> -- >>> www.tudorgirba.com >>> >>> "It's not what we do that matters most, it's how we do it." >>> >>> >>> _______________________________________________ >>> Moose-dev mailing list >>> [hidden email] >>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev >> -- >> Nicolas Anquetil -- RMod team >> INRIA Lille Nord Europe >> >> _______________________________________________ >> Moose-dev mailing list >> [hidden email] >> https://www.iam.unibe.ch/mailman/listinfo/moose-dev > > > > -- > www.tudorgirba.com > > "Every thing has its own flow" -- www.tudorgirba.com "Every thing has its own flow" _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Thanks Doru, it is working now.
César Couto
On Fri, Jan 6, 2012 at 11:31 AM, Tudor Girba <[hidden email]> wrote: And here is a version that improves the situation a bit more: http://www.decom.cefetmg.br/cesar _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Free forum by Nabble | Edit this page |