On 18 Jan 2010, at 16:58, Johan Fabry wrote:
first of all: Thanks Doru for implementing the new features! They
are very useful to me.
I am glad.
Below is a screenshot of the AspectMaps UI that is using these
features. I have a bunch of questions related to this and I would be
very grateful if you could help me out. The code of the UI is also
below. Very big method, I know, but I did it this way to avoid
ambiguities in this mail.
Pretty cool. It would be cool to add a picture like this in a
dedicated page under:
Please send me your desired username to give you access.
- How do I update the top mondrian panel using the new update
mechanism? I want it to redraw itself completely when some of the
buttons are pressed and on some of the menu actions of the aspects
I do not understand. The update mechanism is for updating a
presentation based on changes in the model. If you want to deal with
the UI, you do it with a transmission.
- The last 2 columns specify the metrics used in the polymetric
view. With a transmission I always get the last selections made, but
I need to know all selections made in that column so I can print it
in the selectionstatus text box. How is this possible?
A pane models one state: one entity, one selection etc. If you want
multiple states, you need multiple panes :). So, you need multiple
panes there and then have a transmission from all of them.
Also, if no selection at all is made I would like to show that in
the box (now the box is removed).
Unfortunately, that is not possible.
- The last 3 columns actually do not use any input, but I specify
them with "transmit to: ; andShow:" Is there a cleaner way to do this?
Nope. That is the desired way. Perhaps I will add a shortcut method,
but until then, this is Ok.
The code is below:
|browser colors colorizer|
"for aspect colors, both automatic assignment and manual selection
colorizer := MOCircularColors new.
colors := OrderedCollection new.
1 to: 10 do: [:num| colors add: colorizer nextColor].
browser := GLMTabulator new.
browser title: 'AspectMaps Window'.
browser row: #mpanel span: 3.
r column: #models span:2 ;
column: #aspectsel span: 2;
column: [:c| c row: #buttons span: 4. c row:
column: #wprop] span: 2.
browser transmit to: #mpanel; from: #models; andShow: [:a |
a mondrian painting: [:view :model|
model allNamespaces do: [:ns| ns currentShapeFor: view
browser transmit to: #models; andShow: [:a |
a tree title: 'Available projects';
children: [:model | (SortedCollection sortBlock: [:x :y | x name
<= y name]) addAll: model allNamespaces asOrderedCollection;
act: [:tree | tree selection inspect ] on: $i entitled: 'Inspect';
format: [:model | (model name) copyReplaceAll: '::' with:'.' ]].
browser transmit to: #aspectsel; from: #models transformed: [:model
topmodel := model mooseModel = MooseModel root ifTrue: [model]
topmodel allAspects do:[:asp | asp color ifNil: [asp color:
topmodel allAspects ];
a tree title: 'Aspects in Project';
format: [:asp | Text string: ((asp show ifTrue: ['(ON) ']
ifFalse: ['(OFF) ']),
asp name) attribute: (TextColor color: asp color).];
act: [:tree | tree inspect ] on: $i entitled: 'Inspect (i)';
act: [:tree | |asp ann|
asp := tree selection. asp show: (asp show not).
tree update.] on: $t entitled: 'Toggle On/Off (t)';
actions: [:tree | colors collect: [:col | GLMAction new title:
col asString; action: [tree selection color: col. tree update];
browser transmit to: #buttons; andShow: [:a |
act: [:entity | entity inspect] entitled: 'Vizualize';
act: [:entity | entity inspect] entitled: 'Max Zoom Out';
act: [:entity | entity inspect] entitled: 'Max Zoom In';
act: [:entity | entity inspect] entitled: 'Multiple Aspects Zoom';
act: [:entity | entity inspect] entitled: 'Zoom by Query'.
browser transmit to: #hprop; andShow: [:a |
a list title: 'Classes Height'; display: self cprops;
a list title: 'Aspects Height'; display: self aprops;
a list title: 'Methods Height'; display: self mprops;
browser transmit to: #wprop; andShow: [:a |
a list title: 'Classes Width'; display: self cprops;
a list title: 'Aspects Width'; display: self aprops;
a list title: 'Methods Width'; display: self mprops;
browser transmit to: #selectionstatus; from: #hprop; from: #wprop;
andShow: [:a |
a text display: [:x :y| x asString , ' ', y asString]; allowNil].
browser openOn: MooseModel root allModels asOrderedCollection
jfabry(a)dcc.uchile.cl - http://dcc.uchile.cl/~jfabry
PLEIAD Lab - Computer Science Department (DCC) - University of Chile
Moose-dev mailing list
"No matter how many recipes we know, we still value a chef."