Hi guys,
Using Pharo 6.1/Win here.
Is there any way to adjust a RTView canvas to a fixed size, say 620 x
744 px, before the elements gets added into the view?
This is what I've tried so far:
1) Empty canvas manually set to 620 x 744 px produces 1x1 image:
| view |
view := RTView new
setCanvas: (TRCanvas new extent: 620 @ 744; yourself);
yourself.
(RTCanvasExporter canvas: view canvas)
format: #png;
fileName: 'test_empty.png';
export.
2) Non-empty canvas manually set to 620 x 744 px produces 25x15 image:
| view elems |
view := RTView new
setCanvas: (TRCanvas new extent: 620 @ 744; yourself);
yourself.
elems := (RTBox new color: Color blue) elementsOn: (1 to: 5).
view addAll: elems.
RTGridLayout on: view elements.
(RTCanvasExporter canvas: view canvas)
format: #png;
fileName: 'test_5elems.png';
export.
3) Idem 2) adding #scale: 10 -> 250x150px ... #scale: 24.8 -> 620 px
| view elems |
view := RTView new
setCanvas: (TRCanvas new extent: 620 @ 744; yourself);
yourself.
elems := (RTBox new color: Color blue) elementsOn: (1 to: 5).
view addAll: elems.
RTGridLayout on: view elements.
(RTCanvasExporter canvas: view canvas)
format: #png;
scale: 12.4;
fileName: 'test_5elems_scaled.png';
export.
4) Adding #oversizedBy: to 3) finally makes the trick:
| view elems |
view := RTView new
setCanvas: (TRCanvas new extent: 620 @ 744; yourself);
yourself.
elems := (RTBox new color: Color blue) elementsOn: (1 to: 5).
view addAll: elems.
RTGridLayout on: view elements.
(RTCanvasExporter canvas: view canvas)
format: #png;
scale: 24.8;
oversizedBy: 0 @ 15;
fileName: 'test_5elems_scale2_osized.png';
export.
- So setting manually canvas extent doesn't have any effect?
- Any way also to set a fixed margin or padding size (distance between
image element and border)?
Cheers,
Hernán
Through a jdt2famix parsed model of an application I'm trying to follow the
usage of a (FAMIX)Parameter. How can this be done?
>From a method parameter I can access its enclosing method and from there on
find invocations within that method for example. The problem is that there
does not seem to be a direct way to retrieve the fact that a parameter is
part of a method invocation (both direct or as part of an expression). It
seems I have to parse a piece of the source code (the invocation signature
to be precise). This does not feel okay. Can anyone give some pointers on
how to find parameter usage without resorting to parsing the source code (if
such a solution exists)?
(Googling didn't help so far, or I'm not using the right search parameters
;-)
Example Java source code, for which I want to follow the 'x' parameter:
void startPoint(String x, int y) {
// Here is first 'simple' parameter usage
this.doSomething(x, y);
// Here parameter is part of an expression
this.that.doAnother("[" + x + "]");
// Parameter is part of expression again (twice)
this.doLast(x.substring(0, y) + x.substring(y + 8));
}
Cheers,
Erik
--
Sent from: http://forum.world.st/Moose-f1310756.html
Greetings Fellow Smalltalkers,
We would like to invite you to Camp Smalltalk, March 29th – March 31st
2019 in Charlotte, North Carolina. Event details and registration
info are available at the following link: Camp Smalltalk Charlotte 2019
<https://www.eventbrite.com/e/camp-smalltalk-charlotte-2019-tickets-52380940…>
Hope to see you there!
--
Mariano
A question on normalizing edges in RTMondrian:
I want to show the "strength" of the edges, computed according to some
metric.
How can I normalize for example the color of the edge to reflect this
"strength" ?
Or maybe, normalize the "boldness" of the edge ?
nicolas
--
Nicolas Anquetil
RMod team -- Inria Lille