Can I use SnapTo during creation [message #81406] |
Tue, 28 November 2006 13:23  |
Eclipse User |
|
|
|
Originally posted by: awm_abu.yahoo.com
Folks,
I am trying to create a diagram with a grid like layout and trying to use
the SnapTo Grid to do this.
It is working fine for moving an object but I can't figure out how to use
the SnapTo functionality on object creation.
In the following method for example I just get ChangeBoundsRequest
public int snapRectangle(Request request, int snapLocations,
PrecisionRectangle rect, PrecisionRectangle result)
Any help would be appreciated.
Thanks.
|
|
|
Re: Can I use SnapTo during creation [message #81424 is a reply to message #81406] |
Tue, 28 November 2006 13:51  |
Eclipse User |
|
|
|
Originally posted by: awm_abu.yahoo.com
Ok maybe I was being a bit quick off the mark when I said the SnapToGrid was
working fine for moving objects.
I'm not quite sure how I go about setting the co-ordinates that the objects
can snap to.
Firstly I'm assuming the method snapRectangle() is what I have to override ?
Secondly I'm looking at that method and I'm not sure how to go about setting
the co-ordinates.
Do I have to set the gridx and gridy values ?
Sorry that this question is a bit vague but if you could point me towards an
example even it would be great.
Background
========
I need a grid like the one attached.
As you can see the cells are not uniform in size
As the diagram zooms the space between the cells changes.
Therefore my grid co-ordinates change constantly.
So I need my SnapToGrid to mirror the GridLayer which I used to draw what
you see
As I say any thoughts would be great
Thanks.
"Alan" <awm_abu@yahoo.com> wrote in message
news:ekhuqa$d6q$1@utils.eclipse.org...
> Folks,
>
> I am trying to create a diagram with a grid like layout and trying to use
> the SnapTo Grid to do this.
> It is working fine for moving an object but I can't figure out how to use
> the SnapTo functionality on object creation.
> In the following method for example I just get ChangeBoundsRequest
>
> public int snapRectangle(Request request, int snapLocations,
> PrecisionRectangle rect, PrecisionRectangle result)
>
>
>
> Any help would be appreciated.
>
>
>
> Thanks.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.28759 seconds