读书人

兑现GEF中editor的背景为网格

发布时间: 2012-10-08 19:54:56 作者: rapoo

实现GEF中editor的背景为网格
在editor中的initializeGraphicalViewer方法中加上如下代码即可:

getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_ENABLED,new Boolean(true));getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, true);

这个实现的效果如附件效果,只是正对editor的背景,并不会对布局有任何影响

读书人网 >软件架构设计

热点推荐