Re: [Pharo-dev] Starting with Roassal 2

2014-09-12 Thread Juraj Kubelka
Yes, you can use SVG path as a shape for an element. What you chose really 
depends on your objective. If you want to draw nodes (elements) and connect 
them with edges (lines), I guess, the preferred API is Roassal2.

On Sep 12, 2014, at 7:02 PM, kilon alios  wrote:

> ah thank you very much, thats exactly what I was looking for. I will study 
> Trachel too.  I also found that I can do something similar using a SVG path 
> with Roassal. 
> 
> On Sat, Sep 13, 2014 at 12:58 AM, Juraj Kubelka  
> wrote:
> I think the intention of Roassal lines is to be connected with elements. If 
> you want only draw lines without any connection to elements, use directly 
> Trachel. I guess
> 
> -=-=-=-
> | v line |
> v := RTView new.
> line := TRLineShape new from: 0@0 to: 100@100 color: Color blue.
> v canvas addShape: line.
> ^ v open
> -=-=-=-
> 
> Cheers,
> Juraj
> 
> On Sep 12, 2014, at 6:53 PM, kilon alios  wrote:
> 
>> well thats not an one liner and you still connect elements with it. I just 
>> wanted to pass coordinates to a line and draw it. So I would prefer it if I 
>> could pass points instead of elements. 
>> 
>> On Sat, Sep 13, 2014 at 12:38 AM, Juraj Kubelka  
>> wrote:
>> OK, then you can write:
>> 
>> -=-=-=-
>> | v elements edge |
>> v := RTView new.
>> elements := (RTEllipse new
>>  size: #yourself;
>>  color: Color red) + RTLabel elementsOn: #(10 20).
>> edge := RTDirectedLine new
>>  color: Color blue;
>>  edgeFrom: elements first to: elements second.
>> v
>>  addAll: elements;
>>  add: edge.
>> RTGridLayout on: elements.
>> elements @ RTDraggable.
>> ^ v open
>> -=-=-
>> 
>> Cheers,
>> Juraj
>> 
>> On Sep 12, 2014, at 6:30 PM, kilon alios  wrote:
>> 
>>> yes i know about the example of a line connecting with other shapes. I 
>>> wanted just a simple line by itself starting from one point and ending to 
>>> another in a single line of code.
>>> 
>>> On Sat, Sep 13, 2014 at 12:26 AM, Juraj Kubelka  
>>> wrote:
>>> I have checked RTDirectedLine and it is not supposed to use the way you 
>>> want. Basically RTEdge is the object you want to manipulate with.
>>> 
>>> I do not know what is the objective of your example. But there is way how 
>>> you could write it.
>>> 
>>> -=-=-
>>> | v elements models |
>>> models := (10 to: 60 by: 1).
>>> v := RTView new.
>>> elements := (RTEllipse new size: #yourself; color: Color red) + RTLabel 
>>> elementsOn: models.
>>> v addAll: elements.
>>> RTEdge buildEdgesFromObjects: models from: #yourself to: [ :i | i // 2 ] 
>>> inView: v.
>>> RTGridLayout on: elements.
>>> elements @ RTDraggable.
>>> v @ RTDraggableView.
>>> v canvas color: Color black.
>>> v open.
>>> -=-=-
>>> 
>>> Cheers,
>>> Juraj
>>> 
>>> On Sep 12, 2014, at 5:03 PM, kilon alios  wrote:
>>> 
>>> > Ok here comes the first question
>>> >
>>> > how I change the background color of RTView ?
>>> >
>>> > also
>>> >
>>> > when I do this
>>> >
>>> > v := RTView new.
>>> > shape := RTEllipse new size: 20; color: Color red. shape := shape + 
>>> > RTLabel.
>>> > es := shape elementOn:'hello'. v add: es.
>>> > line := RTDirectedLine new pointsFrom: 20@20 To: 30@30.
>>> > es2 := line element.v add: es2.
>>> > es @ RTDraggable.
>>> > v @ RTDraggableView .
>>> > v open.
>>> >
>>> > I am getting an error
>>> >
>>> > MNU Array >> element
>>> >
>>> > why ?
>>> >
>>> 
>>> 
>>> 
>> 
>> 
> 
> 



Re: [Pharo-dev] Starting with Roassal 2

2014-09-12 Thread kilon alios
ah thank you very much, thats exactly what I was looking for. I will study
Trachel too.  I also found that I can do something similar using a SVG path
with Roassal.

On Sat, Sep 13, 2014 at 12:58 AM, Juraj Kubelka 
wrote:

> I think the intention of Roassal lines is to be connected with elements.
> If you want only draw lines without any connection to elements, use
> directly Trachel. I guess
>
> -=-=-=-
> | v line |
> v := RTView new.
> line := TRLineShape new from: 0@0 to: 100@100 color: Color blue.
> v canvas addShape: line.
> ^ v open
> -=-=-=-
>
> Cheers,
> Juraj
>
> On Sep 12, 2014, at 6:53 PM, kilon alios  wrote:
>
> well thats not an one liner and you still connect elements with it. I just
> wanted to pass coordinates to a line and draw it. So I would prefer it if I
> could pass points instead of elements.
>
> On Sat, Sep 13, 2014 at 12:38 AM, Juraj Kubelka 
> wrote:
>
>> OK, then you can write:
>>
>> -=-=-=-
>> | v elements edge |
>> v := RTView new.
>> elements := (RTEllipse new
>> size: #yourself;
>> color: Color red) + RTLabel elementsOn: #(10 20).
>> edge := RTDirectedLine new
>> color: Color blue;
>> *edgeFrom: elements first to: elements second.*
>> v
>> addAll: elements;
>> add: edge.
>> RTGridLayout on: elements.
>> elements @ RTDraggable.
>> ^ v open
>> -=-=-
>>
>> Cheers,
>> Juraj
>>
>> On Sep 12, 2014, at 6:30 PM, kilon alios  wrote:
>>
>> yes i know about the example of a line connecting with other shapes. I
>> wanted just a simple line by itself starting from one point and ending to
>> another in a single line of code.
>>
>> On Sat, Sep 13, 2014 at 12:26 AM, Juraj Kubelka 
>> wrote:
>>
>>> I have checked RTDirectedLine and it is not supposed to use the way you
>>> want. Basically RTEdge is the object you want to manipulate with.
>>>
>>> I do not know what is the objective of your example. But there is way
>>> how you could write it.
>>>
>>> -=-=-
>>> | v elements models |
>>> models := (10 to: 60 by: 1).
>>> v := RTView new.
>>> elements := (RTEllipse new size: #yourself; color: Color red) + RTLabel
>>> elementsOn: models.
>>> v addAll: elements.
>>> RTEdge buildEdgesFromObjects: models from: #yourself to: [ :i | i // 2 ]
>>> inView: v.
>>> RTGridLayout on: elements.
>>> elements @ RTDraggable.
>>> v @ RTDraggableView.
>>> v canvas color: Color black.
>>> v open.
>>> -=-=-
>>>
>>> Cheers,
>>> Juraj
>>>
>>> On Sep 12, 2014, at 5:03 PM, kilon alios  wrote:
>>>
>>> > Ok here comes the first question
>>> >
>>> > how I change the background color of RTView ?
>>> >
>>> > also
>>> >
>>> > when I do this
>>> >
>>> > v := RTView new.
>>> > shape := RTEllipse new size: 20; color: Color red. shape := shape +
>>> RTLabel.
>>> > es := shape elementOn:'hello'. v add: es.
>>> > line := RTDirectedLine new pointsFrom: 20@20 To: 30@30.
>>> > es2 := line element.v add: es2.
>>> > es @ RTDraggable.
>>> > v @ RTDraggableView .
>>> > v open.
>>> >
>>> > I am getting an error
>>> >
>>> > MNU Array >> element
>>> >
>>> > why ?
>>> >
>>>
>>>
>>>
>>
>>
>
>


Re: [Pharo-dev] Starting with Roassal 2

2014-09-12 Thread kilon alios
ah thank you very much, thats exactly what I was looking for. I will study
Trachel too.  I also found that I can do something similar using a SVG path
with Roassal.

On Sat, Sep 13, 2014 at 12:58 AM, Juraj Kubelka 
wrote:

> I think the intention of Roassal lines is to be connected with elements.
> If you want only draw lines without any connection to elements, use
> directly Trachel. I guess
>
> -=-=-=-
> | v line |
> v := RTView new.
> line := TRLineShape new from: 0@0 to: 100@100 color: Color blue.
> v canvas addShape: line.
> ^ v open
> -=-=-=-
>
> Cheers,
> Juraj
>
> On Sep 12, 2014, at 6:53 PM, kilon alios  wrote:
>
> well thats not an one liner and you still connect elements with it. I just
> wanted to pass coordinates to a line and draw it. So I would prefer it if I
> could pass points instead of elements.
>
> On Sat, Sep 13, 2014 at 12:38 AM, Juraj Kubelka 
> wrote:
>
>> OK, then you can write:
>>
>> -=-=-=-
>> | v elements edge |
>> v := RTView new.
>> elements := (RTEllipse new
>> size: #yourself;
>> color: Color red) + RTLabel elementsOn: #(10 20).
>> edge := RTDirectedLine new
>> color: Color blue;
>> *edgeFrom: elements first to: elements second.*
>> v
>> addAll: elements;
>> add: edge.
>> RTGridLayout on: elements.
>> elements @ RTDraggable.
>> ^ v open
>> -=-=-
>>
>> Cheers,
>> Juraj
>>
>> On Sep 12, 2014, at 6:30 PM, kilon alios  wrote:
>>
>> yes i know about the example of a line connecting with other shapes. I
>> wanted just a simple line by itself starting from one point and ending to
>> another in a single line of code.
>>
>> On Sat, Sep 13, 2014 at 12:26 AM, Juraj Kubelka 
>> wrote:
>>
>>> I have checked RTDirectedLine and it is not supposed to use the way you
>>> want. Basically RTEdge is the object you want to manipulate with.
>>>
>>> I do not know what is the objective of your example. But there is way
>>> how you could write it.
>>>
>>> -=-=-
>>> | v elements models |
>>> models := (10 to: 60 by: 1).
>>> v := RTView new.
>>> elements := (RTEllipse new size: #yourself; color: Color red) + RTLabel
>>> elementsOn: models.
>>> v addAll: elements.
>>> RTEdge buildEdgesFromObjects: models from: #yourself to: [ :i | i // 2 ]
>>> inView: v.
>>> RTGridLayout on: elements.
>>> elements @ RTDraggable.
>>> v @ RTDraggableView.
>>> v canvas color: Color black.
>>> v open.
>>> -=-=-
>>>
>>> Cheers,
>>> Juraj
>>>
>>> On Sep 12, 2014, at 5:03 PM, kilon alios  wrote:
>>>
>>> > Ok here comes the first question
>>> >
>>> > how I change the background color of RTView ?
>>> >
>>> > also
>>> >
>>> > when I do this
>>> >
>>> > v := RTView new.
>>> > shape := RTEllipse new size: 20; color: Color red. shape := shape +
>>> RTLabel.
>>> > es := shape elementOn:'hello'. v add: es.
>>> > line := RTDirectedLine new pointsFrom: 20@20 To: 30@30.
>>> > es2 := line element.v add: es2.
>>> > es @ RTDraggable.
>>> > v @ RTDraggableView .
>>> > v open.
>>> >
>>> > I am getting an error
>>> >
>>> > MNU Array >> element
>>> >
>>> > why ?
>>> >
>>>
>>>
>>>
>>
>>
>
>


Re: [Pharo-dev] Starting with Roassal 2

2014-09-12 Thread Juraj Kubelka
I think the intention of Roassal lines is to be connected with elements. If you 
want only draw lines without any connection to elements, use directly Trachel. 
I guess

-=-=-=-
| v line |
v := RTView new.
line := TRLineShape new from: 0@0 to: 100@100 color: Color blue.
v canvas addShape: line.
^ v open
-=-=-=-

Cheers,
Juraj

On Sep 12, 2014, at 6:53 PM, kilon alios  wrote:

> well thats not an one liner and you still connect elements with it. I just 
> wanted to pass coordinates to a line and draw it. So I would prefer it if I 
> could pass points instead of elements. 
> 
> On Sat, Sep 13, 2014 at 12:38 AM, Juraj Kubelka  
> wrote:
> OK, then you can write:
> 
> -=-=-=-
> | v elements edge |
> v := RTView new.
> elements := (RTEllipse new
>   size: #yourself;
>   color: Color red) + RTLabel elementsOn: #(10 20).
> edge := RTDirectedLine new
>   color: Color blue;
>   edgeFrom: elements first to: elements second.
> v
>   addAll: elements;
>   add: edge.
> RTGridLayout on: elements.
> elements @ RTDraggable.
> ^ v open
> -=-=-
> 
> Cheers,
> Juraj
> 
> On Sep 12, 2014, at 6:30 PM, kilon alios  wrote:
> 
>> yes i know about the example of a line connecting with other shapes. I 
>> wanted just a simple line by itself starting from one point and ending to 
>> another in a single line of code.
>> 
>> On Sat, Sep 13, 2014 at 12:26 AM, Juraj Kubelka  
>> wrote:
>> I have checked RTDirectedLine and it is not supposed to use the way you 
>> want. Basically RTEdge is the object you want to manipulate with.
>> 
>> I do not know what is the objective of your example. But there is way how 
>> you could write it.
>> 
>> -=-=-
>> | v elements models |
>> models := (10 to: 60 by: 1).
>> v := RTView new.
>> elements := (RTEllipse new size: #yourself; color: Color red) + RTLabel 
>> elementsOn: models.
>> v addAll: elements.
>> RTEdge buildEdgesFromObjects: models from: #yourself to: [ :i | i // 2 ] 
>> inView: v.
>> RTGridLayout on: elements.
>> elements @ RTDraggable.
>> v @ RTDraggableView.
>> v canvas color: Color black.
>> v open.
>> -=-=-
>> 
>> Cheers,
>> Juraj
>> 
>> On Sep 12, 2014, at 5:03 PM, kilon alios  wrote:
>> 
>> > Ok here comes the first question
>> >
>> > how I change the background color of RTView ?
>> >
>> > also
>> >
>> > when I do this
>> >
>> > v := RTView new.
>> > shape := RTEllipse new size: 20; color: Color red. shape := shape + 
>> > RTLabel.
>> > es := shape elementOn:'hello'. v add: es.
>> > line := RTDirectedLine new pointsFrom: 20@20 To: 30@30.
>> > es2 := line element.v add: es2.
>> > es @ RTDraggable.
>> > v @ RTDraggableView .
>> > v open.
>> >
>> > I am getting an error
>> >
>> > MNU Array >> element
>> >
>> > why ?
>> >
>> 
>> 
>> 
> 
> 



Re: [Pharo-dev] Starting with Roassal 2

2014-09-12 Thread kilon alios
well thats not an one liner and you still connect elements with it. I just
wanted to pass coordinates to a line and draw it. So I would prefer it if I
could pass points instead of elements.

On Sat, Sep 13, 2014 at 12:38 AM, Juraj Kubelka 
wrote:

> OK, then you can write:
>
> -=-=-=-
> | v elements edge |
> v := RTView new.
> elements := (RTEllipse new
> size: #yourself;
> color: Color red) + RTLabel elementsOn: #(10 20).
> edge := RTDirectedLine new
> color: Color blue;
> *edgeFrom: elements first to: elements second.*
> v
> addAll: elements;
> add: edge.
> RTGridLayout on: elements.
> elements @ RTDraggable.
> ^ v open
> -=-=-
>
> Cheers,
> Juraj
>
> On Sep 12, 2014, at 6:30 PM, kilon alios  wrote:
>
> yes i know about the example of a line connecting with other shapes. I
> wanted just a simple line by itself starting from one point and ending to
> another in a single line of code.
>
> On Sat, Sep 13, 2014 at 12:26 AM, Juraj Kubelka 
> wrote:
>
>> I have checked RTDirectedLine and it is not supposed to use the way you
>> want. Basically RTEdge is the object you want to manipulate with.
>>
>> I do not know what is the objective of your example. But there is way how
>> you could write it.
>>
>> -=-=-
>> | v elements models |
>> models := (10 to: 60 by: 1).
>> v := RTView new.
>> elements := (RTEllipse new size: #yourself; color: Color red) + RTLabel
>> elementsOn: models.
>> v addAll: elements.
>> RTEdge buildEdgesFromObjects: models from: #yourself to: [ :i | i // 2 ]
>> inView: v.
>> RTGridLayout on: elements.
>> elements @ RTDraggable.
>> v @ RTDraggableView.
>> v canvas color: Color black.
>> v open.
>> -=-=-
>>
>> Cheers,
>> Juraj
>>
>> On Sep 12, 2014, at 5:03 PM, kilon alios  wrote:
>>
>> > Ok here comes the first question
>> >
>> > how I change the background color of RTView ?
>> >
>> > also
>> >
>> > when I do this
>> >
>> > v := RTView new.
>> > shape := RTEllipse new size: 20; color: Color red. shape := shape +
>> RTLabel.
>> > es := shape elementOn:'hello'. v add: es.
>> > line := RTDirectedLine new pointsFrom: 20@20 To: 30@30.
>> > es2 := line element.v add: es2.
>> > es @ RTDraggable.
>> > v @ RTDraggableView .
>> > v open.
>> >
>> > I am getting an error
>> >
>> > MNU Array >> element
>> >
>> > why ?
>> >
>>
>>
>>
>
>


Re: [Pharo-dev] Starting with Roassal 2

2014-09-12 Thread Juraj Kubelka
OK, then you can write:

-=-=-=-
| v elements edge |
v := RTView new.
elements := (RTEllipse new
size: #yourself;
color: Color red) + RTLabel elementsOn: #(10 20).
edge := RTDirectedLine new
color: Color blue;
edgeFrom: elements first to: elements second.
v
addAll: elements;
add: edge.
RTGridLayout on: elements.
elements @ RTDraggable.
^ v open
-=-=-

Cheers,
Juraj

On Sep 12, 2014, at 6:30 PM, kilon alios  wrote:

> yes i know about the example of a line connecting with other shapes. I wanted 
> just a simple line by itself starting from one point and ending to another in 
> a single line of code.
> 
> On Sat, Sep 13, 2014 at 12:26 AM, Juraj Kubelka  
> wrote:
> I have checked RTDirectedLine and it is not supposed to use the way you want. 
> Basically RTEdge is the object you want to manipulate with.
> 
> I do not know what is the objective of your example. But there is way how you 
> could write it.
> 
> -=-=-
> | v elements models |
> models := (10 to: 60 by: 1).
> v := RTView new.
> elements := (RTEllipse new size: #yourself; color: Color red) + RTLabel 
> elementsOn: models.
> v addAll: elements.
> RTEdge buildEdgesFromObjects: models from: #yourself to: [ :i | i // 2 ] 
> inView: v.
> RTGridLayout on: elements.
> elements @ RTDraggable.
> v @ RTDraggableView.
> v canvas color: Color black.
> v open.
> -=-=-
> 
> Cheers,
> Juraj
> 
> On Sep 12, 2014, at 5:03 PM, kilon alios  wrote:
> 
> > Ok here comes the first question
> >
> > how I change the background color of RTView ?
> >
> > also
> >
> > when I do this
> >
> > v := RTView new.
> > shape := RTEllipse new size: 20; color: Color red. shape := shape + RTLabel.
> > es := shape elementOn:'hello'. v add: es.
> > line := RTDirectedLine new pointsFrom: 20@20 To: 30@30.
> > es2 := line element.v add: es2.
> > es @ RTDraggable.
> > v @ RTDraggableView .
> > v open.
> >
> > I am getting an error
> >
> > MNU Array >> element
> >
> > why ?
> >
> 
> 
> 



Re: [Pharo-dev] Starting with Roassal 2

2014-09-12 Thread kilon alios
yes i know about the example of a line connecting with other shapes. I
wanted just a simple line by itself starting from one point and ending to
another in a single line of code.

On Sat, Sep 13, 2014 at 12:26 AM, Juraj Kubelka 
wrote:

> I have checked RTDirectedLine and it is not supposed to use the way you
> want. Basically RTEdge is the object you want to manipulate with.
>
> I do not know what is the objective of your example. But there is way how
> you could write it.
>
> -=-=-
> | v elements models |
> models := (10 to: 60 by: 1).
> v := RTView new.
> elements := (RTEllipse new size: #yourself; color: Color red) + RTLabel
> elementsOn: models.
> v addAll: elements.
> RTEdge buildEdgesFromObjects: models from: #yourself to: [ :i | i // 2 ]
> inView: v.
> RTGridLayout on: elements.
> elements @ RTDraggable.
> v @ RTDraggableView.
> v canvas color: Color black.
> v open.
> -=-=-
>
> Cheers,
> Juraj
>
> On Sep 12, 2014, at 5:03 PM, kilon alios  wrote:
>
> > Ok here comes the first question
> >
> > how I change the background color of RTView ?
> >
> > also
> >
> > when I do this
> >
> > v := RTView new.
> > shape := RTEllipse new size: 20; color: Color red. shape := shape +
> RTLabel.
> > es := shape elementOn:'hello'. v add: es.
> > line := RTDirectedLine new pointsFrom: 20@20 To: 30@30.
> > es2 := line element.v add: es2.
> > es @ RTDraggable.
> > v @ RTDraggableView .
> > v open.
> >
> > I am getting an error
> >
> > MNU Array >> element
> >
> > why ?
> >
>
>
>


Re: [Pharo-dev] Starting with Roassal 2

2014-09-12 Thread Juraj Kubelka
I have checked RTDirectedLine and it is not supposed to use the way you want. 
Basically RTEdge is the object you want to manipulate with. 

I do not know what is the objective of your example. But there is way how you 
could write it.

-=-=-
| v elements models |
models := (10 to: 60 by: 1).
v := RTView new.
elements := (RTEllipse new size: #yourself; color: Color red) + RTLabel 
elementsOn: models.
v addAll: elements.
RTEdge buildEdgesFromObjects: models from: #yourself to: [ :i | i // 2 ] 
inView: v. 
RTGridLayout on: elements.
elements @ RTDraggable.
v @ RTDraggableView.
v canvas color: Color black.
v open.
-=-=-

Cheers,
Juraj

On Sep 12, 2014, at 5:03 PM, kilon alios  wrote:

> Ok here comes the first question
> 
> how I change the background color of RTView ?
> 
> also
> 
> when I do this
> 
> v := RTView new.
> shape := RTEllipse new size: 20; color: Color red. shape := shape + RTLabel.
> es := shape elementOn:'hello'. v add: es.
> line := RTDirectedLine new pointsFrom: 20@20 To: 30@30. 
> es2 := line element.v add: es2. 
> es @ RTDraggable.
> v @ RTDraggableView .
> v open.
> 
> I am getting an error 
> 
> MNU Array >> element
> 
> why ?
> 




Re: [Pharo-dev] Starting with Roassal 2

2014-09-12 Thread kilon alios
to answer myself, view color changes via canvas so it is

v canvas color: Color black.

I also found a way to create an edge looking at the tests.

this is the complete code now

v := RTView new.
shape := RTEllipse new size: 20; color: Color red. shape := shape + RTLabel.
es := shape elementOn:'hello'. v add: es.
el1 := RTBox element.
el2 := RTBox element.
el1 translateTo: 20 @ 20.
el2 translateTo: 60 @ 80.
edge := RTLine edgeFrom: el1 to: el2.
"es2 := edge element."v add: edge.
"RTEdge buildEdgesFromObjects: (1 to: 20) from: [ :i | i // 2 ] to:
#yourself inView: v". "RTGridLayout on: es".
es @ RTDraggable.
v @ RTDraggableView .
v canvas color: Color black.
v open.

probably there is an easier way to do this so I am taking a look at both
tests and examples.

On Fri, Sep 12, 2014 at 11:03 PM, kilon alios  wrote:

> Ok here comes the first question
>
> how I change the background color of RTView ?
>
> also
>
> when I do this
>
> v := RTView new.
> shape := RTEllipse new size: 20; color: Color red. shape := shape +
> RTLabel.
> es := shape elementOn:'hello'. v add: es.
> line := RTDirectedLine new pointsFrom: 20@20 To: 30@30.
> es2 := line element.v add: es2.
> es @ RTDraggable.
> v @ RTDraggableView .
> v open.
>
> I am getting an error
>
> MNU Array >> element
>
> why ?
>
>


[Pharo-dev] Starting with Roassal 2

2014-09-12 Thread kilon alios
Ok here comes the first question

how I change the background color of RTView ?

also

when I do this

v := RTView new.
shape := RTEllipse new size: 20; color: Color red. shape := shape + RTLabel.
es := shape elementOn:'hello'. v add: es.
line := RTDirectedLine new pointsFrom: 20@20 To: 30@30.
es2 := line element.v add: es2.
es @ RTDraggable.
v @ RTDraggableView .
v open.

I am getting an error

MNU Array >> element

why ?