SnapToGrid on connection bendpointshttps://www.eclipse.org/forums/index.php/mv/msg/57264/181735/#msg_181735
I have snap-to-grid working on my graphical edit parts but is has no effect
on the positioning of bend points on connections.

Anyone know if snap-to-grid can be enabled on bend points?

Thanks, Steve.]]>Steve Jones2005-05-19T14:31:35-00:00Re: SnapToGrid on connection bendpointshttps://www.eclipse.org/forums/index.php/mv/msg/57264/182101/#msg_182101
functionality in the future (there's a bug report open about that, so you
might want to CC yourself to it). Of course, you could implement this
yourself. I reckon it won't be too difficult.

"Steve Jones" <steve@istech.demon.co.uk> wrote in message
news:d6i82b$mh$1@news.eclipse.org...
> Hi,
>
> I have snap-to-grid working on my graphical edit parts but is has no
effect
> on the positioning of bend points on connections.
>
> Anyone know if snap-to-grid can be enabled on bend points?
>
> Thanks, Steve.]]>Pratik Shah2005-05-22T18:46:34-00:00Re: SnapToGrid on connection bendpointshttps://www.eclipse.org/forums/index.php/mv/msg/57264/182177/#msg_182177
> No, bendpoints don't snap at the moment. However, we might add that
> functionality in the future (there's a bug report open about that, so you
> might want to CC yourself to it). Of course, you could implement this
> yourself. I reckon it won't be too difficult.

I've done just that:

I needed to sub-class BendpointCreationHandle and
ConnectionBendpointTracker.

In my overloaded BendpointCreationHandle#createDragTracker() method I return
an instance of my sub-classed ConnectionBendpointTracker.

It's in this method that I get the mouse position and snap it to the grid
prior to calling BendpointRequest#setLocation(p);

My only problem was I needed to access the viewport layer to find out where
the grid is currently on the screen as it changes when the user scrolls the
diagram in the viewport.

Steve.

>
> "Steve Jones" <steve@istech.demon.co.uk> wrote in message
> news:d6i82b$mh$1@news.eclipse.org...
>> Hi,
>>
>> I have snap-to-grid working on my graphical edit parts but is has no
> effect
>> on the positioning of bend points on connections.
>>
>> Anyone know if snap-to-grid can be enabled on bend points?
>>
>> Thanks, Steve.

"Steve Jones" <steve@istech.demon.co.uk> wrote in message
news:d6s43e$t2s$1@news.eclipse.org...
> Pratik Shah wrote:
>
> > No, bendpoints don't snap at the moment. However, we might add that
> > functionality in the future (there's a bug report open about that, so
you
> > might want to CC yourself to it). Of course, you could implement this
> > yourself. I reckon it won't be too difficult.
>
> I've done just that:
>
> I needed to sub-class BendpointCreationHandle and
> ConnectionBendpointTracker.
>
> In my overloaded BendpointCreationHandle#createDragTracker() method I
return
> an instance of my sub-classed ConnectionBendpointTracker.
>
> In my sub-classed ConnectionBendpointTracker I overload
> ConnectionBendpointTracker#updateSourceRequest().
>
> It's in this method that I get the mouse position and snap it to the grid
> prior to calling BendpointRequest#setLocation(p);
>
> My only problem was I needed to access the viewport layer to find out
where
> the grid is currently on the screen as it changes when the user scrolls
the
> diagram in the viewport.
>
> Steve.
>
> >
> > "Steve Jones" <steve@istech.demon.co.uk> wrote in message
> > news:d6i82b$mh$1@news.eclipse.org...
> >> Hi,
> >>
> >> I have snap-to-grid working on my graphical edit parts but is has no
> > effect
> >> on the positioning of bend points on connections.
> >>
> >> Anyone know if snap-to-grid can be enabled on bend points?
> >>
> >> Thanks, Steve.
>
> --
> Steve Jones
> I.S.Technology Ltd]]>2005-06-01T02:58:00-00:00Re: SnapToGrid on connection bendpointshttps://www.eclipse.org/forums/index.php/mv/msg/57264/939823/#msg_939823
Have you got solution for adding snap to grid for connection bendpoints, if so kindly post the corresponding code. Since we too in need of that.