Revision 93

View differences:

org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.common/buildNumber.properties
1
#Mon Jan 25 12:30:09 CET 2016
2
buildNumber=22
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.common/src/test/resources/log4j.xml
1
<?xml version="1.0" encoding="ISO-8859-1" ?>
2
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3

  
4
<!-- 
5
Log4J configuration file for unit tests execution.
6
 -->
7
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
8

  
9
	<!-- Appender configuration to show logging messages through the console -->
10
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
11
		<layout class="org.apache.log4j.PatternLayout">
12
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
13
		</layout>
14
	</appender>
15

  
16
	<!-- 
17
	Activate logging messages of DEBUG level of higher only for the
18
	org.gvsig.tools packages.
19
	You can put full classes names or packages instead, to configure
20
	logging for all the classes and subpackages of the package.
21
	-->
22
	<category name="org.gvsig.tools">
23
		<priority value="DEBUG" />
24
	</category>
25
	<category name="org.gvsig.app.document.layout">
26
		<priority value="DEBUG" />
27
	</category>
28

  
29
	<!-- 
30
	By default, show only logging messages of INFO level or higher, 
31
	through the previously configured CONSOLE appender. 
32
	-->
33
	<root>
34
		<priority value="INFO" />
35
		<appender-ref ref="CONSOLE" />
36
	</root>
