Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 11: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 15:31 Go to previous messageGo to next message
Anthony Hunter is currently offline Anthony HunterFriend
Messages: 446
Registered: July 2009
Senior Member
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 15:36 Go to previous message
David Cummings is currently offline David CummingsFriend
Messages: 8
Registered: July 2009
Junior Member
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: Sat Apr 27 02:29:41 GMT 2024

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

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

Back to the top