Thanks Doru, it is working now.
César Couto
On Fri, Jan 6, 2012 at 11:31 AM, Tudor Girba <tudor(a)tudorgirba.com> wrote:
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 <tudor(a)tudorgirba.com> 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
<nicolas.anquetil(a)inria.fr> 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 <tudor(a)tudorgirba.com>
>> > 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 <cesarfmc(a)gmail.com>
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
> > Moose-dev(a)iam.unibe.ch
> >
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
>
www.tudorgirba.com
>
> "Every thing has its own flow"
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev(a)iam.unibe.ch
>
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
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev --
Nicolas Anquetil -- RMod team
INRIA Lille Nord Europe
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
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
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev