Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » SnapToGrid on connection bendpoints
SnapToGrid on connection bendpoints [message #181735] Thu, 19 May 2005 10:31 Go to next message
Steve Jones is currently offline Steve Jones
Messages: 95
Registered: July 2009
Member
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.
Re: SnapToGrid on connection bendpoints [message #182101 is a reply to message #181735] Sun, 22 May 2005 14:46 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik Shah
Messages: 1077
Registered: July 2009
Senior Member
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.

"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.
Re: SnapToGrid on connection bendpoints [message #182177 is a reply to message #182101] Mon, 23 May 2005 04:24 Go to previous messageGo to next message
Steve Jones is currently offline Steve Jones
Messages: 95
Registered: July 2009
Member
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
Re: SnapToGrid on connection bendpoints [message #183295 is a reply to message #182177] Tue, 31 May 2005 22:58 Go to previous messageGo to next message
Eclipse User
Originally posted by: none.unknown.com

Steve, would you care to contribute this to GEF? If so, you can change the
code within the GEF classes themselves (no need to sub-class), and can
create a patch. Post the patch here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=68408


"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
Re: SnapToGrid on connection bendpoints [message #939823 is a reply to message #183295] Thu, 11 October 2012 00:33 Go to previous message
Karthikeyan Missing name is currently offline Karthikeyan Missing name
Messages: 47
Registered: July 2011
Member
Hi Steve,

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.

Thanks & Regards,
Karthikeyan.B
Previous Topic:Help in Draw in GEF
Next Topic:Move edit Part, replace period key
Goto Forum:
  


Current Time: Sat Jul 26 05:10:27 EDT 2014

Powered by FUDForum. Page generated in 0.02021 seconds