Skip to main content



      Home
Home » Eclipse Projects » GEF » Snap to grid on creation?
Snap to grid on creation? [message #167764] Thu, 10 February 2005 13:01 Go to next message
Eclipse UserFriend
I noticed in the logic example, that parts snap to the grid when they
are moved or resized. What changes would be involved to make it so
that new parts snap to the grid when they are dropped onto the figure
canvas? I can't figure out how to do this.

- Sean
Re: Snap to grid on creation? [message #167772 is a reply to message #167764] Thu, 10 February 2005 15:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: no.mail.please

You could add a layout editpolicy to the parent editpart and do the
stuff in createChangeConstraintCommand method.

I think this should work.

--
Arnaud
Re: Snap to grid on creation? [message #167800 is a reply to message #167764] Fri, 11 February 2005 01:01 Go to previous messageGo to next message
Eclipse UserFriend
You should do this in CreationTool#updateTargetRequest(). Look at how
DragEditPartsTracker#updateTargetRequest() does that.

"Sean Neeley" <sean.neeley@dbcsoftware.com> wrote in message
news:cug7lk$sds$1@www.eclipse.org...
> I noticed in the logic example, that parts snap to the grid when they
> are moved or resized. What changes would be involved to make it so
> that new parts snap to the grid when they are dropped onto the figure
> canvas? I can't figure out how to do this.
>
> - Sean
Re: Snap to grid on creation? [message #168223 is a reply to message #167800] Mon, 14 February 2005 11:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Pratik, size-on-create snaps, but accepting the default size on create does
not snap.

"Pratik Shah" <ppshah@us.ibm.com> escreveu na mensagem
news:cuhhok$sr$1@www.eclipse.org...
> You should do this in CreationTool#updateTargetRequest(). Look at how
> DragEditPartsTracker#updateTargetRequest() does that.
>
> "Sean Neeley" <sean.neeley@dbcsoftware.com> wrote in message
> news:cug7lk$sds$1@www.eclipse.org...
>> I noticed in the logic example, that parts snap to the grid when they
>> are moved or resized. What changes would be involved to make it so
>> that new parts snap to the grid when they are dropped onto the figure
>> canvas? I can't figure out how to do this.
>>
>> - Sean
>
>
Re: Snap to grid on creation? [message #168397 is a reply to message #168223] Tue, 15 February 2005 14:50 Go to previous messageGo to next message
Eclipse UserFriend
So how do I do it? BTW, I'm not using a Palette. I add a part by
listening for a mouse click on the figure canvas, then I instantiate my
own CreateRequest and CreateCommand.

Randy Hudson wrote:
> Pratik, size-on-create snaps, but accepting the default size on create does
> not snap.
>
> "Pratik Shah" <ppshah@us.ibm.com> escreveu na mensagem
> news:cuhhok$sr$1@www.eclipse.org...
>
>>You should do this in CreationTool#updateTargetRequest(). Look at how
>>DragEditPartsTracker#updateTargetRequest() does that.
>>
>>"Sean Neeley" <sean.neeley@dbcsoftware.com> wrote in message
>>news:cug7lk$sds$1@www.eclipse.org...
>>
>>>I noticed in the logic example, that parts snap to the grid when they
>>>are moved or resized. What changes would be involved to make it so
>>>that new parts snap to the grid when they are dropped onto the figure
>>>canvas? I can't figure out how to do this.
>>>
>>>- Sean
>>
>>
>
>
Re: Snap to grid on creation? [message #168450 is a reply to message #168397] Tue, 15 February 2005 23:43 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You'll have to send that request through the SnapToHelper. See how other
tools work with that interface.

"Sean Neeley" <sean.neeley@dbcsoftware.com> escreveu na mensagem
news:cutjuk$sud$1@www.eclipse.org...
> So how do I do it? BTW, I'm not using a Palette. I add a part by
> listening for a mouse click on the figure canvas, then I instantiate my
> own CreateRequest and CreateCommand.
>
Previous Topic:Chaning properties don't make dirty
Next Topic:GEF and MultiPageEditorPart
Goto Forum:
  


Current Time: Sat Jun 21 01:52:21 EDT 2025

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

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

Back to the top