multiple arrow

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

multiple arrow

abergel
Hi!

I know this has been on the wished list of many of you. The following script produces:

-=-=-=-=-=-=-=-=-=-=-=-=
| view el1 el2 edge line  |
view := ROView new.
el1 := ROElement new.
el1 @RODraggable.
el1 extent: 50@50.
el1 + ROBox blue.

el2 := ROElement new.
el2 @RODraggable.
el2 extent: 50@50.
el2 + ROBox green.

el1 translateTo: 0 @ 100.
 
edge := ROEdge from: el1 to: el2.
line := ROLine new.
line add: ROArrow new offset: 0.1.
line add: ROArrow new offset: 0.5.
edge + line.

view add: el1; add: el2; add: edge.
view open 
-=-=-=-=-=-=-=-=-=-=-=-=

I will remove ROArrowedLine very soon then

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




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

Re: multiple arrow

Usman Bhatti
Thanks Alex.
But I think arrowed line was a good tool to show relationship between two entities without specifying the position of arrow. So, it will be good if you can keep it.

On Tue, Jun 12, 2012 at 6:54 PM, Alexandre Bergel <[hidden email]> wrote:
Hi!

I know this has been on the wished list of many of you. The following script produces:

-=-=-=-=-=-=-=-=-=-=-=-=
| view el1 el2 edge line  |
view := ROView new.
el1 := ROElement new.
el1 @RODraggable.
el1 extent: 50@50.
el1 + ROBox blue.

el2 := ROElement new.
el2 @RODraggable.
el2 extent: 50@50.
el2 + ROBox green.

el1 translateTo: 0 @ 100.
 
edge := ROEdge from: el1 to: el2.
line := ROLine new.
line add: ROArrow new offset: 0.1.
line add: ROArrow new offset: 0.5.
edge + line.

view add: el1; add: el2; add: edge.
view open 
-=-=-=-=-=-=-=-=-=-=-=-=

I will remove ROArrowedLine very soon then

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




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



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

Re: multiple arrow

Tudor Girba-2
In reply to this post by abergel
Excellent job, Alex!

We start to have true decorators. It's getting exciting :).

Cheers,
Doru


On 12 Jun 2012, at 18:54, Alexandre Bergel wrote:

> Hi!
>
> I know this has been on the wished list of many of you. The following script produces:
> <Screen Shot 2012-06-13 at 12.54.05 AM.png>
>
> -=-=-=-=-=-=-=-=-=-=-=-=
> | view el1 el2 edge line  |
> view := ROView new.
> el1 := ROElement new.
> el1 @RODraggable.
> el1 extent: 50@50.
> el1 + ROBox blue.
>
> el2 := ROElement new.
> el2 @RODraggable.
> el2 extent: 50@50.
> el2 + ROBox green.
>
> el1 translateTo: 0 @ 100.
>
> edge := ROEdge from: el1 to: el2.
> line := ROLine new.
> line add: ROArrow new offset: 0.1.
> line add: ROArrow new offset: 0.5.
> edge + line.
>
> view add: el1; add: el2; add: edge.
> view open
> -=-=-=-=-=-=-=-=-=-=-=-=
>
> I will remove ROArrowedLine very soon then
>
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Every now and then stop and ask yourself if the war you're fighting is the right one."




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

Re: multiple arrow

Tudor Girba-2
In reply to this post by Usman Bhatti
Hi Usman,

The ArrowedLine is a particular case that does not deserve its own class. Composition is much better here because we can construct the shapes the way we want (and we can control each .

The arrow at the end of the line can be added as a convenience method. Perhaps something like this:
edge + ROLine + ROArrow.

This does not yet work because some convenience methods are missing, but other than that it should work out of the box. As soon as I get some rights, I can even commit :).

Cheers,
Doru


On 12 Jun 2012, at 21:15, Usman Bhatti wrote:

> Thanks Alex.
> But I think arrowed line was a good tool to show relationship between two entities without specifying the position of arrow. So, it will be good if you can keep it.
>
> On Tue, Jun 12, 2012 at 6:54 PM, Alexandre Bergel <[hidden email]> wrote:
> Hi!
>
> I know this has been on the wished list of many of you. The following script produces:
> <Screen Shot 2012-06-13 at 12.54.05 AM.png>
>
> -=-=-=-=-=-=-=-=-=-=-=-=
> | view el1 el2 edge line  |
> view := ROView new.
> el1 := ROElement new.
> el1 @RODraggable.
> el1 extent: 50@50.
> el1 + ROBox blue.
>
> el2 := ROElement new.
> el2 @RODraggable.
> el2 extent: 50@50.
> el2 + ROBox green.
>
> el1 translateTo: 0 @ 100.
>
> edge := ROEdge from: el1 to: el2.
> line := ROLine new.
> line add: ROArrow new offset: 0.1.
> line add: ROArrow new offset: 0.5.
> edge + line.
>
> view add: el1; add: el2; add: edge.
> view open
> -=-=-=-=-=-=-=-=-=-=-=-=
>
> I will remove ROArrowedLine very soon then
>
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Beauty is where we see it."




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

Re: multiple arrow

Stéphane Ducasse
In reply to this post by abergel
just a question

why not

> view := ROView new.
> el1 := ROElement dragable.
>


or
> view := ROView new.
> el1 := ROElement new
          el1 draggable



> el1 + ROBox blue.

what is the advantage over

        el1 color: #blue

?
or
> el1 := ROElement new
>  el1 box green ; draggable



to me the + and @ looks complex and a bit ugly.
Then I do not understand why we can give an extent: before saying that this is a box?


> | view el1 el2 edge line  |
> view := ROView new.
> el1 := ROElement new.
> el1 draggable ; box blue.
> el1 extent: 50@50.
>
> el2 := ROElement new.
> el2 draggable; box green.
> el2 extent: 50@50.


looks better to me.





> Hi!
>
> I know this has been on the wished list of many of you. The following script produces:
> <Screen Shot 2012-06-13 at 12.54.05 AM.png>
>
> -=-=-=-=-=-=-=-=-=-=-=-=
> | view el1 el2 edge line  |
> view := ROView new.
> el1 := ROElement new.
> el1 @RODraggable.
> el1 extent: 50@50.
> el1 + ROBox blue.
>
> el2 := ROElement new.
> el2 @RODraggable.
> el2 extent: 50@50.
> el2 + ROBox green.
>
> el1 translateTo: 0 @ 100.
>
> edge := ROEdge from: el1 to: el2.
> line := ROLine new.
> line add: ROArrow new offset: 0.1.
> line add: ROArrow new offset: 0.5.
> edge + line.
>
> view add: el1; add: el2; add: edge.
> view open
> -=-=-=-=-=-=-=-=-=-=-=-=
>
> I will remove ROArrowedLine very soon then
>
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


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

Re: multiple arrow

Tudor Girba-2
Hi,

Nice questions.

On 12 Jun 2012, at 22:12, Stéphane Ducasse wrote:

> just a question
>
> why not
>
>> view := ROView new.
>> el1 := ROElement dragable.
>>
>
>
> or
>> view := ROView new.
>> el1 := ROElement new
>  el1 draggable
>

+ adds a shape decorator.
@ adds an interaction.

I quite like this part. Maybe draggable could be a nice addition, but I would prefer, in general, to keep the API to a minimum and add convenience methods as they are needed in practice. +RODraggable is quite simple once you get used with the idiom.


>> el1 + ROBox blue.
>
> what is the advantage over
>
> el1 color: #blue
>
> ?

Indeed, blue is a convenience conceptual hack :). I guess the idea is that because Roassal offers a DSL that also works on classes (not just instances) through default constructors, it was just convenient to not have to add parentheses. But, it is a bit of a hack.


> or
>> el1 := ROElement new
>> el1 box green ; draggable
>
>
>
> to me the + and @ looks complex and a bit ugly.
> Then I do not understand why we can give an extent: before saying that this is a box?

Currently, the Element defines the extent and the shape is drawn around this extent. I do not like this either. I think the shape should hold the extent for the shape and the Element bounds should be computed based on what the shapes are saying.


>> | view el1 el2 edge line  |
>> view := ROView new.
>> el1 := ROElement new.
>> el1 draggable ; box blue.
>> el1 extent: 50@50.
>>
>> el2 := ROElement new.
>> el2 draggable; box green.
>> el2 extent: 50@50.
>
>
> looks better to me.
>
>
>
>
>
>> Hi!
>>
>> I know this has been on the wished list of many of you. The following script produces:
>> <Screen Shot 2012-06-13 at 12.54.05 AM.png>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> | view el1 el2 edge line  |
>> view := ROView new.
>> el1 := ROElement new.
>> el1 @RODraggable.
>> el1 extent: 50@50.
>> el1 + ROBox blue.
>>
>> el2 := ROElement new.
>> el2 @RODraggable.
>> el2 extent: 50@50.
>> el2 + ROBox green.
>>
>> el1 translateTo: 0 @ 100.
>>
>> edge := ROEdge from: el1 to: el2.
>> line := ROLine new.
>> line add: ROArrow new offset: 0.1.
>> line add: ROArrow new offset: 0.5.
>> edge + line.
>>
>> view add: el1; add: el2; add: edge.
>> view open
>> -=-=-=-=-=-=-=-=-=-=-=-=
>>
>> I will remove ROArrowedLine very soon then
>>
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"What is more important: To be happy, or to make happy?"


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

Re: multiple arrow

abergel
In reply to this post by Tudor Girba-2
> The arrow at the end of the line can be added as a convenience method. Perhaps something like this:
> edge + ROLine + ROArrow.

It wil be something like
edge + (ROLine new addBeginning: ROArrow new)

Alexandre


>
>
> On 12 Jun 2012, at 21:15, Usman Bhatti wrote:
>
>> Thanks Alex.
>> But I think arrowed line was a good tool to show relationship between two entities without specifying the position of arrow. So, it will be good if you can keep it.
>>
>> On Tue, Jun 12, 2012 at 6:54 PM, Alexandre Bergel <[hidden email]> wrote:
>> Hi!
>>
>> I know this has been on the wished list of many of you. The following script produces:
>> <Screen Shot 2012-06-13 at 12.54.05 AM.png>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> | view el1 el2 edge line  |
>> view := ROView new.
>> el1 := ROElement new.
>> el1 @RODraggable.
>> el1 extent: 50@50.
>> el1 + ROBox blue.
>>
>> el2 := ROElement new.
>> el2 @RODraggable.
>> el2 extent: 50@50.
>> el2 + ROBox green.
>>
>> el1 translateTo: 0 @ 100.
>>
>> edge := ROEdge from: el1 to: el2.
>> line := ROLine new.
>> line add: ROArrow new offset: 0.1.
>> line add: ROArrow new offset: 0.5.
>> edge + line.
>>
>> view add: el1; add: el2; add: edge.
>> view open
>> -=-=-=-=-=-=-=-=-=-=-=-=
>>
>> I will remove ROArrowedLine very soon then
>>
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> www.tudorgirba.com
>
> "Beauty is where we see it."
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

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



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

Re: multiple arrow

abergel
In reply to this post by Stéphane Ducasse
> why not
>
>> view := ROView new.
>> el1 := ROElement dragable.
>>
>
>
> or
>> view := ROView new.
>> el1 := ROElement new
>  el1 draggable

Instead of + and @ you can use addShape: and addInteraction:, respectively.

I do not like "el1 draggable" because I want to keep ROElement as small as possible.
This is why you have to write:
el1 @ RODraggable
or:
el1 addInteraction: RODraggable
or:
RODraggable initializeElement: el1

All these 3 formulation are the same.
I favor @ because it is shorter. Shall I remove it? What is the general opinion on this?


>> el1 + ROBox blue.
>
> what is the advantage over
>
> el1 color: #blue

you can have: el1 + (ROBox new color: Color blue)


> ?
> or
>> el1 := ROElement new
>> el1 box green ; draggable

by doing "el1 + ROBox" I am sure that the class ROElement does not know at all about boxes and colors.

> to me the + and @ looks complex and a bit ugly.
> Then I do not understand why we can give an extent: before saying that this is a box?

Currently you can. But following the discussion I had last week with Doru, it seems wiser to have the shape decide the extent and not the element itself.

Cheers,
Alexandre


>
>
>> | view el1 el2 edge line  |
>> view := ROView new.
>> el1 := ROElement new.
>> el1 draggable ; box blue.
>> el1 extent: 50@50.
>>
>> el2 := ROElement new.
>> el2 draggable; box green.
>> el2 extent: 50@50.
>
>
> looks better to me.
>
>
>
>
>
>> Hi!
>>
>> I know this has been on the wished list of many of you. The following script produces:
>> <Screen Shot 2012-06-13 at 12.54.05 AM.png>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> | view el1 el2 edge line  |
>> view := ROView new.
>> el1 := ROElement new.
>> el1 @RODraggable.
>> el1 extent: 50@50.
>> el1 + ROBox blue.
>>
>> el2 := ROElement new.
>> el2 @RODraggable.
>> el2 extent: 50@50.
>> el2 + ROBox green.
>>
>> el1 translateTo: 0 @ 100.
>>
>> edge := ROEdge from: el1 to: el2.
>> line := ROLine new.
>> line add: ROArrow new offset: 0.1.
>> line add: ROArrow new offset: 0.5.
>> edge + line.
>>
>> view add: el1; add: el2; add: edge.
>> view open
>> -=-=-=-=-=-=-=-=-=-=-=-=
>>
>> I will remove ROArrowedLine very soon then
>>
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

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



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

Re: multiple arrow

Tudor Girba-2
In reply to this post by abergel
Hi,

On 13 Jun 2012, at 17:20, Alexandre Bergel wrote:

>> The arrow at the end of the line can be added as a convenience method. Perhaps something like this:
>> edge + ROLine + ROArrow.
>
> It wil be something like
> edge + (ROLine new addBeginning: ROArrow new)

The information about where the arrow should be placed in the ROArrow rather than in the ROLine. Like this you could just compose the two without the Line knowing anything about the Arrow.

As you propose it also makes sense, but the problem is that adding the Arrow decorator happens through a different mechanism (addBeginning:) than the regular one (addShape:).

Doru



> Alexandre
>
>
>>
>>
>> On 12 Jun 2012, at 21:15, Usman Bhatti wrote:
>>
>>> Thanks Alex.
>>> But I think arrowed line was a good tool to show relationship between two entities without specifying the position of arrow. So, it will be good if you can keep it.
>>>
>>> On Tue, Jun 12, 2012 at 6:54 PM, Alexandre Bergel <[hidden email]> wrote:
>>> Hi!
>>>
>>> I know this has been on the wished list of many of you. The following script produces:
>>> <Screen Shot 2012-06-13 at 12.54.05 AM.png>
>>>
>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>> | view el1 el2 edge line  |
>>> view := ROView new.
>>> el1 := ROElement new.
>>> el1 @RODraggable.
>>> el1 extent: 50@50.
>>> el1 + ROBox blue.
>>>
>>> el2 := ROElement new.
>>> el2 @RODraggable.
>>> el2 extent: 50@50.
>>> el2 + ROBox green.
>>>
>>> el1 translateTo: 0 @ 100.
>>>
>>> edge := ROEdge from: el1 to: el2.
>>> line := ROLine new.
>>> line add: ROArrow new offset: 0.1.
>>> line add: ROArrow new offset: 0.5.
>>> edge + line.
>>>
>>> view add: el1; add: el2; add: edge.
>>> view open
>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>
>>> I will remove ROArrowedLine very soon then
>>>
>>> Alexandre
>>> --
>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>> Alexandre Bergel  http://www.bergel.eu
>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>
>>>
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>> --
>> www.tudorgirba.com
>>
>> "Beauty is where we see it."
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"We cannot reach the flow of things unless we let go."




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

Re: multiple arrow

Stéphane Ducasse
In reply to this post by abergel
>
>
> I do not like "el1 draggable" because I want to keep ROElement as small as possible.

I do not see the point.
You can package extension in separate package and use class extension so ?

Now what I see is verbose code.

> This is why you have to write:
> el1 @ RODraggable
> or:
> el1 addInteraction: RODraggable
> or:
> RODraggable initializeElement: el1

I would not describe the last one.

I favor el1 draggable because it is concise and says what is does.
>
> All these 3 formulation are the same.
> I favor @ because it is shorter. Shall I remove it? What is the general opinion on this?

Personally I think that @Dragable will just break effort of type inferencer and this is sad.
Same for +
>
>>> el1 + ROBox blue.
>>
>> what is the advantage over
>>
>> el1 color: #blue
>
> you can have: el1 + (ROBox new color: Color blue)

Same remark as above I think color: #blue more smalltalk oriented than + and
(ROBox new color:….) is verbose.


>> ?
>> or
>>> el1 := ROElement new
>>> el1 box green ; draggable
>
> by doing "el1 + ROBox" I am sure that the class ROElement does not know at all about boxes and colors.

Your argument does not hold. because we are not in Java and you could package nicely ROBox in a separate
package and have some nice class extensions.

What I do not like with + is that + is functional and now you use it to modify conceptually the receiver.
+ is not equal to add:


>> to me the + and @ looks complex and a bit ugly.
>> Then I do not understand why we can give an extent: before saying that this is a box?
>
> Currently you can. But following the discussion I had last week with Doru, it seems wiser to have the shape decide the extent and not the element itself.

Ok I understand that point.

>
> Cheers,
> Alexandre
>
>
>>
>>
>>> | view el1 el2 edge line  |
>>> view := ROView new.
>>> el1 := ROElement new.
>>> el1 draggable ; box blue.
>>> el1 extent: 50@50.
>>>
>>> el2 := ROElement new.
>>> el2 draggable; box green.
>>> el2 extent: 50@50.
>>
>>
>> looks better to me.
>>
>>
>>
>>
>>
>>> Hi!
>>>
>>> I know this has been on the wished list of many of you. The following script produces:
>>> <Screen Shot 2012-06-13 at 12.54.05 AM.png>
>>>
>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>> | view el1 el2 edge line  |
>>> view := ROView new.
>>> el1 := ROElement new.
>>> el1 @RODraggable.
>>> el1 extent: 50@50.
>>> el1 + ROBox blue.
>>>
>>> el2 := ROElement new.
>>> el2 @RODraggable.
>>> el2 extent: 50@50.
>>> el2 + ROBox green.
>>>
>>> el1 translateTo: 0 @ 100.
>>>
>>> edge := ROEdge from: el1 to: el2.
>>> line := ROLine new.
>>> line add: ROArrow new offset: 0.1.
>>> line add: ROArrow new offset: 0.5.
>>> edge + line.
>>>
>>> view add: el1; add: el2; add: edge.
>>> view open
>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>
>>> I will remove ROArrowedLine very soon then
>>>
>>> Alexandre
>>> --
>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>> Alexandre Bergel  http://www.bergel.eu
>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>
>>>
>>>
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


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

Re: multiple arrow

Ben Coman
In reply to this post by abergel
Alexandre Bergel wrote:
The arrow at the end of the line can be added as a convenience method. Perhaps something like this:
edge + ROLine + ROArrow.
    

It wil be something like 
edge + (ROLine new addBeginning: ROArrow new)

Alexandre
  
Just wild speculation, how about using #- equivalent to #edgeTo: and/or using  #< and #> for arrows...

