why not? I'm fixing now centered and friend
Because relying on Morph widget will complicate generation of html. Especially since this is not necessary as the script below shows. Better to improve Mondrian than to make it rely on Morph.
Alexandre
On May 25, 2011, at 6:15 PM, Alexandre Bergel wrote:
Thanks Stef. However, I am not sure we should rely on TextMorph in Mondrian. Try the following and let me know what you think:
-=-=-=-=-=-=-=-=-=-=-=-= "Simple example of a distribution map. Green methods are short. Orange are long. Red are very long"
| classes d | d := IdentityDictionary new. classes := Collection withAllSubclasses. classes do: [:aClass | aClass methods do: [:m | d at: m put: m getSource lineCount ] ].
view shape rectangle withoutBorder. view nodes: classes forEach: [ :each | view shape label. view node: each. view node: each forIt: [ view shape rectangle size: 12; if: [:m | (d at: m) < 5 ] fillColor: Color green; if: [:m | (d at: m) >= 5 and: [ (d at: m) < 25 ] ] fillColor: Color orange; if: [:m | (d at: m) >= 25 ] fillColor: Color red. view interaction popupView: [ :el :myView | myView node: 'source' forIt: [myView shape label. myView node: el getSource] ]. view nodes: (each methods sortedAs: [:m | (d at: m) ]). view gridLayout gapSize: 2 ]. view verticalLineLayout ].
view gridLayout
"view interaction popupText" => invoke the Popup in Morph "view interaction popupView: [ :el :myView | ... ]" => open a new view
I think popupText: should be redirected to a popupView: Tell me if you like this
Cheers, Alexandre
On 25 May 2011, at 11:25, Stéphane Ducasse wrote:
Ok now can we have that in Mondrian.... I really want to get source method as fly by help everywhere :)
'khkjhjkhjkhjkh kjhj kjhkjhkjh kjh kjhkjh kjh jh jh jh jh kjh kjh ' asTextMorph openInWorld inspect
after
self selectAll ; chooseEmphasisOrAlignment
So now for you :)
| t | t := 'khkjhjkhjkhjkh kjhj kjhkjhkjh kjh kjhkjh kjh jh jh jh jh kjh kjh ' asTextMorph. t openInWorld. t selectAll; changeFormatting: #rightFlush. t inspect
if you add this little method (which soon will be in your favorite environment) you get it. TextMorph>>changeFormatting: aSymbol "leftFlush centered rightFlush justified "
self editor applyAttribute: (TextAlignment perform: aSymbol). self updateFromParagraph
Stef _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev