Roassal: Lines and Arrows

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

Roassal: Lines and Arrows

Dennis Schenk
Hi all,

I'd like to customize lines with arrows a little bit more than seems to be possible out of the box at the moment and am looking for some pointers.

I have attached a screenshot to explain what I'd like to achieve.

I'd like to be able to:
  1. Define a certain distance from the arrows beginning and end to the objects they are attached to - so they are not directly 'glued' to the objects.
  2. Make lines wider, without just affecting the width of the line (and in the same extend the line the arrow is made up), but instead it should scale to nice looking arrows.
  3. To place lines besides each other from and to the same object.
Are some of these points already possible but I missed them?
How would I best go on about modifying, extending Roassal to allow for edge styling in this way?

Cheers,
Dennis

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

roassal-arrows.png (61K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Roassal: Lines and Arrows

abergel
Hi Dennis,

This should be easy to achieve. Create a subclass of ROLine, override lineSegmentsFor: and drawOnFor:

In the implementation of the lines, drawOnFor: does not use lineSegmentsFor:, however it should. My advice is therefore try to keep drawOnFor: as simple as possible, by calling lineSegmentsFor:

lineSegmentsFor: is intended to return a collection of points to draw lines. Give a try, it should not be that hard. We could do a remote pair programming if you want (my MSN id is [hidden email]).

Cheers,
Alexandre


On Sep 12, 2012, at 8:07 AM, Dennis Schenk <[hidden email]> wrote:

> Hi all,
>
> I'd like to customize lines with arrows a little bit more than seems to be possible out of the box at the moment and am looking for some pointers.
>
> I have attached a screenshot to explain what I'd like to achieve.
>
> I'd like to be able to:
> • Define a certain distance from the arrows beginning and end to the objects they are attached to - so they are not directly 'glued' to the objects.
> • Make lines wider, without just affecting the width of the line (and in the same extend the line the arrow is made up), but instead it should scale to nice looking arrows.
> • To place lines besides each other from and to the same object.
> Are some of these points already possible but I missed them?
> How would I best go on about modifying, extending Roassal to allow for edge styling in this way?
>
> Cheers,
> Dennis
> <roassal-arrows.png>_______________________________________________
> 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: Roassal: Lines and Arrows

Dennis Schenk
Hi Alex,

I worked on the arrows and lines. See the following Screenshot: http://cl.ly/image/1t2Z461a3k0n.

The arrows are attached with a ROShorterDistanceAttachPoint but the lines leave a certain gap to the attach point. Also I removed the bottom line of the arrows.
For this particular visualization I also used some 'visual weighting' to draw the arrows (using opacity and width).

I did not yet implement my new line class exactly as as you suggested yet, does not yet use lineSegmentsFor:, I only using drawOnFor: at the moment) will refactor that soon though.

While looking at the lines and arrow classes I saw some code duplication in ROAbstractArrow. 
I refactored the methods 

- drawOn: aCanvas for: anEdge fromPoint: fromPoint toPoint: toPoint line: line 
and
- drawOn: aCanvas for: anEdge line: line

Here is the corresponding .st file: http://cl.ly/code/1r2g2c303w0F. If you agree with the change, you could add it to Roassal.

Will keep you updated about my progress with the arrows and lines.

Cheers,
Dennis

On Wed, Sep 12, 2012 at 1:49 PM, Alexandre Bergel <[hidden email]> wrote:
Hi Dennis,

This should be easy to achieve. Create a subclass of ROLine, override lineSegmentsFor: and drawOnFor:

In the implementation of the lines, drawOnFor: does not use lineSegmentsFor:, however it should. My advice is therefore try to keep drawOnFor: as simple as possible, by calling lineSegmentsFor:

lineSegmentsFor: is intended to return a collection of points to draw lines. Give a try, it should not be that hard. We could do a remote pair programming if you want (my MSN id is [hidden email]).

Cheers,
Alexandre


On Sep 12, 2012, at 8:07 AM, Dennis Schenk <[hidden email]> wrote:

> Hi all,
>
> I'd like to customize lines with arrows a little bit more than seems to be possible out of the box at the moment and am looking for some pointers.
>
> I have attached a screenshot to explain what I'd like to achieve.
>
> I'd like to be able to:
>       • Define a certain distance from the arrows beginning and end to the objects they are attached to - so they are not directly 'glued' to the objects.
>       • Make lines wider, without just affecting the width of the line (and in the same extend the line the arrow is made up), but instead it should scale to nice looking arrows.
>       • To place lines besides each other from and to the same object.
> Are some of these points already possible but I missed them?
> How would I best go on about modifying, extending Roassal to allow for edge styling in this way?
>
> Cheers,
> Dennis
> <roassal-arrows.png>_______________________________________________
> 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: Roassal: Lines and Arrows

Tudor Girba-2
Nice :). Thanks for the effort.

Doru


On Wed, Sep 19, 2012 at 10:44 AM, Dennis Schenk
<[hidden email]> wrote:

> Hi Alex,
>
> I worked on the arrows and lines. See the following Screenshot:
> http://cl.ly/image/1t2Z461a3k0n.
>
> The arrows are attached with a ROShorterDistanceAttachPoint but the lines
> leave a certain gap to the attach point. Also I removed the bottom line of
> the arrows.
> For this particular visualization I also used some 'visual weighting' to
> draw the arrows (using opacity and width).
>
> I did not yet implement my new line class exactly as as you suggested yet,
> does not yet use lineSegmentsFor:, I only using drawOnFor: at the moment)
> will refactor that soon though.
>
> While looking at the lines and arrow classes I saw some code duplication in
> ROAbstractArrow.
> I refactored the methods
>
> - drawOn: aCanvas for: anEdge fromPoint: fromPoint toPoint: toPoint line:
> line
> and
> - drawOn: aCanvas for: anEdge line: line
>
> Here is the corresponding .st file: http://cl.ly/code/1r2g2c303w0F. If you
> agree with the change, you could add it to Roassal.
>
> Will keep you updated about my progress with the arrows and lines.
>
> Cheers,
> Dennis
>
> On Wed, Sep 12, 2012 at 1:49 PM, Alexandre Bergel <[hidden email]>
> wrote:
>>
>> Hi Dennis,
>>
>> This should be easy to achieve. Create a subclass of ROLine, override
>> lineSegmentsFor: and drawOnFor:
>>
>> In the implementation of the lines, drawOnFor: does not use
>> lineSegmentsFor:, however it should. My advice is therefore try to keep
>> drawOnFor: as simple as possible, by calling lineSegmentsFor:
>>
>> lineSegmentsFor: is intended to return a collection of points to draw
>> lines. Give a try, it should not be that hard. We could do a remote pair
>> programming if you want (my MSN id is [hidden email]).
>>
>> Cheers,
>> Alexandre
>>
>>
>> On Sep 12, 2012, at 8:07 AM, Dennis Schenk <[hidden email]>
>> wrote:
>>
>> > Hi all,
>> >
>> > I'd like to customize lines with arrows a little bit more than seems to
>> > be possible out of the box at the moment and am looking for some pointers.
>> >
>> > I have attached a screenshot to explain what I'd like to achieve.
>> >
>> > I'd like to be able to:
>> >       • Define a certain distance from the arrows beginning and end to
>> > the objects they are attached to - so they are not directly 'glued' to the
>> > objects.
>> >       • Make lines wider, without just affecting the width of the line
>> > (and in the same extend the line the arrow is made up), but instead it
>> > should scale to nice looking arrows.
>> >       • To place lines besides each other from and to the same object.
>> > Are some of these points already possible but I missed them?
>> > How would I best go on about modifying, extending Roassal to allow for
>> > edge styling in this way?
>> >
>> > Cheers,
>> > Dennis
>> > <roassal-arrows.png>_______________________________________________
>> > 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
>



--
www.tudorgirba.com

"Every thing has its own flow"

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

Re: Roassal: Lines and Arrows

Mircea Filip Lungu-2
In reply to this post by Dennis Schenk
> For this particular visualization I also used some 'visual weighting' to
> draw the arrows (using opacity and width).

I like the "visual weighting" with opacity :)

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

Re: Roassal: Lines and Arrows

abergel
In reply to this post by Dennis Schenk
> I worked on the arrows and lines. See the following Screenshot: http://cl.ly/image/1t2Z461a3k0n.

Gorgeous!

> While looking at the lines and arrow classes I saw some code duplication in ROAbstractArrow.
> I refactored the methods
>
> - drawOn: aCanvas for: anEdge fromPoint: fromPoint toPoint: toPoint line: line
> and
> - drawOn: aCanvas for: anEdge line: line
>
> Here is the corresponding .st file: http://cl.ly/code/1r2g2c303w0F. If you agree with the change, you could add it to Roassal.
>
> Will keep you updated about my progress with the arrows and lines.

Yes, it is in version 1.124

Cheers,
Alexandre

>
> On Wed, Sep 12, 2012 at 1:49 PM, Alexandre Bergel <[hidden email]> wrote:
> Hi Dennis,
>
> This should be easy to achieve. Create a subclass of ROLine, override lineSegmentsFor: and drawOnFor:
>
> In the implementation of the lines, drawOnFor: does not use lineSegmentsFor:, however it should. My advice is therefore try to keep drawOnFor: as simple as possible, by calling lineSegmentsFor:
>
> lineSegmentsFor: is intended to return a collection of points to draw lines. Give a try, it should not be that hard. We could do a remote pair programming if you want (my MSN id is [hidden email]).
>
> Cheers,
> Alexandre
>
>
> On Sep 12, 2012, at 8:07 AM, Dennis Schenk <[hidden email]> wrote:
>
> > Hi all,
> >
> > I'd like to customize lines with arrows a little bit more than seems to be possible out of the box at the moment and am looking for some pointers.
> >
> > I have attached a screenshot to explain what I'd like to achieve.
> >
> > I'd like to be able to:
> >       • Define a certain distance from the arrows beginning and end to the objects they are attached to - so they are not directly 'glued' to the objects.
> >       • Make lines wider, without just affecting the width of the line (and in the same extend the line the arrow is made up), but instead it should scale to nice looking arrows.
> >       • To place lines besides each other from and to the same object.
> > Are some of these points already possible but I missed them?
> > How would I best go on about modifying, extending Roassal to allow for edge styling in this way?
> >
> > Cheers,
> > Dennis
> > <roassal-arrows.png>_______________________________________________
> > 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

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




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