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 04:30
Eclipse User
Originally posted by: samuel.meylan.edu.univ-fcomte.fr

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
CENTER.
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: Thu Aug 28 19:32:24 EDT 2014

Powered by FUDForum. Page generated in 0.03147 seconds