Hi!
I’ve just introduced a new class TRExtensibleLabelShape and TRLabelShape. This will ease the problem we are experiencing with using labels in a composed shape.
I would like now to discuss about how to compose shapes. This has been a big discussion for at least 5 years. I propose a solution in this email, I hope this will make most of us happy :-)
Consider the example:
-=-=-=-=-=-=-=-=
| v s1 s2 c es |
v := RTView new.
s1 := (RTEllipse new size: #yourself; color: (Color blue alpha: 0.4)).
s2 := (RTLabel new text: 'Hello World'; height: 10).
c := RTCompositeShape new
shape1: s1;
shape2: s2;
offset2: 0 @ -30.
es := c elementsOn: #(30 60 80).
es @ RTDraggable.
v addAll: es.
es when: TRMouseClick do: [ :evt | evt element remove. v signalUpdate ].
RTHorizontalLineLayout on: v elements.
v open
-=-=-=-=-=-=-=-=
This is the output:
If you click on an element, then the element with its label is properly removed. Yupi! Leo will be happy with that :-)
The reason is that how can I specify to have s2 above s1? What should I put in offset2 ? Instead of fiddling with blocks like [:shape1 :shape2 :element | … ] I have introduced RTHorizontalCompositeShape and RTVerticalCompositeShape just to try whether it make sense or not.
We can have
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| v s1 s2 c es |
v := RTView new.
s1 := (RTEllipse new size: #yourself; color: (Color blue alpha: 0.4)).
s2 := (RTLabel new text: 'Hello World'; height: 10).
c := RTHorizontalCompositeShape new
shape1: s1;
shape2: s2.
es := c elementsOn: #(30 60 80).
es @ RTDraggable.
v addAll: es.
RTHorizontalLineLayout on: v elements.
v
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Replacing Horizontal by Vertical works as expected.
You can also compose these things. Look at that:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| v s1 s2 c es |
v := RTView new.
s1 := (RTEllipse new size: #yourself; color: (Color blue alpha: 0.4)).
s2 := (RTLabel new text: 'Hello World'; height: 10).
c2 := RTVerticalCompositeShape new
shape1: s1;
shape2: s2.
c := RTHorizontalCompositeShape new
shape1: s1;
shape2: c2.
es := c elementsOn: #(30 60 80).
es @ RTDraggable.
v addAll: es.
RTHorizontalLineLayout on: v elements.
v
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Are we happy with RTVerticalCompositeShape, RTHorizontalCompositeShape and RTCompositeShape ?
If yes, then RTLabelling (and its problem of passing the view along :-) will be obsolete.
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Hi all,
I have the following situation: a node named ‘one’ and a node named ‘two’, I want to draw an arrow ‘onetwo' from one to two, and ‘twoone' from two to one. Nodes are ellipses with size 30, and a label. Arrows are an edge + line + arrow + label construct. So I get the image like below, which raises two2 questions.
First question: how can I make the arrows go to the border of the ellipse, instead of the center?
Second question: as a human I would draw each of the two arrows with a curve: one curving up and one curving down so that they (and their labels) do not overlap. Can I do something like this in Roassal? Because now readability is far from optimal.
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry - http://pleiad.cl/~jfabry
PLEIAD lab - Computer Science Department (DCC) - University of Chile
Hi,
We (me, Andrei, and Doru) are happy to present a new horizontal scroll
widget for Glamour: the GTPager.
It's aim is it to provide more visual feedback when working with a finder
like widget.
It is available in the latest Moose version. You can try a simple example:
GLMBasicExamples new simplePager openOn: 42
[image: Inline-Bild 1]
Also, it is used in GTInspector, so for a real world example just open an
inspector or a workspace:
[image: Inline-Bild 2]
Cheers,
Alex