37
</log4j:configuration>
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.common/src/test/resources/README.txt
1
Put into this folder the resources needed by your test classes.
2

  
3
This folder is added to the Tests classpath, so you can load any resources 
4
through the ClassLoader.
5

  
6
By default, in this folder you can find an example of log4j configuration,
7
prepared to log messages through the console, so logging works when you
8
run your tests classes.
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.common/src/main/java/org/gvsig/jvmpreferences/nativeprefs/ui/MemoryPreferencesPage.java
1
package org.gvsig.jvmpreferences.nativeprefs.ui;
2

  
3

  
4
import java.awt.Color;
5
import java.awt.Dimension;
6
import java.awt.GridBagConstraints;
7
import java.awt.GridBagLayout;
8
import java.awt.Insets;
9
import java.awt.event.ActionEvent;
10
import java.awt.event.ActionListener;
11

  
12
import javax.swing.BorderFactory;
13
import javax.swing.ButtonGroup;
14
import javax.swing.ImageIcon;
15
import javax.swing.JEditorPane;
16
import javax.swing.JLabel;
17
import javax.swing.JPanel;
18
import javax.swing.JRadioButton;
19
import javax.swing.JSlider;
20
import javax.swing.event.ChangeEvent;
21
import javax.swing.event.ChangeListener;
22

  
23
import org.gvsig.andami.preferences.AbstractPreferencePage;
24
import org.gvsig.andami.preferences.StoreException;
25
import org.gvsig.i18n.Messages;
26
import org.gvsig.jvmpreferences.nativeprefs.MemoryPreferences;
27
import org.gvsig.jvmpreferences.nativeprefs.NativePrefsLocator;
28
import org.gvsig.tools.swing.api.ToolsSwingLocator;
29
import org.gvsig.gui.beans.swing.JNumberSpinner;
30

  
31
public class MemoryPreferencesPage extends AbstractPreferencePage {
32
	private ImageIcon icon =  ToolsSwingLocator.getIconThemeManager().getCurrent().get("memory-preferences");
33
	private MemoryPreferences mempref = NativePrefsLocator.getManager().getMemoryPreferences();
34
	private JSlider slider;
35
	private int maxSafe;
36
	private JLabel lblHeader = null;
37
	private ButtonGroup btGroup = null;
38
	private JRadioButton rbSafeLimits = null;
39
	private JRadioButton rbCustomValue = null;
40
	private JNumberSpinner nfCustomValueFld = null;
41
	private JEditorPane lblWarning = null;
42
	private boolean enabled;
43
	private int initialValue;
44
	private JPanel pnlWarningContainer = null;
45
	private JPanel pnlSlider = null;
46
	private JLabel lblSliderValue = null;
47

  
48
	public MemoryPreferencesPage() {
49
		super();
50
		initComponents();
51
//		setParentID(GeneralPage.class.getName()); // commented as we don't want to depend from core plugin
52
	}
53
	
54
	private void initComponents() {
55
		GridBagConstraints c = new GridBagConstraints();
56
		Insets mainInsets = new Insets(4, 4, 4, 4);
57
		int gridy = 0;
58
		if (mempref.isConfigWritable()) {
59
			enabled = true;
60
			maxSafe = mempref.getSafeMemoryMaximum();
61
			Insets indentedInsets = new Insets(4, 22, 4, 4);
62
			c.gridx = 0;
63
			c.anchor = GridBagConstraints.LINE_START;
64
			c.gridwidth = 2;
65
			c.gridy = gridy++;
66
			c.insets = mainInsets;
67
			add(getRbSafeLimits(), c);
68
			c.fill = GridBagConstraints.HORIZONTAL;
69
			c.gridy = gridy++;
70
			c.insets = indentedInsets;
71
			add(getPnlSlider(), c);
72
			c.gridx = 0;
73
			c.gridwidth = 2;
74
			c.gridy = gridy++;
75
			c.insets = mainInsets;
76
			c.fill = GridBagConstraints.NONE;
77
			add(getRbCustomValue(), c);
78
			c.gridwidth = 1;
79
			c.gridy = gridy++;
80
			c.fill = GridBagConstraints.NONE;
81
			c.insets = indentedInsets;
82
			add(getNfCustomValueFld(), c);
83
			c.insets = mainInsets;
84
			c.gridx = 1;
85
			add(getLblMegabytes(), c);
86
			c.gridx = 0;
87
			c.gridwidth = 2;
88
			c.fill = GridBagConstraints.HORIZONTAL;
89
			c.insets = new Insets(10, 10, 10, 10);
90
			c.gridy = gridy;
91
			add(getPnlWarningContainer(), c);
92
/*
93
			c.insets = mainInsets;
94
			c.fill = GridBagConstraints.HORIZONTAL;
95
			c.gridx = 0;
96
			c.gridy = 0;
97
			this.add(getGroupPanel(), c);*/
98
			enableSafeValue();
99
		}
100
		else {
101
			enabled = false;
102
			c.gridx = 0;
103
			c.gridy = gridy;
104
			c.anchor = GridBagConstraints.LINE_START;
105
			c.insets = mainInsets;
106
			add(getLblWarning(getPermissionsWarningText()), c);
107
			/*
108
			c.insets = mainInsets;
109
			c.fill = GridBagConstraints.HORIZONTAL;
110
			c.gridx = 0;
111
			c.gridy = 0;
112
			this.add(getGroupPanel(), c);*/
113
		}
114
	}
115
	
116
	public String getID() {
117
		return MemoryPreferencesPage.class.getName();
118
	}
119

  
120
	public String getTitle() {
121
		return Messages.getText("Memory");
122
	}
123

  
124
	public JPanel getPanel() {
125
		return this;
126
	}
127
	
128
	
129
	private JLabel getHeaderLabel() {
130
		if (lblHeader==null) {
131
			lblHeader  = new JLabel(Messages.getText("Maximum_memory_configuration_Requires_restart"));
132
		}
133
		return lblHeader;
134
	}
135

  
136
	public void initializeValues() {
137
		if (enabled) {
138
			int currentValue = mempref.readConfiguredMaximum();
139
			initialValue = currentValue;
140
			setValue(currentValue);
141
		}
142
	}
143
	
144
	public void setValue(int maxMemory) {
145
		if (enabled) {
146
			if (maxMemory>maxSafe) {
147
				enableCustomValue();
148
				getNfCustomValueFld().setInteger(maxMemory);
149
			}
150
			else {
151
				enableSafeValue();
152
				getSafeSlider().setValue(maxMemory);
153
			}
154
		}
155
	}
156
	
157
	public int getValue() {
158
		if (enabled) {
159
			if (getRbCustomValue().isSelected()) {
160
				return getNfCustomValueFld().getInteger();
161
			}
162
			else {
163
				return getSafeSlider().getValue();
164
			}
165
		}
166
		else return -1;
167
	}
168
	
169
	private void enableCustomValue() {
170
		getRbCustomValue().setSelected(true);
171
		getSafeSlider().setEnabled(false);
172
		getNfCustomValueFld().setEnabled(true);
173
	}
174
	
175
	private void enableSafeValue() {
176
		getRbSafeLimits().setSelected(true);
177
		getNfCustomValueFld().setEnabled(false);
178
		getSafeSlider().setEnabled(true);
179
	}
180

  
181
	public void initializeDefaults() {
182
		if (enabled) {
183
			int maxMem = mempref.getFactoryDefaultMaximum();
184
			setValue(maxMem);
185
		}
186
	}
187

  
188
	public ImageIcon getIcon() {
189
		return icon;
190
	}
191

  
192
	public boolean isValueChanged() {
193
		return (initialValue!=getValue());
194
	}
195

  
196
	@Override
197
	public void storeValues() throws StoreException {
198
		if (enabled) {
199
			mempref.saveConguredMaximum(getValue());
200
		}
201
	}
202

  
203
	@Override
204
	public void setChangesApplied() {
205
	}
206

  
207
	///////////////////////////
208
	// UI components follow: 
209
	//////////////////////////
210
	
211
	
212
	private JRadioButton getRbSafeLimits() {
213
		if (rbSafeLimits==null) {
214
			rbSafeLimits = new JRadioButton(Messages.getText("Safe_limits"));
215
			getButtonGroup().add(rbSafeLimits);
216
			rbSafeLimits.addActionListener(new ActionListener() {
217

  
218
				public void actionPerformed(ActionEvent e) {
219
					if (e.getSource()==rbSafeLimits) {
220
						int currentValue = getNfCustomValueFld().getInteger();
221
						if (currentValue>maxSafe) {
222
							getSafeSlider().setValue(maxSafe);
223
						}
224
						else {
225
							getSafeSlider().setValue(currentValue);
226
						}
227
						enableSafeValue();
228
					}
229
				}
230
				
231
			});
232
			
233
		}
234
		return rbSafeLimits;
235
	}
236
	
237
	private JRadioButton getRbCustomValue() {
238
		if (rbCustomValue==null) {
239
			rbCustomValue = new JRadioButton(Messages.getText("Custom_value"));
240
			getButtonGroup().add(rbCustomValue);
241
			rbCustomValue.addActionListener(new ActionListener() {
242

  
243
				public void actionPerformed(ActionEvent e) {
244
					if (e.getSource()==rbCustomValue) {
245
						getNfCustomValueFld().setInteger(getSafeSlider().getValue());
246
						enableCustomValue();
247
					}
248
				}
249
				
250
			});
251
		}
252
		return rbCustomValue;	
253
	}
254
	
255
	private ButtonGroup getButtonGroup() {
256
		if (btGroup==null) {
257
			btGroup = new ButtonGroup();
258
		}
259
		return btGroup;
260
	}
261
	
262
	private JSlider getSafeSlider() {
263
		if (slider==null) {
264
			slider = new JSlider(256, maxSafe);
265
			slider.setMajorTickSpacing((maxSafe-256));
266
			slider.setPaintTicks(true);
267
			slider.setPaintLabels(true);
268
			slider.setValue(maxSafe);
269
			slider.addChangeListener(new ChangeListener() {
270

  
271
				public void stateChanged(ChangeEvent e) {
272
					JSlider sl = ((JSlider) e.getSource());
273
					getLblSliderValue().setText(sl.getValue()+" "+Messages.getText("MB"));					
274
				}
275
				
276
			});
277
		}
278
		return slider;
279
	}
280
	
281
	private JNumberSpinner getNfCustomValueFld() {
282
		if (nfCustomValueFld==null) {
283
			nfCustomValueFld = new JNumberSpinner(256, 6, 256, 1048576, 4);
284
		}
285
		return nfCustomValueFld;
286
	}
287
	
288
	private JLabel getLblMegabytes() {
289
		return new JLabel(Messages.getText("MB"));
290
	}
291
	
292
	private String getSafeRangeWarningText() {
293
		StringBuffer buffer = new StringBuffer();
294
		buffer.append("<p><b>").append(Messages.getText("Warning_using_values_higher_than_safe_range_can_cause_gvSIG_doesnt_start")).append("</b></p>");
295
		buffer.append("<p><b>").append(Messages.getText("In_this_case_you_will_need_to_edit_gvSIG_config_files_by_hand")).append("</b></p>");
296
		buffer.append("<p><b>").append(Messages.getText("On_Windows_config_is_stored_in_file_gvsig-desktop.l4j.ini_On_Linux_edit_gvSIG.sh_directly")).append("</b></p>");
297
		return buffer.toString();
298
	}
299
	
300
	private String getPermissionsWarningText() {
301
		StringBuffer buffer = new StringBuffer();
302
		buffer.append("<p><b>").append(Messages.getText("You_need_to_execute_gvSIG_as_administrator_to_configure_memory")).append("</b></p>");
303
		buffer.append("<p><b>").append(Messages.getText("On_Windows_right_click_gvSIG_icon_and_select_Run_as_administrator")).append("</b></p>");
304
		return buffer.toString();
305
	}
306
	
307
	private JPanel getPnlWarningContainer() {
308
		// this panel is just used to add some padding between the border and the inner html text
309
		if (pnlWarningContainer==null) {
310
			pnlWarningContainer = new JPanel(new GridBagLayout());
311
			GridBagConstraints c = new GridBagConstraints();
312
			c.gridx = 0;
313
			c.gridy = 0;
314
			c.insets = new Insets(0, 5, 0, 5);
315
			JEditorPane pane = getLblWarning(getSafeRangeWarningText());
316
			pnlWarningContainer.add(pane, c);
317
			pnlWarningContainer.setBorder(BorderFactory.createLineBorder(Color.RED));
318
		}
319
		return pnlWarningContainer;
320
	}
321
	
322
	private JLabel getLblSliderValue() {
323
		if (lblSliderValue==null) {
324
			lblSliderValue  = new JLabel(getValue()+" "+Messages.getText("MB"));
325
		}
326
		return lblSliderValue;
327
	}
328
	
329
	private JPanel getPnlSlider() {
330
		if (pnlSlider==null) {
331
			pnlSlider = new JPanel(new GridBagLayout());
332
			GridBagConstraints c = new GridBagConstraints();
333
			c.gridx = 0;
334
			c.gridy = 0;
335
			c.anchor = GridBagConstraints.PAGE_START;
336
			c.fill = GridBagConstraints.HORIZONTAL;
337
			pnlSlider.add(getSafeSlider(), c);
338
			c.gridx = 1;
339
			c.fill = GridBagConstraints.NONE;
340
			pnlSlider.add(getLblSliderValue(), c);
341
		}
342
		return pnlSlider;
343
	}
344
	
345
	private JEditorPane getLblWarning(String text) {
346
		if (lblWarning==null) {
347
			lblWarning=new JEditorPane();
348
			lblWarning.setBackground(getLblMegabytes().getBackground());
349
			lblWarning.setContentType("text/html");
350
			lblWarning.setText(text);
351
			Dimension size = new Dimension(400, 200);
352
			lblWarning.setPreferredSize(size);
353
		}
354
		return lblWarning;
355
	}
356
}
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.common/src/main/java/org/gvsig/app/extension/BaseNativePrefsExtension.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.app.extension;
23

  
24
import org.gvsig.andami.IconThemeHelper;
25
import org.gvsig.andami.plugins.Extension;
26
import org.gvsig.andami.preferences.IPreference;
27
import org.gvsig.andami.preferences.IPreferenceExtension;
28
import org.gvsig.jvmpreferences.nativeprefs.ui.MemoryPreferencesPage;
29
import org.slf4j.Logger;
30
import org.slf4j.LoggerFactory;
31

  
32
/**
33
 * Extension to register the native preferences pages and managers
34
 * 
35
 * @author Cesar Martinez Izquierdo
36
 */
