01: /* uDig - User Friendly Desktop Internet GIS client
02: * http://udig.refractions.net
03: * (C) 2004, Refractions Research Inc.
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation;
08: * version 2.1 of the License.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: */
15: package net.refractions.udig.tools.edit.preferences;
16:
17: import net.refractions.udig.tools.edit.EditPlugin;
18: import net.refractions.udig.tools.edit.support.SnapBehaviour;
19:
20: import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
21: import org.eclipse.jface.preference.IPreferenceStore;
22: import org.eclipse.jface.preference.PreferenceConverter;
23: import org.eclipse.swt.graphics.RGB;
24:
25: /**
26: * Initializes Editing preferences
27: * @author Jesse
28: * @since 1.1.0
29: */
30: public class PreferenceInitializer extends
31: AbstractPreferenceInitializer {
32:
33: @Override
34: public void initializeDefaultPreferences() {
35:
36: IPreferenceStore store = EditPlugin.getDefault()
37: .getPreferenceStore();
38: PreferenceConverter.setDefault(store,
39: PreferenceConstants.P_SNAP_CIRCLE_COLOR, new RGB(0, 0,
40: 0));
41: PreferenceConverter.setDefault(store,
42: PreferenceConstants.P_VERTEX_OUTLINE_COLOR, new RGB(0,
43: 0, 0));
44: store.setDefault(PreferenceConstants.P_SNAP_RADIUS, 30);
45: store.setDefault(PreferenceConstants.P_VERTEX_SIZE, 4);
46: store.setDefault(PreferenceConstants.P_FILL_POLYGONS, true);
47: store.setDefault(PreferenceConstants.P_FILL_VERTICES, true);
48: store.setDefault(PreferenceConstants.P_HIDE_SELECTED_FEATURES,
49: true);
50: store.setDefault(PreferenceConstants.P_SNAP_BEHAVIOUR,
51: SnapBehaviour.OFF.toString());
52: store.setDefault(PreferenceConstants.P_ADVANCED_ACTIVE, false);
53: }
54:
55: }
|