Skip to main content



      Home
Home » Eclipse Projects » GEF » Rcp gef editor and pixels when you move figures
Rcp gef editor and pixels when you move figures [message #225785] Thu, 02 November 2006 06:00 Go to next message
Eclipse UserFriend
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 #225811 is a reply to message #225785] Thu, 02 November 2006 10:31 Go to previous messageGo to next message
Eclipse UserFriend
Hi John,

You can to post a follow-up to the GMF newsgroup.

The GMF Runtime (not experimental) has snap to grid on by default, select
the background on your diagram and look at the Rulers & Grid tab in the
properties view.

Cheers...
Anthony

"John Slave" <matroska@libero.it> wrote in message
news:eicj4s$b7q$1@utils.eclipse.org...
> 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 Go to previous message
Eclipse UserFriend
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
Previous Topic:HandleBounds and selection of children
Next Topic:MultipageEditor and copy paste
Goto Forum:
  


Current Time: Tue May 20 00:18:20 EDT 2025

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

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

Back to the top