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(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch