Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Can I use SnapTo during creation
Can I use SnapTo during creation [message #81406] Tue, 28 November 2006 13:23 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
>
>


Previous Topic:PropertyContributor extension - ActionProvider
Next Topic:Compartment defining question
Goto Forum:
  


Current Time: Thu Jul 17 13:06:42 EDT 2025

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

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

Back to the top