Cannot automatically snap to grid! [message #210708] |
Sat, 04 March 2006 01:32  |
Eclipse User |
|
|
|
Originally posted by: java.freshman.cx.gmail.com
Hi, all.
Now I have encountered a amazing problem about Grid.
It is know that grid is a new support feature since GEF 3.1.
According to reference, if we want show grid in gef editor and make node
snaped to geid when dragging, all we need to do is set the property
SnapToGrid.PROPERTY_GRID_VISIBLE and SnapToGrid.PROPERTY_GRID_ENABLED of
GroghicalViewer
as true.
Actually, I have done it and grid can be seen in the backgroud, but node in
the editor cannot be snapped to the grid automatically when dragged. Are
there any more code I should added to my editor or any control I should
perform on EditPart and EditPolicy?
I doubt that the problem may be related with my EditPart hierarchy. My
ediparts are like follows:
RootEditPart
--DiagramEditPart
--NodeEditPart(non-dragable)
--SubnodeEditPart(dragable)
Problem occurs when I try to drag SubnodeEditPart in its container
NodeEditPart and into DiagramEditPart. Is it because the DiagramEditPart
whose figure is FreeformLayer is not direct container of SubnodeEditPart?
I am not sure whther I have gave enough detailsot not, but thanks to those
who pay attention to the problem anyway.
Thank you very much!
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04202 seconds