el1 - el2
el1 < - el2
el1 - > el2
el < - > el2
el <:0.1 <:0.5 - el2
el < large - thick > outline el2

  
On 12 Jun 2012, at 21:15, Usman Bhatti wrote:

    
Thanks Alex.
But I think arrowed line was a good tool to show relationship between two entities without specifying the position of arrow. So, it will be good if you can keep it.

On Tue, Jun 12, 2012 at 6:54 PM, Alexandre Bergel [hidden email] wrote:
Hi!

I know this has been on the wished list of many of you. The following script produces:
<Screen Shot 2012-06-13 at 12.54.05 AM.png>

-=-=-=-=-=-=-=-=-=-=-=-=
	| view el1 el2 edge line  |
	view := ROView new.
	el1 := ROElement new.
	el1 @RODraggable.
	el1 extent: 50@50.
	el1 + ROBox blue.

	el2 := ROElement new.
	el2 @RODraggable.
	el2 extent: 50@50.
	el2 + ROBox green.

	el1 translateTo: 0 @ 100.
	 
	edge := ROEdge from: el1 to: el2.
	line := ROLine new.
	line add: ROArrow new offset: 0.1.
	line add: ROArrow new offset: 0.5.
	edge + line.

	view add: el1; add: el2; add: edge.
	view open 
-=-=-=-=-=-=-=-=-=-=-=-=

I will remove ROArrowedLine very soon then

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




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


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
      
--
www.tudorgirba.com

"Beauty is where we see it."




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

  


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

Re: multiple arrow

Ben Coman
In reply to this post by abergel
Alexandre Bergel wrote:
why not

    
view := ROView new.
	el1 := ROElement dragable.

      
or 
    
view := ROView new.
	el1 := ROElement new
      
	  el1 draggable
    

Instead of + and @ you can use addShape: and addInteraction:, respectively.

I do not like "el1 draggable" because I want to keep ROElement as small as possible. 
This is why you have to write:
el1 @ RODraggable 
or: 
el1 addInteraction: RODraggable
or: 
RODraggable initializeElement: el1

All these 3 formulation are the same. 
I favor @ because it is shorter. Shall I remove it? What is the general opinion on this?
  
This is a new paradigm.  Let the dust settle a bit.

  
	el1 + ROBox blue.
      
what is the advantage over

	el1 color: #blue 
    

you can have: el1 + (ROBox new color: Color blue)


  
?
or 
    
el1 := ROElement new
el1 box green ; draggable
      

by doing "el1 + ROBox" I am sure that the class ROElement does not know at all about boxes and colors.

  
to me the + and @ looks complex and a bit ugly.
Then I do not understand why we can give an extent: before saying that this is a box?
    

Currently you can. But following the discussion I had last week with Doru, it seems wiser to have the shape decide the extent and not the element itself.

Cheers,
Alexandre


  
    
| view el1 el2 edge line  |
	view := ROView new.
	el1 := ROElement new.
	el1 draggable ; box blue.
	el1 extent: 50@50.

	el2 := ROElement new.
	el2 draggable; box green.
	el2 extent: 50@50.
      
looks better to me.





    
Hi!

I know this has been on the wished list of many of you. The following script produces:
<Screen Shot 2012-06-13 at 12.54.05 AM.png>

-=-=-=-=-=-=-=-=-=-=-=-=
	| view el1 el2 edge line  |
	view := ROView new.
	el1 := ROElement new.
	el1 @RODraggable.
	el1 extent: 50@50.
	el1 + ROBox blue.

	el2 := ROElement new.
	el2 @RODraggable.
	el2 extent: 50@50.
	el2 + ROBox green.

	el1 translateTo: 0 @ 100.
	 
	edge := ROEdge from: el1 to: el2.
	line := ROLine new.
	line add: ROArrow new offset: 0.1.
	line add: ROArrow new offset: 0.5.
	edge + line.

	view add: el1; add: el2; add: edge.
	view open 
-=-=-=-=-=-=-=-=-=-=-=-=

I will remove ROArrowedLine very soon then

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



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

  


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

Re: multiple arrow

abergel
In reply to this post by Ben Coman
I would actually not implement this in the core of Roassal, but such a syntax should be easy to have by building a new dsl with (ie., a new builder)