37
public abstract class BaseNativePrefsExtension extends Extension implements IPreferenceExtension {
38

  
39
    protected static final Logger logger = LoggerFactory
40
        .getLogger(BaseNativePrefsExtension.class);
41

  
42

  
43
    /**
44
     * @see org.gvsig.andami.plugins.IExtension#execute(java.lang.String)
45
     */
46
    public void execute(String s) {
47
    }
48

  
49
    /**
50
     * @see com.iver.mdiApp.plugins.IExtension#isVisible()
51
     */
52
    public boolean isVisible() {
53
        return false;
54
    }
55

  
56
    /**
57
     * @see org.gvsig.andami.plugins.IExtension#initialize()
58
     */
59
    public void initialize() {
60
        registerIcons();
61
        registerNativePrefsManagers();
62
    }
63

  
64
    protected void registerIcons() {
65
        // preference icons
66
        IconThemeHelper.registerIcon("preferences", "memory-preferences", this);
67
    }
68
    
69
    protected abstract void registerNativePrefsManagers();
70

  
71
    /**
72
     * @see org.gvsig.andami.plugins.IExtension#isEnabled()
73
     */
74
    public boolean isEnabled() {
75
        return false;
76
    }
77

  
78
    public IPreference[] getPreferencesPages() {
79
        return new IPreference[] { 
80
        		new MemoryPreferencesPage()
81
        };
82
    }
83
}
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.common/src/main/resources-plugin/i18n/text.properties
1
Encuadre_Vista=Encuadre sobre la vista
2
Zoom_Completo_Vista=Zoom completo sobre la vista
3
Zoom_Mas_Vista=Zoom m\u00e1s sobre la vista
4
Zoom_Menos_Vista=Zoom menos sobre la vista
5
seleccionar_por_rectangulo=Seleccionar por rect\u00e1ngulo
6
pila_de_comandos=Pila de comandos
7
Imprimir=Imprimir
8
tamano_posicion=Tama\u00f1o/posici\u00f3n
9
insertar_localizador=Insertar localizador
10
_Undo_redo_history=Pila de comandos
11
_Error_while_showing_print_dialog=Error al mostrar di?logo de impresi?n
12
_Some_views_excluded_from_list_because_have_editing_layers=Algunas vistas se han exclu?do de la lista por tener capas en edici?n
13
_Cannot_draw_view_if_layers_in_editing_mode=No es posible dibujar vista con capas en edici?n
14
_Layout_template=Plantilla de mapa
15
_Cant_load_layout_template=No se ha podido abrir plantilla de mapa
16
_Bad_format_in_layout_template=Formato inv?lido en plantilla de mapa
17
Mapa2=Mapa v2
18
High_600_dpi=Alta: 600 puntos por pulgada
19
Normal_300_dpi=Normal: 300 puntos por pulgada
20
Low_72_dpi=Baja: 72 puntos por pulgada
21
Create_new_view=Crear nueva Vista
22
Insert_view=Insertar vista
23
Configure_view=Configurar vista
24
Grid_and_ruler=Malla y regla
25
Show_page_config_dialog_when_layout_document_is_created=Mostrar el di?logo de configuraci?n de p?gina cuando se crea un documento Mapa
26
User_interface=Interfaz de usuario
27
Show_table_of_contents_TOC_for_Layout_views=Mostrar tabla de contenidos (TOC) para las vistas del Layout
28
Synchronize_layers=Sincronizar capas
29
Synchronize_extents=Sincronizar extensi?n del mapa
30
Warning_Enabling_layer_synchronization_will_discard_any_change_not_present_in_associated_view=??Cuidado!! Al activar la sincronizaci?n de capas se perder? cualquier cambio que no est? presente en la vista asociada
31
Warning_Layer_sync=Aviso: sincronizaci?n de capas
32
Top_extent_lbl=Superior
33
Bottom_extent_lbl=Inferior
34
Left_extent_lbl=Izquierda
35
Right_extent_lbl=Derecha
36
Synchronization_of_the_view_and_the_frame_view=Sincronizaci?n de la vista y el marco de la vista
37
Fixed_scale_and_extent=Escala y extensi?n fijos
38
Non_fixed=No fija
39
Fixed_scale=Escala fija
40
Fixed_extent=Extensi?n fija
41
1__=1:
42
Extent_cant_be_synchronized_when_using_fixed_scale_or_fixed_extent=La extensi?n no se puede sincronizar en modo escala fija o extensi?n fija
43
Warning_using_values_higher_than_safe_range_can_cause_gvSIG_doesnt_start=??Cuidado!! El uso de valores por encima del rango de seguridad puede provocar que gvSIG no arranque.
44
In_this_case_you_will_need_to_edit_gvSIG_config_files_by_hand=En ese caso, necesitar? editar a mano el fichero de configuraci?n de gvSIG.
45
On_Windows_config_is_stored_in_file_gvsig-desktop.l4j.ini_On_Linux_edit_gvSIG.sh_directly=En Windows, la configuraci?n se almacena en el fichero 'gvsig-desktop.l4j.ini'. En Linux, edite directamente 'gvSIG.sh'.
46
Maximum_memory_configuration_Requires_restart=Configuraci?n de memoria m?xima (requiere reiniciar)
47
Safe_limits=L?mites seguros
48
Custom_value=Valor personalizado
49
You_need_to_execute_gvSIG_as_administrator_to_configure_memory=Es necesario ejecutar gvSIG como Administrador para poder configurar la memoria.
50
On_Windows_right_click_gvSIG_icon_and_select_Run_as_administrator=En Windows, haga click derecho en el icono de gvSIG y seleccione "Ejecutar como Administrador"
51
Memory=Memoria
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.common/src/main/resources-plugin/i18n/text_en.properties
1
Encuadre_Vista=View frame pan
2
Zoom_Completo_Vista=Full zoom on view
3
Zoom_Mas_Vista=Zoom in on view
4
Zoom_Menos_Vista=Zoom out on view
5
seleccionar_por_rectangulo=Select by rectangle
6
pila_de_comandos=Command stack
7
Imprimir=Print
8
tamano_posicion=Size/location
9
insertar_localizador=Insert locator
10
_Undo_redo_history=Command stack
11
_Error_while_showing_print_dialog=Error while showing print dialog
12
_Some_views_excluded_from_list_because_have_editing_layers=Some views where excluded from the list because they have layers in editing mode
13
_Cannot_draw_view_if_layers_in_editing_mode=Cannot draw view containing layers in editing mode
14
_Layout_template=Layout template
15
_Cant_load_layout_template=Unable to open layout template
16
_Bad_format_in_layout_template=Bad format in layout template
17
Mapa2=Map v2
18
High_600_dpi=High: 600 dots per inch
19
Normal_300_dpi=Normal: 300 dots per inch
20
Low_72_dpi=Low: 72 dots per inch
21
Create_new_view=Create new View
22
Insert_view=Insert view
23
Configure_view=Configure view
24
Grid_and_ruler=Grid and ruler
25
Show_page_config_dialog_when_layout_document_is_created=Show the page config dialog when layout document is created
26
User_interface=User interface
27
Show_table_of_contents_TOC_for_Layout_views=Show table of contents (TOC) for Layout views
28
Synchronize_layers=Synchronize layers
29
Synchronize_extents=Synchronize map extent
30
Warning_Enabling_layer_synchronization_will_discard_any_change_not_present_in_associated_view=Warning!! Enabling layer synchronization will discard any change not present in the associated view
31
Warning_Layer_sync=Warning: Layer synchronization
32
Top_extent_lbl=Top
33
Bottom_extent_lbl=Bottom
34
Left_extent_lbl=Left
35
Right_extent_lbl=Right
36
Synchronization_of_the_view_and_the_frame_view=Synchronization of the view and the frame view
37
Fixed_scale_and_extent=Fixed scale and extent
38
Non_fixed=Non fixed
39
Fixed_scale=Fixed scale
40
Fixed_extent=Fixed extent
41
1__=1:
42
Extent_cant_be_synchronized_when_using_fixed_scale_or_fixed_extent=Extent can\'t be synchronized when using fixed scale or fixed extent
43
Warning_using_values_higher_than_safe_range_can_cause_gvSIG_doesnt_start=Warning!! Using values higher than the safe range can cause gvSIG to doesn't start.
44
In_this_case_you_will_need_to_edit_gvSIG_config_files_by_hand=In this case, you will need to edit gvSIG config files by hand!!
45
On_Windows_config_is_stored_in_file_gvsig-desktop.l4j.ini_On_Linux_edit_gvSIG.sh_directly=On Windows, config is stored in file 'gvsig-desktop.l4j.ini'. On Linux, edit 'gvSIG.sh' directly
46
Maximum_memory_configuration_Requires_restart=Maximum memory configuration (requires restart)
47
Safe_limits=Safe limits
48
Custom_value=Custom value
49
You_need_to_execute_gvSIG_as_administrator_to_configure_memory=You need to execute gvSIG as administrator to be able to configure memory
50
On_Windows_right_click_gvSIG_icon_and_select_Run_as_administrator=On Windows, right click gvSIG icon and select 'Run as Administrator'.
51
Memory=Memory
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.common/src/main/resources-plugin/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
    <alternativeNames name="org.gvsig.jvmpreferences.native"/>
