Revision 7869

View differences:

trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/preferencespage/LayoutPage.java
43 43
*
44 44
* $Id$
45 45
* $Log$
46
* Revision 1.3  2006-10-04 07:23:53  jaume
46
* Revision 1.4  2006-10-04 09:06:35  jaume
47
* *** empty log message ***
48
*
49
* Revision 1.3  2006/10/04 07:23:53  jaume
47 50
* refactored ambiguous methods and field names and added some more features for preference pages
48 51
*
49 52
* Revision 1.2  2006/10/03 11:12:41  jaume
......
64 67
import com.iver.andami.PluginServices;
65 68
import com.iver.andami.preferences.AbstractPreferencePage;
66 69
import com.iver.andami.preferences.StoreException;
70
import com.iver.cit.gvsig.gui.layout.Attributes;
67 71
import com.iver.cit.gvsig.gui.layout.Layout;
68 72
import com.iver.utiles.XMLEntity;
69

  
73
/**
74
 * Layout preference page where the user can establish default values for
75
 * <ol>
76
 *  <li><b>grid horizontal gap</b></li>
77
 *  <li><b>grid vertical gap</b></li>
78
 *  <li><b>show or hide grid</b></li>
79
 *  <li><b>adjust elements to grid</b></li>
80
 *  <li><b>show or hide rules</b></li>
81
 * </ol>
82
 * @author jaume dominguez faus - jaume.dominguez@iver.es
83
 *
84
 */
70 85
public class LayoutPage extends AbstractPreferencePage{
71 86

  
72 87
	private static final boolean FACTORY_DEFAULT_LAYOUT_ENABLE_RULES = true;
73 88
	private static final boolean FACTORY_DEFAULT_LAYOUT_GRID_SHOW = true;
74
	private static final double FACTORY_DEFAULT_VERTICAL_GAP = 0;
75
	private static final double FACTORY_DEFAULT_HORIZONTAL_GAP = 0;
89
	private static final double FACTORY_DEFAULT_VERTICAL_GAP = 0.25;
90
	private static final double FACTORY_DEFAULT_HORIZONTAL_GAP = 0.25;
76 91
	private static final boolean FACTORY_DEFAULT_LAYOUT_GRID_ENABLE = false;
77 92
	private static final String DEFAULT_SHOW_LAYOUT_GRID_KEY_NAME = "DefaultShowLayoutGrid";
78 93
	private static final String DEFAULT_ENABLE_LAYOUT_GRID_KEY_NAME = "DefaultEnableLayoutGrid";
......
87 102
	private JTextField txtVGap;
88 103
	private JTextField txtHGap;
89 104

  
105
	/**
106
	 * Builds preference page where the user can establish default values for
107
	 * <ol>
108
	 *  <li><b>grid horizontal gap</b></li>
109
	 *  <li><b>grid vertical gap</b></li>
110
	 *  <li><b>show or hide grid</b></li>
111
	 *  <li><b>adjust elements to grid</b></li>
112
	 *  <li><b>show or hide rules</b></li>
113
	 * </ol>
114
	 */
90 115
	public LayoutPage() {
91 116
		super();
92 117
		id = this.getClass().getName();
......
124 149
		Layout.setDefaultShowGrid(showGrid);
125 150
		Layout.setDefaultAdjustToGrid(gridEnabled);
126 151
		Layout.setDefaultShowRulers(showRules);
152
		Attributes.setDefaultGridGap(hGap, vGap);
127 153
		PluginServices ps = PluginServices.getPluginServices(this);
128 154
		XMLEntity xml = ps.getPersistentXML();
129 155
		xml.putProperty(DEFAULT_LAYOUT_GRID_HORIZONTAL_GAP_KEY_NAME, hGap);
......
131 157
		xml.putProperty(DEFAULT_SHOW_LAYOUT_GRID_KEY_NAME, showGrid);
132 158
		xml.putProperty(DEFAULT_ENABLE_LAYOUT_GRID_KEY_NAME, gridEnabled);
133 159
		xml.putProperty(DEFAULT_SHOW_LAYOUT_RULES_KEY_NAME, showRules);
134

  
135 160
	}
136 161

  
137 162
	public String getID() {

Also available in: Unified diff