Rcp gef editor and pixels when you move figures [message #225785] |
Thu, 02 November 2006 06:00  |
Eclipse User |
|
|
|
Originally posted by: matroska.libero.it
Hi,
i have created a rcp gef editor with gmf however i have problems setting
the pixels to translate figures. In fact there is a sort of automatic
"snap to grid" (with 5 pixel in each directions). I need to set
translation pixel to 1 pixel. What can i do?
Thanks in advance
John Slave
|
|
|
|
Re: Rcp gef editor and pixels when you move figures [message #225819 is a reply to message #225785] |
Thu, 02 November 2006 10:36  |
Eclipse User |
|
|
|
In your RCP application are you using the
org.eclipse.core.runtime.preferences extension point along with a class
that extends
org.eclipse.gmf.runtime.diagram.ui.preferences.DiagramPrefer enceInitializer?
If so, you are most likely calling the
DiagramPreferenceInitializer#initializeDefaultPreferences() method,
which turns on snap to grid for all new diagrams by calling the
RulerGridPreferencePage#initDefaults method.
If you are initializing your editor with the default GMF preferences,
but want snap to grid turned off for new diagrams, you'll need to update
your preference initializer class.
Using the logic diagram code as an example, to disable snap to grid for
new diagrams I would update the
LogicPreferenceInitializer#initializeDefaultPreferences method to:
public void initializeDefaultPreferences() {
super.initializeDefaultPreferences();
// Resetting appearance settings in the logic preference store
IPreferenceStore store = getPreferenceStore();
LogicAppearancePreferencePage.initDefaults(store);
// begin new code
store.setDefault(IPreferenceConstants.PREF_SNAP_TO_GRID,
false);
// end new code
}
David
John Slave wrote:
> Hi,
>
> i have created a rcp gef editor with gmf however i have problems setting
> the pixels to translate figures. In fact there is a sort of automatic
> "snap to grid" (with 5 pixel in each directions). I need to set
> translation pixel to 1 pixel. What can i do?
>
>
> Thanks in advance
> John Slave
|
|
|
Powered by
FUDForum. Page generated in 0.03147 seconds