4
    <libraries library-dir="lib"/>
5
    <depends plugin-name="org.gvsig.app.mainplugin" />
6
	<resourceBundle name="text"/>
7
	<extensions>
8
		<extension class-name="org.gvsig.app.extension.NativePrefsExtension"
9
			description="Provides native preferences."
10
			active="true"
11
			priority="10">
12
			
13
		</extension>
14

  
15
	</extensions>
16
</plugin-config>
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.common/src/main/assembly/gvsig-plugin-package.xml
1
<assembly>
2
  <id>gvsig-plugin-package</id>
3
  <formats>
4
    <format>zip</format>
5
  </formats>
6
  <baseDirectory>${project.artifactId}</baseDirectory>
7
  <includeBaseDirectory>true</includeBaseDirectory>
8
  <files>
9
    <file>
10
      <source>target/${project.artifactId}-${project.version}.jar</source>
11
      <outputDirectory>lib</outputDirectory>
12
    </file>
13
    <file>
14
      <source>target/package.info</source>
15
    </file>
16
  </files>
17

  
18
  <fileSets>
19
    <fileSet>
20
      <directory>src/main/resources-plugin</directory>
21
      <outputDirectory>.</outputDirectory>
22
    </fileSet>
23
  </fileSets>
24

  
25
  <dependencySets>
26
  
27
    <dependencySet>
28
      <useProjectArtifact>false</useProjectArtifact>
29
      <useTransitiveDependencies>false</useTransitiveDependencies>
30
      <outputDirectory>lib</outputDirectory>
31
      <includes>
32
          <include>org.gvsig:org.gvsig.jvmpreferences.native.lib.api</include>
33
      </includes>
34
    </dependencySet>
35
    
36
    
37
    
38
  </dependencySets>
39

  
40
</assembly>
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.common/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2

  
3
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
    
5
    <modelVersion>4.0.0</modelVersion>
6
    <packaging>jar</packaging>
