[Glamour] default selection in ListPresentation
by Cyrille Delaunay
Hello,
Is there a way to set a default selection to a list presentation? so that
when I open the browser, the morphic list has already a value selected.
I tried that:
|tmpBrowser|
tmpBrowser := GLMTabulator new.
tmpBrowser row: #list.
tmpBrowser transmit to: #list; andShow: [:a |
a list
display: [:input | input];
selection: #a;
yourself
].
tmpBrowser openOn: #( b c d v a d f r).
but the list still open with nothing selected
5 years, 6 months
Theme aware-ish TRMorph
by Peter Uhnák
Hi,
since I wanted to use DarkTheme I played around with TRMorph (since seeing
giant white rectangle in dark theme is not very nice).
What I have done is moved the background color setting to `surface clear:`
(instead of the original aCanvas fillRectangle).
And then if theme background luminance is dark (>0.5), I invert all the
colors in the visualization.
For dark theme the background is black, and not the theme background - at
least to me it seems that black is much clearer.
Is this something that could be incorporated?
And the modified code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"protocol: drawing"
TRMorph>>drawOn: aCanvas
"aCanvas is a FormCanvas"
self checkSession.
"aCanvas fillRectangle: bounds color: trachelCanvas color."
trachelCanvas playAnimations.
"The drawing has to be done when a change in the shapes occured or when
there is an animation."
surface drawDuring: [:cs |
surface clear: trachelCanvas color.
"We display the elements that are subject to the camera"
cs pathTransform
translateBy: (self extent / 2) asFloatPoint;
scaleBy: trachelCanvas camera scale asFloat;
translateBy: trachelCanvas camera position negated asFloatPoint.
trachelCanvas shapes do: [ :trachelShape |
trachelShape drawOn: cs.
].
"We display the elements that are _NOT_ subject to the camera"
cs pathTransform loadIdentity scaleBy: 1.001.
trachelCanvas fixedShapes do: [ :trachelShape |
trachelShape drawOn: cs.
].
].
self theme backgroundColor luminance < 0.5 ifTrue: [
surface drawDuring: [ :cs |
cs paintMode restoreAfter: [
cs setPaint: Color white.
cs paintMode difference.
cs drawShape: (0 @ 0 extent: surface extent)
]
]
].
"aCanvas translucentImage: surface asForm at: self bounds origin."
"asForm creates a new Form, which is likely to be expensive. This can be
cached"
aCanvas image: surface asForm at: self bounds origin sourceRect: (0 @ 0
extent: surface extent) rule: 34.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 years, 7 months
broken Roassal2Spec Adapter
by Peter Uhnák
Hi,
apparently we broke MorphicRoassalAdapter when cleaning Spec, I attached a
fix.
However my question is - does anybody (except us) actually use the
Roassal2Spec package? Because otherwise we could clean it a bit. For
example I'm not sure of the use case of script:/lastEvent:.
Peter
7 years, 9 months
Parallel coordinates like diagram
by Manfred Kröhnert
Hi everyone,
some time ago I saw a diagram consisting of two columns of words and lines
showing associations between the words in both columns.
It looked similar to the "parallel coordinates" diagram from this link:
http://homes.cs.washington.edu/~jheer/files/zoo/ but with only two columns.
Now, I am not sure if I saw this in an email on a Pharo or Moose list and
wanted to ask if it is already possible to create such diagrams with
Roassal.
Thank you very much,
Manfred
7 years, 10 months
Weird lines implementation
by Yuriy Tymchuk
Hi everyone,
I guess because of a rapid evolution some parts of Roassal are weird. For example RTAbstractLine>>#updateFor:trachelShape: implements the shape drawing, so theoretically RTLine has to only override #trachelShapeClass to return TRLine. Instead RTLine overrides #trachelShapeFor: and does it incorrectly, because width cannot be used as a block but only as a number.
We have to handle this somehow, because 1) RTLine works incorrectly. 2) RTLine ignores the implementation strategy coded into RTAbstractLine.
Uko
7 years, 12 months
Following the mouse cursor in Grapher
by Alexandre Bergel
Hi!
I relaxed a bit by implementing something that was missing in Grapher.
Consider the following code:
-=-=-=-=-=-=-=-=-=-=-=-=
b := RTGrapher new.
ds := RTDataSet new.
ds points: #(5 10 6 2 -2.5).
b add: ds.
“below is the magic line"
b addDecorator: RTCursorFollower new.
b
-=-=-=-=-=-=-=-=-=-=-=-=
This “magic line” add two bar that follows the mouse cursor. Here is a screenshot:
Here is on a larger example:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| methods trachelMethods b ds |
methods := Collection withAllSubclasses flatCollect: #rtmethods.
trachelMethods := TRObject withAllSubclasses flatCollect: #rtmethods.
b := RTGrapher new.
b extent: 200 @ 200.
"Data set 1"
ds := RTDataSet new.
ds interaction popup.
ds dotShape circle color: (Color red alpha: 0.3).
ds points: methods.
ds x: #numberOfLinesOfCode.
ds y: [ :m | m getSource size ].
b add: ds.
"Data set 2"
ds := RTDataSet new.
ds interaction popup.
ds dotShape circle color: (Color blue alpha: 0.3).
ds points: trachelMethods.
ds x: #numberOfLinesOfCode.
ds y: [ :m | m getSource size ].
b add: ds.
b axisX withThousandsSeparator; title: 'LOC'.
b axisY noDecimal; title: 'Size'.
b addDecorator: RTCursorFollower new.
b build.
^ b view
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Maybe this cursor follower should be per default in all produced chart. Any opinion?
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
8 years
Script of the day
by Alexandre Bergel
Hi!
Just to share a couple of experiment. I have tried the following in a playground:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
b := RTMondrian new.
b shape rectangle
if: [ :aFile | aFile path basename beginsWith: '.' ] color: Color red.
b nodes: FileLocator documents allChildren.
b edges connectFrom: #parent.
b normalizer
normalizeSize: #size using: #sqrt.
b layout tree.
b
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
It shows a tree of the file system. Thanks to GT, simply clicking on a file may show you the content and other things.
You can also use the cluster layout:
I have tried this on OS X, since the pointed folder is ~/Documents.
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
8 years
New features on MooseQuery
by Anne Etien
Hi,
Yesterday we developed two new features in MooseQuery:
- the toScope: method to go down in the containment tree. It is the opposite of atScope: that goes up. Both methods work the same way: ((classA queryIncoming: FAMIXInvocation) atScope: FAMIXClass) toScope: FAMIXMethod. This query uses the new API and returns the methods of the classes containing the methods sources of the incoming FAMIXInvocation of classA.
- the ability to query the MooseGroups. Thanks to this new feature, it is possible to query directly the model or any MooseGroup resulting from a selection or an operation (union, intersection, difference…) of several MooseGroups.
A full documentation’s coming, but certainly not before the end of the summer.
Cheers,
Jean-Christophe and Anne
8 years