Skip to content
Alexandre Bergel edited this page Apr 4, 2019 · 23 revisions

Welcome to the Roassal3 wiki!

Differences between Roassal2 and Roassal3

Here are the list of features of Roassal3:

  • Roassal3 supports elements nesting. This is an important aspect when composing
  • Roassal3 supports keyboard shortcuts zoom in/out. You can use @ RSControlsView on an RSView.

Technical considerations:

  • Roassal3 is independent from any rendering engine. Roassal3 and Trachel3 (shipped with Roassal3) build a model on which a visitor is run. That visitor has the responsibility to render the visualization.
  • Roassal3 will work for Athens and Sparta

Migrating from Roassal2 to Roassal3

  • Acronym namespace differs. In Roassal2, Roassal classes begins with RT, in Roassal3 classes begins with RS. In Roassal2, Trachel classes begins with TR, in Roassal3 they begins with TS.
  • RTBox new should be replaced with RSShapeBuilder box
  • RTLine edgeFrom: el1 to: el2 should be replaced with RSEdgeBuilder line from: el1; el2; edge.

For example, in Roassal2, if you wish to have some draggable boxes in a view, you could write:

"Example in Roassal2"
v := RTView new.
shape := RTBox new color: Color gray trans; size: #yourself.
elements := shape elementsOn: (30 to: 80 by: 10).
elements @ RTDraggable.
v add: elements.
RTGridLayout new gapSize: 10; on: elements.
elements @ (RTLabeled new color: Color blue).
v

Which displays:

Using Roassal3, you need to do:

"Example in Roassal3"
v := RSView new.
boxShape := RSShapeBuilder box 
	color: Color gray trans; 
	size: #yourself.

boxAndLabelShape := RSShapeBuilder composite 
	interactionDo: #draggable;
	interactionDo: #popup;
	shapes: [ :aNumber |
		| group | 
		group := TSGroup new.
		group add: (RSShapeBuilder label color: Color blue; elementOn: aNumber).
		group add: (boxShape elementOn: aNumber).
		RSVerticalLineLayout new gapSize: 0; center; on: group.
		group
	].

elements := boxAndLabelShape elementsOn: (30 to: 80 by: 10).

v addAll: elements.
RSGridLayout on: elements.

v @ RSControlsView.
v open

At that current state, Roassal3 is more verbose. However, it is significantly more expressive. In particular composite shapes are properly handled

Clone this wiki locally