7
    <artifactId>org.gvsig.jvmpreferences.native.mainplugin.common</artifactId>
8
    <name>${project.artifactId}</name>
9
    
10
    <parent>
11
        <groupId>org.gvsig</groupId>
12
        <artifactId>org.gvsig.jvmpreferences.native.mainplugin</artifactId>
13
        <version>1.0.20</version>
14
    </parent>
15
    
16
    <dependencies>
17

  
18
        <dependency>
19
            <groupId>org.gvsig</groupId>
20
            <artifactId>org.gvsig.app.mainplugin</artifactId>
21
            <scope>compile</scope>
22
        </dependency>
23
        <dependency>
24
            <groupId>org.gvsig</groupId>
25
            <artifactId>org.gvsig.andami</artifactId>
26
            <scope>compile</scope>
27
        </dependency>
28
        <dependency>
29
            <groupId>org.gvsig</groupId>
30
            <artifactId>org.gvsig.compat.api</artifactId>
31
            <scope>compile</scope>
32
        </dependency>
33
        <dependency>
34
            <groupId>org.gvsig</groupId>
35
            <artifactId>org.gvsig.i18n</artifactId>
36
            <scope>compile</scope>
37
        </dependency>
38

  
39
        <dependency>
40
            <groupId>org.gvsig</groupId>
41
            <artifactId>org.gvsig.jvmpreferences.native.lib.api</artifactId>
42
            <scope>compile</scope>
43
            <version>1.0.20</version>
44
        </dependency>
45
        <dependency>
46
            <groupId>org.gvsig</groupId>
47
            <artifactId>org.gvsig.jvmpreferences.native.lib.impl.common</artifactId>
48
            <scope>compile</scope>
49
            <version>1.0.20</version>
50
        </dependency>
51
        <dependency>
52
            <groupId>org.gvsig</groupId>
53
            <artifactId>org.gvsig.ui</artifactId>
54
            <scope>compile</scope>
55
        </dependency>
56

  
57

  
58
    </dependencies>
59

  
60
    <properties>
61
        <gvsig.install.plugin.package>false</gvsig.install.plugin.package>
62
        <gvsig.install.plugin>false</gvsig.install.plugin>
63
    </properties>
64

  
65

  
66
</project>
67

  
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.windows/src/main/assembly/gvsig-plugin-package.xml
1
<assembly>
2
  <id>gvsig-plugin-package</id>
3
  <formats>
4
    <format>zip</format>
5
  </formats>
6
  <baseDirectory>${gvsig.package.info.code}</baseDirectory>
7
  <includeBaseDirectory>true</includeBaseDirectory>
8
  <files>
9
    <file>
10
      <source>target/${project.artifactId}-${project.version}.jar</source>
11
      <outputDirectory>lib</outputDirectory>
12
    </file>
13
    <file>
14
      <source>target/package.info</source>
15
    </file>
16
  </files>
17

  
18
  <fileSets>
19
    <fileSet>
20
      <directory>target/org.gvsig.jvmpreferences.native.mainplugin.common</directory>
21
      <outputDirectory>.</outputDirectory>
22
      <excludes>
23
        <exclude>package.info</exclude>
24
      </excludes>
25
    </fileSet>
26
    <fileSet>
27
      <directory>src/main/resources-plugin</directory>
28
      <outputDirectory>.</outputDirectory>
29
    </fileSet>
30
  </fileSets>
31

  
32
  <dependencySets>
33
    <dependencySet>
34
      <useProjectArtifact>false</useProjectArtifact>
35
      <useTransitiveDependencies>false</useTransitiveDependencies>
36
      <outputDirectory>lib</outputDirectory>
37
      <includes>
38
          <include>org.gvsig:org.gvsig.jvmpreferences.native.mainplugin.common</include>
39
          <include>org.gvsig:org.gvsig.jvmpreferences.native.lib.api</include>
40
          <include>org.gvsig:org.gvsig.jvmpreferences.native.lib.impl.windows</include>
41
          <include>org.gvsig:org.gvsig.jvmpreferences.native.lib.impl.common</include>
42
      </includes>
43
    </dependencySet>
44
  </dependencySets>
45

  
46
</assembly>
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.windows/src/main/java/org/gvsig/app/extension/NativePrefsExtension.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.app.extension;
23

  
24
import org.gvsig.andami.preferences.IPreferenceExtension;
25
import org.gvsig.jvmpreferences.nativeprefs.NativePrefsLocator;
26
import org.gvsig.jvmpreferences.nativeprefs.NativePrefsManagerWindows;
27

  
28
/**
29
 * Extension to register the native preferences pages and managers
30
 * 
31
 * @author Cesar Martinez Izquierdo
32
 */
33
public class NativePrefsExtension extends BaseNativePrefsExtension implements IPreferenceExtension {
34

  
35
    
36
    protected void registerNativePrefsManagers() {
37
    	NativePrefsLocator.registerNativePrefsManagers(NativePrefsManagerWindows.class);
38
    }
39
}
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.windows/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2

  
3
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
    
5
    <modelVersion>4.0.0</modelVersion>
6
    <packaging>jar</packaging>
7
    <artifactId>org.gvsig.jvmpreferences.native.mainplugin.windows</artifactId>
8
    <name>${project.artifactId}</name>
9
    
10
    <parent>
11
        <groupId>org.gvsig</groupId>
12
        <artifactId>org.gvsig.jvmpreferences.native.mainplugin</artifactId>
13
        <version>1.0.20</version>
14
    </parent>
15
    <properties>
16
        <gvsig.package.info.operatingSystem>win</gvsig.package.info.operatingSystem>
17
    </properties> 
18

  
19
  
20
  <build>
21
    <plugins>
22
      <plugin>
23
        <groupId>org.apache.maven.plugins</groupId>
24
        <artifactId>maven-dependency-plugin</artifactId>
25
        <executions>
26
          <execution>
27
                <id>unpack</id>
28
                <phase>process-sources</phase>
29
                <goals>
30
                  <goal>unpack</goal>
31
                </goals>
32
                <configuration>
33
                  <artifactItems>
34
                    <artifactItem>
35
                            <groupId>org.gvsig</groupId>
36
                            <artifactId>org.gvsig.jvmpreferences.native.mainplugin.common</artifactId>
37
                            <type>zip</type>
38
                            <overWrite>true</overWrite>
39
                            <outputDirectory>target</outputDirectory>
40
                    </artifactItem>
41
                  </artifactItems>
42
                </configuration>
43
          </execution>
44
        </executions>
45
      </plugin>
46
    </plugins>
47
  </build>
48

  
49

  
50
    <dependencies>
51
        <dependency>
52
          <groupId>org.gvsig</groupId>
53
          <artifactId>org.gvsig.jvmpreferences.native.mainplugin.common</artifactId>
54
          <version>1.0.20</version>
55
        </dependency>
