|Customizing SnapToGrid behaviour [message #216858]
||Fri, 26 May 2006 08:30
Originally posted by: samuel.meylan.edu.univ-fcomte.fr|
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.
Powered by FUDForum
. Page generated in 0.02321 seconds