Alexandre



Le 14 juin 2012 à 19:33, Ben Coman <[hidden email]> a écrit :

Alexandre Bergel wrote:
The arrow at the end of the line can be added as a convenience method. Perhaps something like this:
edge + ROLine + ROArrow.
    

It wil be something like 
edge + (ROLine new addBeginning: ROArrow new)

Alexandre
  
Just wild speculation, how about using #- equivalent to #edgeTo: and/or using  #< and #> for arrows...

el1 - el2
el1 < - el2
el1 - > el2
el < - > el2
el <:0.1 <:0.5 - el2
el < large - thick > outline el2
  
On 12 Jun 2012, at 21:15, Usman Bhatti wrote:

    
Thanks Alex.
But I think arrowed line was a good tool to show relationship between two entities without specifying the position of arrow. So, it will be good if you can keep it.

On Tue, Jun 12, 2012 at 6:54 PM, Alexandre Bergel [hidden email] wrote:
Hi!

I know this has been on the wished list of many of you. The following script produces:
<Screen Shot 2012-06-13 at 12.54.05 AM.png>

-=-=-=-=-=-=-=-=-=-=-=-=
	| view el1 el2 edge line  |
	view := ROView new.
	el1 := ROElement new.
	el1 @RODraggable.
	el1 extent: 50@50.
	el1 + ROBox blue.

	el2 := ROElement new.
	el2 @RODraggable.
	el2 extent: 50@50.
	el2 + ROBox green.

	el1 translateTo: 0 @ 100.
	 
	edge := ROEdge from: el1 to: el2.
	line := ROLine new.
	line add: ROArrow new offset: 0.1.
	line add: ROArrow new offset: 0.5.
	edge + line.

	view add: el1; add: el2; add: edge.
	view open 
-=-=-=-=-=-=-=-=-=-=-=-=

I will remove ROArrowedLine very soon then

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




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


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
      
--
www.tudorgirba.com

"Beauty is where we see it."




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

  

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

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

Re: multiple arrow

abergel
In reply to this post by Stéphane Ducasse
>> I do not like "el1 draggable" because I want to keep ROElement as small as possible.
>
> I do not see the point.
> You can package extension in separate package and use class extension so ?
>
> Now what I see is verbose code.

I agree with you. I could use class extension. However I am kind of reluctant to use class extension in this case. Many many methods will have to be defined on ROElement as class extension. Maybe the tools we use are not good to manage class extension enough.

>>>> el1 + ROBox blue.
>>>
>>> what is the advantage over
>>>
>>> el1 color: #blue
>>
>> you can have: el1 + (ROBox new color: Color blue)
>
> Same remark as above I think color: #blue more smalltalk oriented than + and
> (ROBox new color:….) is verbose.

How would I resolve #blue into Color blue?

Cheers,
Alexandre

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




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

Re: multiple arrow

Stéphane Ducasse

On Jun 15, 2012, at 4:03 AM, Alexandre Bergel wrote:

>>> I do not like "el1 draggable" because I want to keep ROElement as small as possible.
>>
>> I do not see the point.
>> You can package extension in separate package and use class extension so ?
>>
>> Now what I see is verbose code.
>
> I agree with you. I could use class extension. However I am kind of reluctant to use class extension in this case. Many many methods will have to be defined on ROElement as class extension. Maybe the tools we use are not good to manage class extension enough.

Really?
Did you look at FAMIX class recently?

I think that if we invest in Roassal we will add a package for adding extensions.

>>>>> el1 + ROBox blue.
>>>>
>>>> what is the advantage over
>>>>
>>>> el1 color: #blue
>>>
>>> you can have: el1 + (ROBox new color: Color blue)
>>
>> Same remark as above I think color: #blue more smalltalk oriented than + and
>> (ROBox new color:….) is verbose.
>
> How would I resolve #blue into Color blue?

        el1 color: Color blue

>
> Cheers,
> Alexandre
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


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