Skip to main content


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 14:31 Go to next message
Steve Jones is currently offline Steve JonesFriend
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 18:46 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
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 08:24 Go to previous messageGo to next message
Steve Jones is currently offline Steve JonesFriend
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] Wed, 01 June 2005 02:58 Go to previous messageGo to next message
Eclipse UserFriend
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 04:33 Go to previous message
Karthikeyan Missing name is currently offline Karthikeyan Missing nameFriend
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: Thu Apr 25 08:28:12 GMT 2024

Powered by FUDForum. Page generated in 0.03450 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top