Skip to main content

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:Print from multi-page editor w/ a GEF page
Next Topic:Draw2D problems on Linux
Goto Forum:

Current Time: Fri May 25 18:41:04 GMT 2018

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

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

Back to the top