Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Customizing SnapToGrid behaviour
Customizing SnapToGrid behaviour [message #216858] Fri, 26 May 2006 08:30
Eclipse UserFriend
Originally posted by:

Hi everyone,

I've just tested SnapToGrid functionnality with an example inspired from
the Shapes example and it rocks !
I noticed that the default behaviour is to force a shape to be dropped on
the northern-west of the grid cell. I would like to customize this
behaviour according either to the sub-type (instanceof) of the shape being
dropped or to the value of some attribute. For example, a MyShape1 would
be forced to the NORTH of the cell, and a MyShape2 would be forced to the
After reading the source, I suppose I should intervene on the
"snapLocation" parameter of SnaptoGrid#snapRectangle(...). But I don't
know where this method is called from during a DnD interaction (I'm not
very familiar to the use of adapters).
I would be grateful for any advice.
Previous Topic:import packages in gef cannot be resolved
Next Topic:ediagram example src
Goto Forum:

Current Time: Mon May 30 16:41:17 GMT 2016

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

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