56
        <dependency>
57
          <groupId>org.gvsig</groupId>
58
          <artifactId>org.gvsig.jvmpreferences.native.mainplugin.common</artifactId>
59
          <version>1.0.20</version>
60
          <type>zip</type>
61
        </dependency>
62
        <dependency>
63
          <groupId>org.gvsig</groupId>
64
          <artifactId>org.gvsig.jvmpreferences.native.lib.impl.windows</artifactId>
65
          <version>1.0.20</version>
66
        </dependency>
67
        <dependency>
68
          <groupId>org.gvsig</groupId>
69
          <artifactId>org.gvsig.jvmpreferences.native.lib.impl.common</artifactId>
70
          <version>1.0.20</version>
71
        </dependency>
72
        <dependency>
73
          <groupId>org.gvsig</groupId>
74
          <artifactId>org.gvsig.jvmpreferences.native.lib.impl.linux</artifactId>
75
          <version>1.0.20</version>
76
        </dependency>
77
        <dependency>
78
          <groupId>org.gvsig</groupId>
79
          <artifactId>org.gvsig.jvmpreferences.native.lib.api</artifactId>
80
          <version>1.0.20</version>
81
        </dependency>
82
    </dependencies>
83

  
84
  <profiles>
85
    <profile>
86
      <id>gvsig-plugin-install-nativepreferences-windows</id>
87
      <activation>
88
         <os>
89
             <family>windows</family>
90
         </os>
91
      </activation>
92
            <properties>
93
              <gvsig.install.plugin>true</gvsig.install.plugin>
94
            </properties>
95
    </profile>
96
  </profiles>
97

  
98
</project>
99

  
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.windows/buildNumber.properties
1
#Mon Jan 25 12:30:11 CET 2016
2
buildNumber=22
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.linux/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2

  
3
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
    
5
    <modelVersion>4.0.0</modelVersion>
6
    <packaging>jar</packaging>
7
    <artifactId>org.gvsig.jvmpreferences.native.mainplugin.linux</artifactId>
8
    <name>${project.artifactId}</name>
9
    
10
    <parent>
11
        <groupId>org.gvsig</groupId>
12
        <artifactId>org.gvsig.jvmpreferences.native.mainplugin</artifactId>
13
        <version>1.0.20</version>
14
    </parent>
15
    <properties>
16
        <gvsig.package.info.operatingSystem>lin</gvsig.package.info.operatingSystem>
17
    </properties>    
18

  
19
  <build>
20
    <plugins>
21
      <plugin>
22
        <groupId>org.apache.maven.plugins</groupId>
23
        <artifactId>maven-dependency-plugin</artifactId>
24
        <executions>
25
          <execution>
26
                <id>unpack</id>
27
                <phase>process-sources</phase>
28
                <goals>
29
                  <goal>unpack</goal>
30
                </goals>
31
                <configuration>
32
                  <artifactItems>
33
                    <artifactItem>
34
                            <groupId>org.gvsig</groupId>
35
                            <artifactId>org.gvsig.jvmpreferences.native.mainplugin.common</artifactId>
36
                            <type>zip</type>
37
                                              <overWrite>true</overWrite>
38
                                              <outputDirectory>target</outputDirectory>
39
                    </artifactItem>
40
                  </artifactItems>
41
                </configuration>
42
          </execution>
43
        </executions>
44
      </plugin>
45
    </plugins>
46
  </build>
47

  
48

  
49
    <dependencies>
50
        <dependency>
51
          <groupId>org.gvsig</groupId>
52
          <artifactId>org.gvsig.jvmpreferences.native.mainplugin.common</artifactId>
53
          <version>1.0.20</version>
54
          <type>zip</type>
55
        </dependency>
56
        <dependency>
57
          <groupId>org.gvsig</groupId>
58
          <artifactId>org.gvsig.jvmpreferences.native.mainplugin.common</artifactId>
59
          <version>1.0.20</version>
60
        </dependency>
61
        <dependency>
62
          <groupId>org.gvsig</groupId>
63
          <artifactId>org.gvsig.jvmpreferences.native.lib.impl.linux</artifactId>
64
          <version>1.0.20</version>
65
        </dependency>
66
        <dependency>
67
          <groupId>org.gvsig</groupId>
68
          <artifactId>org.gvsig.jvmpreferences.native.lib.impl.common</artifactId>
69
          <version>1.0.20</version>
70
        </dependency>
71
        <dependency>
72
          <groupId>org.gvsig</groupId>
73
          <artifactId>org.gvsig.jvmpreferences.native.lib.api</artifactId>
74
          <version>1.0.20</version>
75
        </dependency>
76
    </dependencies>
77

  
78
  <profiles>
79
    <profile>
80
      <id>gvsig-plugin-install-nativepreferences-linux</id>
81
      <activation>
82
         <os>
83
             <family>unix</family>
84
             <!--  It can be further specialized in the fture (for instance if we want to create a Mac profile):
85
             <name>linux</name>
86
             <arch>x86</arch> (or i386, depending on the JVM and distribution)
87
             -->
88
         </os>
89
      </activation>
90
            <properties>
91
              <gvsig.install.plugin>true</gvsig.install.plugin>
92
            </properties>
93
    </profile>
94
  </profiles>
95

  
96
</project>
97

  
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.linux/buildNumber.properties
1
#Mon Jan 25 12:30:10 CET 2016
2
buildNumber=22
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.linux/src/main/assembly/gvsig-plugin-package.xml
1
<assembly>
2
  <id>gvsig-plugin-package</id>
3
  <formats>
4
    <format>zip</format>
5
  </formats>
6
  <baseDirectory>${gvsig.package.info.code}</baseDirectory>
7
  <includeBaseDirectory>true</includeBaseDirectory>
8
  <files>
9
    <file>
10
      <source>target/${project.artifactId}-${project.version}.jar</source>
11
      <outputDirectory>lib</outputDirectory>
12
    </file>
13
    <file>
14
      <source>target/package.info</source>
15
    </file>
16
  </files>
17

  
18
  <fileSets>
19
    <fileSet>
20
      <directory>target/org.gvsig.jvmpreferences.native.mainplugin.common</directory>
21
      <outputDirectory>.</outputDirectory>
22
      <excludes>
23
        <exclude>package.info</exclude>
24
      </excludes>
25
    </fileSet>
26
    <fileSet>
27
      <directory>src/main/resources-plugin</directory>
28
      <outputDirectory>.</outputDirectory>
29
    </fileSet>
30
  </fileSets>
31

  
32

  
33
  <dependencySets>
34
  
35
    <dependencySet>
36
      <useProjectArtifact>false</useProjectArtifact>
37
      <useTransitiveDependencies>false</useTransitiveDependencies>
38
      <outputDirectory>lib</outputDirectory>
39
      <includes>
40
          <include>org.gvsig:org.gvsig.jvmpreferences.native.mainplugin.common</include>
41
          <include>org.gvsig:org.gvsig.jvmpreferences.native.lib.api</include>
42
          <include>org.gvsig:org.gvsig.jvmpreferences.native.lib.impl.linux</include>
43
          <include>org.gvsig:org.gvsig.jvmpreferences.native.lib.impl.common</include>
44
      </includes>
45
    </dependencySet>
46
    
47
    
48
    
49
  </dependencySets>
50

  
51
</assembly>
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/org.gvsig.jvmpreferences.native.mainplugin.linux/src/main/java/org/gvsig/app/extension/NativePrefsExtension.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.app.extension;
23

  
24
import org.gvsig.andami.preferences.IPreferenceExtension;
25
import org.gvsig.jvmpreferences.nativeprefs.NativePrefsLocator;
26
import org.gvsig.jvmpreferences.nativeprefs.NativePrefsManagerLinux;
27

  
28
/**
29
 * Extension to register the native preferences pages and managers
30
 * 
31
 * @author Cesar Martinez Izquierdo
32
 */
33
public class NativePrefsExtension extends BaseNativePrefsExtension
34
		implements IPreferenceExtension {
35
  
36
    protected void registerNativePrefsManagers() {
37
    	NativePrefsLocator.registerNativePrefsManagers(NativePrefsManagerLinux.class);
38
    }
39
}
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.mainplugin/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2

  
3
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
    
5
    <modelVersion>4.0.0</modelVersion>
6
    <packaging>pom</packaging>
7
    <artifactId>org.gvsig.jvmpreferences.native.mainplugin</artifactId>
8
    <name>Native preferences: mainplugin</name>
9
    
10
    <parent>
11
        <groupId>org.gvsig</groupId>
12
        <artifactId>org.gvsig.jvmpreferences.native</artifactId>
13
        <version>1.0.20</version>
14
    </parent>
15
    
16

  
17
    <properties>
18
        <gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2.1.0</gvsig.package.info.dependencies>
19
        <gvsig.package.info.categories>Native preferences</gvsig.package.info.categories>
20
	<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-jvmpreferences/pool</gvsig.package.info.poolURL>
21
	<gvsig.package.info.sourcesURL>https://svn.scolab.es/print2/trunk/org.gvsig.jvmpreferences.native</gvsig.package.info.sourcesURL>
22
	<gvsig.package.info.state>final</gvsig.package.info.state>
23
        <gvsig.package.info.official>true</gvsig.package.info.official>
24
        <!-- <gvsig.package.info.operatingSystem>all</gvsig.package.info.operatingSystem> -->
25
        <gvsig.package.info.architecture>all</gvsig.package.info.architecture>
26
        <gvsig.install.plugin>false</gvsig.install.plugin>
27
        <gvsig.package.info.code>${project.parent.artifactId}</gvsig.package.info.code>
28
        <gvsig.package.info.description>${project.parent.description}</gvsig.package.info.description>
29
        <gvsig.package.info.name>${project.parent.name}</gvsig.package.info.name>
30
    </properties>
31

  
32
  <modules>
33
    <module>org.gvsig.jvmpreferences.native.mainplugin.common</module>
34
    <module>org.gvsig.jvmpreferences.native.mainplugin.linux</module>
35
    <module>org.gvsig.jvmpreferences.native.mainplugin.windows</module>
36
  </modules>
37

  
38
</project>
39

  
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2
    
3
    <modelVersion>4.0.0</modelVersion>
4
    <artifactId>org.gvsig.jvmpreferences.native</artifactId>
5
    <packaging>pom</packaging>
6
    <version>1.0.20</version>
7
    <name>${project.artifactId}</name>
8
    <description>Provides preferences for system-dependent issues such as memory management.</description>
9
    
10
    <parent>
11
        <groupId>org.gvsig</groupId>
12
        <artifactId>org.gvsig.desktop</artifactId>
13
        <version>2.0.122</version>
14
    </parent>
15
    
16
    <url>https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.jvmpreferences/trunk/org.gvsig.jvmpreferences.native</url>
17
    <scm>
18
        <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20</connection>
19
        <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20</developerConnection>
20
        <url>https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20</url>
21
    </scm>
22
    <repositories>
23
      <repository>
24
        <id>gvsig-public-http-repository</id>
25
        <name>gvSIG maven public HTTP repository</name>
26
        <url>http://devel.gvsig.org/m2repo/j2se</url>
27
        <releases>
28
          <enabled>true</enabled>
29
          <updatePolicy>daily</updatePolicy>
30
          <checksumPolicy>warn</checksumPolicy>
31
        </releases>
32
        <snapshots>
33
          <enabled>true</enabled>
34
          <updatePolicy>daily</updatePolicy>
35
          <checksumPolicy>warn</checksumPolicy>
36
        </snapshots>
37
      </repository>
38
    </repositories>
39

  
40
    <distributionManagement>
41
      <site>
42
        <id>gvsig-repository</id>
43
        <url>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url>
44
      </site>
45
    </distributionManagement>
46
 
47

  
48
	<build>
49
		<plugins>
50
			<plugin>
51
				<groupId>org.apache.maven.plugins</groupId>
52
				<artifactId>maven-release-plugin</artifactId>
53
				<configuration>
54
					<tagBase>https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.jvmpreferences/tags</tagBase>
55
				</configuration>
56
			</plugin>
57
		</plugins>
58
	</build>
59
	<modules>
60
		<module>org.gvsig.jvmpreferences.native.mainplugin</module>
61
		<module>org.gvsig.jvmpreferences.native.lib</module>
62
	</modules>
63

  
64
</project>
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.lib/org.gvsig.jvmpreferences.native.lib.impl.common/src/test/resources/README.txt
1
Put into this folder the resources needed by your test classes.
2

  
3
This folder is added to the Tests classpath, so you can load any resources 
4
through the ClassLoader.
5

  
6
By default, in this folder you can find an example of log4j configuration,
7
prepared to log messages through the console, so logging works when you
8
run your tests classes.
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.lib/org.gvsig.jvmpreferences.native.lib.impl.common/src/test/resources/log4j.xml
1
<?xml version="1.0" encoding="ISO-8859-1" ?>
2
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3

  
4
<!-- 
5
Log4J configuration file for unit tests execution.
6
 -->
7
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
8

  
9
	<!-- Appender configuration to show logging messages through the console -->
10
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
11
		<layout class="org.apache.log4j.PatternLayout">
12
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
13
		</layout>
14
	</appender>
15

  
16
	<!-- 
17
	Activate logging messages of DEBUG level of higher only for the
18
	org.gvsig.tools packages.
19
	You can put full classes names or packages instead, to configure
20
	logging for all the classes and subpackages of the package.
21
	-->
22
	<category name="org.gvsig.tools">
23
		<priority value="DEBUG" />
24
	</category>
25
	<category name="org.gvsig.app.document.layout">
26
		<priority value="DEBUG" />
27
	</category>
28

  
29
	<!-- 
30
	By default, show only logging messages of INFO level or higher, 
31
	through the previously configured CONSOLE appender. 
32
	-->
33
	<root>
34
		<priority value="INFO" />
35
		<appender-ref ref="CONSOLE" />
36
	</root>
37
</log4j:configuration>
org.gvsig.jvmpreferences/tags/org.gvsig.jvmpreferences.native-1.0.20/org.gvsig.jvmpreferences.native.lib/org.gvsig.jvmpreferences.native.lib.impl.common/src/main/java/org/gvsig/jvmpreferences/nativeprefs/BaseMemoryPreferences.java
1
package org.gvsig.jvmpreferences.nativeprefs;
2

  
3

  
4
import java.io.BufferedInputStream;
5
import java.io.BufferedOutputStream;
6
import java.io.BufferedReader;
7
import java.io.BufferedWriter;
8
import java.io.File;
9
import java.io.FileInputStream;
10
import java.io.FileNotFoundException;
11
import java.io.FileOutputStream;
12
import java.io.FileReader;
13
import java.io.FileWriter;
14
import java.io.IOException;
15
import java.io.InputStream;
16
import java.io.OutputStream;
17
import java.lang.management.ManagementFactory;
18
import java.text.SimpleDateFormat;
19
import java.util.Date;
20
import java.util.regex.Matcher;
21
import java.util.regex.Pattern;
22

  
23
import javax.management.AttributeNotFoundException;
24
import javax.management.InstanceNotFoundException;
25
import javax.management.MBeanException;
26
import javax.management.MBeanServer;
27
import javax.management.MalformedObjectNameException;
28
import javax.management.ObjectName;
29
import javax.management.ReflectionException;
30

  
31
import org.gvsig.i18n.Messages;
32
import org.gvsig.jvmpreferences.nativeprefs.MemoryPreferences;
33
import org.slf4j.LoggerFactory;
34

  
35
/**
36
 * This class abstracts the complexity of reading/storing
37
 * memory preferences for different operating systems
38
 * 
39
 * @author Cesar Martinez Izquierdo
40
 *
41
 */
42
public abstract class BaseMemoryPreferences implements MemoryPreferences {
43
	public static final int FACTORY_DEFAULT_MAXIMUM = 512;
44
	
45
	/* (non-Javadoc)
46
	 * @see org.gvsig.preferences.nativeprefs.general.memory.MemoryPreferences#getConfigFile()
47
	 */
48
	public abstract File getConfigFile();
49
	
50
	/* (non-Javadoc)
51
	 * @see org.gvsig.preferences.nativeprefs.general.memory.MemoryPreferences#isConfigWritable()
52
	 */
53
	public boolean isConfigWritable(){
54
		return getConfigFile().canWrite();
55
	}
56
	
57
	/* (non-Javadoc)
58
	 * @see org.gvsig.preferences.nativeprefs.general.memory.MemoryPreferences#getTotalSystemMemory()
59
	 */
60
	public int getTotalSystemMemory() {
61
		MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
62
		Object attribute;
63
		try {
64
			attribute = mBeanServer.getAttribute(new ObjectName("java.lang","type","OperatingSystem"), "TotalPhysicalMemorySize");
65
			System.out.println("Total memory: "+ attribute.toString() +" B");
66
			System.out.println("Total memory: "+ Long.parseLong(attribute.toString())/(1024*1024) +" MB");
67
			return (int) (Long.parseLong(attribute.toString())/(1024*1024));
68
		} catch (AttributeNotFoundException e) {
69
			LoggerFactory.getLogger(BaseMemoryPreferences.class).error("Total_system_memory_cant_be_retrived", e);
70
		} catch (InstanceNotFoundException e) {
71
			LoggerFactory.getLogger(BaseMemoryPreferences.class).error("Total_system_memory_cant_be_retrived", e);
72
		} catch (MalformedObjectNameException e) {
73
			LoggerFactory.getLogger(BaseMemoryPreferences.class).error("Total_system_memory_cant_be_retrived", e);
74
		} catch (MBeanException e) {
75
			LoggerFactory.getLogger(BaseMemoryPreferences.class).error("Total_system_memory_cant_be_retrived", e);
76
		} catch (ReflectionException e) {
77
			LoggerFactory.getLogger(BaseMemoryPreferences.class).error("Total_system_memory_cant_be_retrived", e);
78
		} catch (NullPointerException e) {
79
			LoggerFactory.getLogger(BaseMemoryPreferences.class).error("Total_system_memory_cant_be_retrived", e);
80
		}
81
		return 512;
82
	}
83
	
84
	/* (non-Javadoc)
85
	 * @see org.gvsig.preferences.nativeprefs.general.memory.MemoryPreferences#getSafeMemoryMaximum()
86
	 */
87
	public int getSafeMemoryMaximum() {
88
		int totalMemory = getTotalSystemMemory();
89
		if (totalMemory<=1024) {
90
			return (int)(0.6*(float)totalMemory);
91
		}
92
		String arch = System.getProperty("os.arch");
93
		if ("x86".equals(arch) || "i386".equals(arch)) {
94
			return 1200;
95
		}
96
		return (totalMemory-768);
97
	}
98
	
99
	/* (non-Javadoc)
100
	 * @see org.gvsig.preferences.nativeprefs.general.memory.MemoryPreferences#readConfiguredMaximum()
101
	 */
102
	public int readConfiguredMaximum() {
103
		File launcherFile = getConfigFile();
104
		if (launcherFile.exists()) {
105
			BufferedReader reader = null;
106
			try {
107
				reader = new BufferedReader(new FileReader(launcherFile));
108
				String line;
109
				Pattern pattern = Pattern.compile(getMaxMemoryRegexp());
110
				while ((line = reader.readLine())!=null) {
111
					Matcher m = pattern.matcher(line);
112
					if (m.matches()) {
113
						String memoryStr=m.group(1);
114
						String units = m.group(2);
115
						int configMemory;
116
						try {
117
							// first of all assume it does not have units
118
							configMemory = Integer.parseInt(memoryStr);
119
							System.out.println("Configured memory: " + configMemory);
120
							if (units!=null) {
121
								units = units.toLowerCase();
122
								if ("g".equals(units)) {
123
									configMemory = configMemory * 1024;
124
								}
125
								else if ("k".equals(units)) {
126
									configMemory = (int)((float)configMemory/1024.0);
127
								}
128
							}
129
							return configMemory;
130
						}
131
						catch (NumberFormatException ex) {
132
						}
133
					}
134
				}
135
			} catch (FileNotFoundException e) {
136
				LoggerFactory.getLogger(this.getClass()).error(Messages.getText("Memory_config_could_not_be_retrived"), e);
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff