Cannot automatically snap to grid! [message #210708] |
Sat, 04 March 2006 06: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!
|
|
|
|
Re: Cannot automatically snap to grid! [message #210899 is a reply to message #210827] |
Mon, 06 March 2006 22:30 |
Eclipse User |
|
|
|
Originally posted by: harsh.ti.com
Steve,
Thank you so much. I am not sure if you saw my other thread related to
this issue but I have been scratching my head over this for days now.
This was the missing link.
Thank you,
Harsh
|
|
|
|
Powered by
FUDForum. Page generated in 0.02448 seconds