Revision 119 org.gvsig.toolbox/trunk/org.gvsig.toolbox/org.gvsig.toolbox.gui/src/main/java/es/unex/sextante/gui/settings/SextanteGrassSettingsPanel.java
SextanteGrassSettingsPanel.java | ||
---|---|---|
121 | 121 |
final String sFolder = SextanteGUI.getSettingParameterValue(SextanteGrassSettings.GRASS_FOLDER); |
122 | 122 |
jGrassFolder.setFilepath(sFolder); |
123 | 123 |
this.add(jGrassFolder, "2, 4"); |
124 |
|
|
124 |
|
|
125 | 125 |
/* the file selector for sh.exe will only be active if we are running on Windows */ |
126 | 126 |
jLabelWinShell = new JLabel(); |
127 | 127 |
jLabelWinShell.setEnabled(bActivate && Sextante.isWindows()); |
... | ... | |
143 | 143 |
|
144 | 144 |
this.add(new JSeparator(SwingConstants.HORIZONTAL), "1, 6, 2, 6"); |
145 | 145 |
/* ----------------------------------------------------------- */ |
146 |
|
|
146 |
|
|
147 | 147 |
jLabelUpdate = new JLabel(); |
148 | 148 |
jLabelUpdate.setText( Sextante.getText("update_library") ); |
149 | 149 |
jLabelUpdate.setEnabled(bActivate); |
150 |
this.add(jLabelUpdate, "1, 7");
|
|
150 |
this.add(jLabelUpdate, "1, 7"); |
|
151 | 151 |
jButtonUpdate = new JButton(Sextante.getText("load_GRASS_modules")); |
152 | 152 |
jButtonUpdate.setEnabled(bActivate); |
153 |
this.add(jButtonUpdate, "2, 7");
|
|
153 |
this.add(jButtonUpdate, "2, 7"); |
|
154 | 154 |
|
155 | 155 |
this.add(new JSeparator(SwingConstants.HORIZONTAL), "1, 8, 2, 8"); |
156 | 156 |
/* ----------------------------------------------------------- */ |
157 |
|
|
157 |
|
|
158 | 158 |
jCheckBoxLatLon = new JCheckBox(Sextante.getText ("GRASS_lat_lon_mode")); |
159 | 159 |
jCheckBoxLatLon.setSelected(new Boolean(SextanteGUI.getSettingParameterValue |
160 | 160 |
(SextanteGrassSettings.GRASS_LAT_LON_MODE)).booleanValue()); |
... | ... | |
164 | 164 |
jCheckBox3DV.setText(Sextante.getText("grass_input_3d")); |
165 | 165 |
jCheckBox3DV.setSelected(new Boolean(SextanteGUI.getSettingParameterValue |
166 | 166 |
(SextanteGrassSettings.GRASS_3D_V_MODE)).booleanValue()); |
167 |
this.add(jCheckBox3DV, "1, 10, 2, 10");
|
|
168 |
|
|
167 |
this.add(jCheckBox3DV, "1, 10, 2, 10"); |
|
168 |
|
|
169 | 169 |
jCheckBoxNoVectBBox = new JCheckBox(Sextante.getText("grass_no_vect_bbox")); |
170 | 170 |
jCheckBoxNoVectBBox.setSelected(new Boolean(SextanteGUI.getSettingParameterValue |
171 | 171 |
(SextanteGrassSettings.GRASS_NO_VECT_BBOX)).booleanValue()); |
... | ... | |
176 | 176 |
jCheckBoxInPolylines.setSelected(new Boolean(SextanteGUI.getSettingParameterValue |
177 | 177 |
(SextanteGrassSettings.GRASS_IN_POLYLINES)).booleanValue()); |
178 | 178 |
this.add(jCheckBoxInPolylines, "1, 12, 2, 12"); |
179 |
|
|
179 |
|
|
180 | 180 |
jCheckBoxCleanPolygons = new JCheckBox(); |
181 | 181 |
jCheckBoxCleanPolygons.setText(Sextante.getText("grass_clean_polygons")); |
182 | 182 |
jCheckBoxCleanPolygons.setSelected(new Boolean(SextanteGUI.getSettingParameterValue |
183 | 183 |
(SextanteGrassSettings.GRASS_CLEAN_POLYGONS)).booleanValue()); |
184 | 184 |
this.add(jCheckBoxCleanPolygons, "1, 13, 2, 13"); |
185 |
|
|
185 |
|
|
186 | 186 |
jCheckBoxSextanteNull = new JCheckBox(); |
187 | 187 |
jCheckBoxSextanteNull.setText(Sextante.getText("grass_use_sextante_null")); |
188 | 188 |
jCheckBoxSextanteNull.setSelected(new Boolean(SextanteGUI.getSettingParameterValue |
189 | 189 |
(SextanteGrassSettings.GRASS_USE_SEXTANTE_NULL)).booleanValue()); |
190 |
this.add(jCheckBoxSextanteNull, "1, 14, 2, 14");
|
|
191 |
|
|
190 |
this.add(jCheckBoxSextanteNull, "1, 14, 2, 14"); |
|
191 |
|
|
192 | 192 |
jCheckBoxCompatibility = new JCheckBox(); |
193 | 193 |
jCheckBoxCompatibility.setText(Sextante.getText("grass_compatibility_mode")); |
194 | 194 |
jCheckBoxCompatibility.setSelected(new Boolean(SextanteGUI.getSettingParameterValue |
195 | 195 |
(SextanteGrassSettings.GRASS_COMPATIBILITY_MODE)).booleanValue()); |
196 |
this.add(jCheckBoxCompatibility, "1, 15, 2, 15");
|
|
196 |
this.add(jCheckBoxCompatibility, "1, 15, 2, 15"); |
|
197 | 197 |
|
198 | 198 |
} |
199 | 199 |
|
... | ... | |
207 | 207 |
logoLabel.setText("<html><i><a href=http://grass.osgeo.org/>http://grass.osgeo.org/</a></i></html>"); |
208 | 208 |
this.add(logoLabel,"1, 17, 2, 17"); |
209 | 209 |
} |
210 |
|
|
210 |
|
|
211 | 211 |
/**********************************/ |
212 | 212 |
/** Action listeners for widgets **/ |
213 | 213 |
/**********************************/ |
... | ... | |
224 | 224 |
jPortableCheckBox.setEnabled(active); |
225 | 225 |
jLabelGrassFolder.setEnabled(active); |
226 | 226 |
jGrassFolder.getTextField().setEnabled(active); |
227 |
jGrassFolder.getButton().setEnabled(active);
|
|
227 |
jGrassFolder.getButton().setEnabled(active); |
|
228 | 228 |
if ( Sextante.isWindows()) { |
229 | 229 |
jLabelWinShell.setEnabled(active); |
230 | 230 |
jWinShellFile.getTextField().setEnabled(active); |
... | ... | |
250 | 250 |
jWinShellFile.getTextField().setEnabled(false); |
251 | 251 |
jWinShellFile.getButton().setEnabled(false); |
252 | 252 |
} |
253 |
}
|
|
253 |
} |
|
254 | 254 |
setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); |
255 | 255 |
} |
256 | 256 |
}); |
257 | 257 |
} |
258 | 258 |
|
259 | 259 |
jPortableCheckBox.addActionListener(new ActionListener() { |
260 |
public void actionPerformed(final ActionEvent arg0) {
|
|
260 |
public void actionPerformed(final ActionEvent arg0) { |
|
261 | 261 |
setCursor(new Cursor(Cursor.WAIT_CURSOR)); |
262 | 262 |
SextanteGUI.setSettingParameterValue(SextanteGrassSettings.GRASS_PORTABLE, |
263 |
new Boolean(jPortableCheckBox.isSelected()).toString());
|
|
263 |
new Boolean(jPortableCheckBox.isSelected()).toString()); |
|
264 | 264 |
//Set portable GRASS bin dir |
265 | 265 |
SextanteGUI.checkDir ( Sextante.PORTABLE_GRASS_FOLDER, true, "GRASS GIS" ); |
266 |
String sPath = new String (SextanteGUI.getSextantePath() + File.separator + Sextante.PORTABLE_GRASS_FOLDER);
|
|
266 |
String sPath = new String (SextanteGUI.getSextanteInstallPath() + File.separator + Sextante.PORTABLE_GRASS_FOLDER);
|
|
267 | 267 |
SextanteGUI.setSettingParameterValue(SextanteGrassSettings.GRASS_FOLDER, sPath); |
268 | 268 |
jGrassFolder.setFilepath(sPath); |
269 | 269 |
if ( Sextante.isWindows()) { |
270 | 270 |
//Set portable sh.exe file |
271 | 271 |
SextanteGUI.checkFile ( Sextante.PORTABLE_MSYS_FILE, false, "GRASS GIS shell scripts" ); |
272 |
sPath = SextanteGUI.getSextantePath() + File.separator + Sextante.PORTABLE_MSYS_FILE; |
|
272 |
sPath = SextanteGUI.getSextanteInstallPath() + File.separator + Sextante.PORTABLE_MSYS_FILE;
|
|
273 | 273 |
SextanteGUI.setSettingParameterValue(SextanteGrassSettings.GRASS_WIN_SHELL, sPath); |
274 | 274 |
jWinShellFile.setFilepath(sPath); |
275 | 275 |
} |
... | ... | |
287 | 287 |
} else { |
288 | 288 |
jLabelGrassFolder.setEnabled(true); |
289 | 289 |
jGrassFolder.getTextField().setEnabled(true); |
290 |
jGrassFolder.getButton().setEnabled(true);
|
|
290 |
jGrassFolder.getButton().setEnabled(true); |
|
291 | 291 |
if ( Sextante.isWindows()) { |
292 | 292 |
jLabelWinShell.setEnabled(true); |
293 | 293 |
jWinShellFile.getTextField().setEnabled(true); |
... | ... | |
297 | 297 |
setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); |
298 | 298 |
} |
299 | 299 |
}); |
300 |
|
|
300 |
|
|
301 | 301 |
/* trigger update of GRASS modules registry */ |
302 | 302 |
jButtonUpdate.addActionListener(new ActionListener() { |
303 | 303 |
public void actionPerformed(final ActionEvent evt) { |
304 | 304 |
jButtonSetupGRASSActionPerformed(evt); |
305 | 305 |
} |
306 |
});
|
|
306 |
}); |
|
307 | 307 |
} |
308 | 308 |
|
309 |
|
|
309 |
|
|
310 | 310 |
@Override |
311 | 311 |
public HashMap<String, String> getValues() { |
312 | 312 |
|
Also available in: Unified diff