Hi all,
first of all: Thanks Doru for implementing the new features! They are very useful to me.
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.
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. - 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? Also, if no selection at all is made I would like to show that in the box (now the box is removed). - 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?
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@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile