Roassal: Locate a legend text below a line

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Roassal: Locate a legend text below a line

hernanmd
Hi everybody,

I have this complicated code to draw a line with separators at both ends, I try to put the legend text with #below but nothing is changed :

| view e1 e2 l1 label |

view := RTView new.

label := RTLabeled new
    color: Color black;
    below;
    text: 'Class IIa';
    yourself.

e1 := RTBox new element
    color: Color black;
    height: 10;
    width: 1;
    yourself.
e2 := RTBox new element
    color: Color black;
    height: 10;
    width: 1;
    yourself.
   
l1 := RTStyledMultiLine new
    color: Color black;
    solidLine;
    edgeFrom: e1 to: e2.

view addAll: (Array with: e1 with: e2 with: l1).
l1 @ label.

RTHorizontalLineLayout new on: view elements.
view elements pairsDo: [ :a :b | b translateBy: 100 @ 0 ].
^ view

Any suggestion?

Hernán


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal: Locate a legend text below a line

akevalion
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Roassal: Locate a legend text below a line

hernanmd
It works nicely!
Thank you Milton.

Cheers,

Hernan

2017-02-20 14:48 GMT-03:00 milton mamani <[hidden email]>:
Hi Hernán

Can you try this piece of code:

.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=

| view box e1 e2 l1 label anchor |

view := RTView new.

label := RTLabel new elementOn: 'Class IIa'.

box := RTBox new 
color: Color black;
height: 10;
width: 1.
e1 := box element @ RTDraggable.
e2 := box element @ RTDraggable.

l1 := RTStyledMultiLine new
    color: Color black;
    solidLine;
    edgeFrom: e1 to: e2.
view addAll: (Array with: e1 with: e2 with: l1 with: label).
anchor := RTAnchorConstraint new 
element: label;
edge: l1;
balance: 0.5;
minDistance: -2;
build.
RTHorizontalLineLayout new on: view elements.
view elements pairsDo: [ :a :b | b translateBy: 100 @ 0 ].
^ view

.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=

Cheers,
Milton

2017-02-20 1:51 GMT-03:00 Hernán Morales Durand <[hidden email]>:
Hi everybody,

I have this complicated code to draw a line with separators at both ends, I try to put the legend text with #below but nothing is changed :

| view e1 e2 l1 label |

view := RTView new.

label := RTLabeled new
    color: Color black;
    below;
    text: 'Class IIa';
    yourself.

e1 := RTBox new element
    color: Color black;
    height: 10;
    width: 1;
    yourself.
e2 := RTBox new element
    color: Color black;
    height: 10;
    width: 1;
    yourself.
   
l1 := RTStyledMultiLine new
    color: Color black;
    solidLine;
    edgeFrom: e1 to: e2.

view addAll: (Array with: e1 with: e2 with: l1).
l1 @ label.

RTHorizontalLineLayout new on: view elements.
view elements pairsDo: [ :a :b | b translateBy: 100 @ 0 ].
^ view

Any suggestion?

Hernán


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal: Locate a legend text below a line

abergel
In reply to this post by akevalion
Here is the screenshot to see what it looks like :-)

On Feb 20, 2017, at 2:48 PM, milton mamani <[hidden email]> wrote:

Hi Hernán

Can you try this piece of code:

.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=

| view box e1 e2 l1 label anchor |

view := RTView new.

label := RTLabel new elementOn: 'Class IIa'.

box := RTBox new 
color: Color black;
height: 10;
width: 1.
e1 := box element @ RTDraggable.
e2 := box element @ RTDraggable.

l1 := RTStyledMultiLine new
    color: Color black;
    solidLine;
    edgeFrom: e1 to: e2.
view addAll: (Array with: e1 with: e2 with: l1 with: label).
anchor := RTAnchorConstraint new 
element: label;
edge: l1;
balance: 0.5;
minDistance: -2;
build.
RTHorizontalLineLayout new on: view elements.
view elements pairsDo: [ :a :b | b translateBy: 100 @ 0 ].
^ view

.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=

Cheers,
Milton

2017-02-20 1:51 GMT-03:00 Hernán Morales Durand <[hidden email]>:
Hi everybody,

I have this complicated code to draw a line with separators at both ends, I try to put the legend text with #below but nothing is changed :

| view e1 e2 l1 label |

view := RTView new.

label := RTLabeled new 
    color: Color black; 
    below; 
    text: 'Class IIa';
    yourself.

e1 := RTBox new element
    color: Color black;
    height: 10;
    width: 1;
    yourself.
e2 := RTBox new element
    color: Color black;
    height: 10;
    width: 1;
    yourself.
    
l1 := RTStyledMultiLine new
    color: Color black;
    solidLine;
    edgeFrom: e1 to: e2.

view addAll: (Array with: e1 with: e2 with: l1).
l1 @ label.

RTHorizontalLineLayout new on: view elements.
view elements pairsDo: [ :a :b | b translateBy: 100 @ 0 ].
^ view

Any suggestion?

Hernán


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal: Locate a legend text below a line

hernanmd
Alex, my output looks different, maybe you changed something?



2017-02-20 16:08 GMT-03:00 Alexandre Bergel <[hidden email]>:
Here is the screenshot to see what it looks like :-)

On Feb 20, 2017, at 2:48 PM, milton mamani <[hidden email]> wrote:

Hi Hernán

Can you try this piece of code:

.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=

| view box e1 e2 l1 label anchor |

view := RTView new.

label := RTLabel new elementOn: 'Class IIa'.

box := RTBox new 
color: Color black;
height: 10;
width: 1.
e1 := box element @ RTDraggable.
e2 := box element @ RTDraggable.

l1 := RTStyledMultiLine new
    color: Color black;
    solidLine;
    edgeFrom: e1 to: e2.
view addAll: (Array with: e1 with: e2 with: l1 with: label).
anchor := RTAnchorConstraint new 
element: label;
edge: l1;
balance: 0.5;
minDistance: -2;
build.
RTHorizontalLineLayout new on: view elements.
view elements pairsDo: [ :a :b | b translateBy: 100 @ 0 ].
^ view

.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=

Cheers,
Milton

2017-02-20 1:51 GMT-03:00 Hernán Morales Durand <[hidden email]>:
Hi everybody,

I have this complicated code to draw a line with separators at both ends, I try to put the legend text with #below but nothing is changed :

| view e1 e2 l1 label |

view := RTView new.

label := RTLabeled new 
    color: Color black; 
    below; 
    text: 'Class IIa';
    yourself.

e1 := RTBox new element
    color: Color black;
    height: 10;
    width: 1;
    yourself.
e2 := RTBox new element
    color: Color black;
    height: 10;
    width: 1;
    yourself.
    
l1 := RTStyledMultiLine new
    color: Color black;
    solidLine;
    edgeFrom: e1 to: e2.

view addAll: (Array with: e1 with: e2 with: l1).
l1 @ label.

RTHorizontalLineLayout new on: view elements.
view elements pairsDo: [ :a :b | b translateBy: 100 @ 0 ].
^ view

Any suggestion?

Hernán


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev

MHC_Class_range.png (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Roassal: Locate a legend text below a line

abergel
I drag and dropped one extremity.

Alexandre


> On Feb 20, 2017, at 4:54 PM, Hernán Morales Durand <[hidden email]> wrote:
>
> Alex, my output looks different, maybe you changed something?
>
>
>
> 2017-02-20 16:08 GMT-03:00 Alexandre Bergel <[hidden email]>:
> Here is the screenshot to see what it looks like :-)
> <Screen Shot 2017-02-20 at 4.07.40 PM.png>
>
>> On Feb 20, 2017, at 2:48 PM, milton mamani <[hidden email]> wrote:
>>
>> Hi Hernán
>>
>> Can you try this piece of code:
>>
>> .=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=
>>
>> | view box e1 e2 l1 label anchor |
>>
>> view := RTView new.
>>
>> label := RTLabel new elementOn: 'Class IIa'.
>>
>> box := RTBox new
>> color: Color black;
>> height: 10;
>> width: 1.
>> e1 := box element @ RTDraggable.
>> e2 := box element @ RTDraggable.
>>
>> l1 := RTStyledMultiLine new
>>     color: Color black;
>>     solidLine;
>>     edgeFrom: e1 to: e2.
>> view addAll: (Array with: e1 with: e2 with: l1 with: label).
>> anchor := RTAnchorConstraint new
>> element: label;
>> edge: l1;
>> balance: 0.5;
>> minDistance: -2;
>> build.
>> RTHorizontalLineLayout new on: view elements.
>> view elements pairsDo: [ :a :b | b translateBy: 100 @ 0 ].
>> ^ view
>>
>> .=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=
>>
>> Cheers,
>> Milton
>>
>> 2017-02-20 1:51 GMT-03:00 Hernán Morales Durand <[hidden email]>:
>> Hi everybody,
>>
>> I have this complicated code to draw a line with separators at both ends, I try to put the legend text with #below but nothing is changed :
>>
>> | view e1 e2 l1 label |
>>
>> view := RTView new.
>>
>> label := RTLabeled new
>>     color: Color black;
>>     below;
>>     text: 'Class IIa';
>>     yourself.
>>
>> e1 := RTBox new element
>>     color: Color black;
>>     height: 10;
>>     width: 1;
>>     yourself.
>> e2 := RTBox new element
>>     color: Color black;
>>     height: 10;
>>     width: 1;
>>     yourself.
>>    
>> l1 := RTStyledMultiLine new
>>     color: Color black;
>>     solidLine;
>>     edgeFrom: e1 to: e2.
>>
>> view addAll: (Array with: e1 with: e2 with: l1).
>> l1 @ label.
>>
>> RTHorizontalLineLayout new on: view elements.
>> view elements pairsDo: [ :a :b | b translateBy: 100 @ 0 ].
>> ^ view
>>
>> Any suggestion?
>>
>> Hernán
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev
>
>
> <MHC_Class_range.png>_______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev