Hi Johan,
On 18 Jan 2010, at 16:58, Johan Fabry wrote:
Hi all,
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:
http://www.moosetechnology.org/tools
Please send me your desired username to give you access.
Questions:
- 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
menu.
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.
Cheers,
Doru
<am.png>
The code is below:
----snip---
open
|browser colors colorizer|
"for aspect colors, both automatic assignment and manual selection
in menu"
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.
browser row:[:r|
r column: #models span:2 ;
column: #aspectsel span: 2;
column: [:c| c row: #buttons span: 4. c row:
#selectionstatus.]span: 2;
column: #hprop;
column: #wprop] span: 2.
browser transmit to: #mpanel; from: #models; andShow: [:a |
a mondrian painting: [:view :model|
model allNamespaces do: [:ns| ns currentShapeFor: view
withProperties: self].
view gridLayout.]].
browser transmit to: #models; andShow: [:a |
a stackedVerticallyArrangement.
a tree title: 'Available projects';
children: [:model | (SortedCollection sortBlock: [:x :y | x name
<= y name]) addAll: model allNamespaces asOrderedCollection;
yourself ];
act: [:tree | tree selection inspect ] on: $i entitled: 'Inspect';
format: [:model | (model name) copyReplaceAll: '::' with:'.' ]].
browser transmit to: #aspectsel; from: #models transformed: [:model
| |topmodel|
topmodel := model mooseModel = MooseModel root ifTrue: [model]
ifFalse:[model mooseModel].
topmodel allAspects do:[:asp | asp color ifNil: [asp color:
colorizer nextColor]].
topmodel allAspects ];
andShow: [:a|
a stackedVerticallyArrangement.
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];
category: 'Color']]].
browser transmit to: #buttons; andShow: [:a |
a actionList
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 accordionArrangement.
a list title: 'Classes Height'; display: self cprops;
allowDeselection.
a list title: 'Aspects Height'; display: self aprops;
allowDeselection.
a list title: 'Methods Height'; display: self mprops;
allowDeselection.
].
browser transmit to: #wprop; andShow: [:a |
a accordionArrangement.
a list title: 'Classes Width'; display: self cprops;
allowDeselection.
a list title: 'Aspects Width'; display: self aprops;
allowDeselection.
a list title: 'Methods Width'; display: self mprops;
allowDeselection.
].
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
----snip---
--
Johan Fabry
jfabry(a)dcc.uchile.cl -
http://dcc.uchile.cl/~jfabry
PLEIAD Lab - Computer Science Department (DCC) - University of Chile
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"No matter how many recipes we know, we still value a chef."