The class RTView
belongs to Roassal2. A class that begins with RT
belongs to Roassal2. In Roassal, classes begins with RS
.
The book http://agilevisualization.com is about Roassal2. Very little can be reused from the book for Roassal. A new edition of Agile Visualization will appear during 2020.
We provide a set of exporter in https://github.com/pharo-graphics/RoassalExporters We support PDF, SVG, MOV, and MP4. The last two file format are useful for animations.
You need to have the exporters https://github.com/pharo-graphics/RoassalExporters The following code exports a visualization as a PDF file, using letter size:
c := RSCanvas new.
lbls := RSGroup new.
Collection withAllSubclassesDo: [ :cls |
lbl := RSLabel new text: cls name; model: cls.
lbls add: lbl ].
c addAll: lbls.
RSNormalizer fontSize
shapes: lbls;
normalize: #numberOfMethods.
c @ RSHierarchyPacker.
c extent: (RSPageExtent letter).
c when: RSExtentChangedEvent do: [ :evt |
c camera zoomToFit: c extent.
].
c pdfExporter
fileName: '/tmp/test3.pdf';
export.
GTInspector is a moldable inspector that is part of Pharo and was developed as part of the Glamorous Toolkit project. GTInspector offers a way to hook visualization in it.
MyClass>>gtInspectorViewIn: composite
<gtInspectorPresentationOrder: -10>
composite Roassal
title: 'View';
initializeCanvas: [ | c |
c := RSCanvas new.
...
c ]
It is a good practice to have initializeCanvas: [ self visualize ]
and define a method visualize
in MyClass
.
Either way, you can now inspect an instance of MyClass
.