Revision 70 org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingSwingManager.java
DefaultEditingSwingManager.java | ||
---|---|---|
46 | 46 |
|
47 | 47 |
private static final Logger logger = LoggerFactory |
48 | 48 |
.getLogger(EditingManager.class); |
49 |
|
|
49 |
|
|
50 | 50 |
private I18nManager i18nManager = ToolsLocator.getI18nManager(); |
51 | 51 |
|
52 | 52 |
private final int CANCEL = 0; |
... | ... | |
129 | 129 |
} |
130 | 130 |
|
131 | 131 |
/** |
132 |
* |
|
133 | 132 |
* @param layer |
134 | 133 |
* @param mapControl |
135 | 134 |
* @param option |
... | ... | |
167 | 166 |
} |
168 | 167 |
|
169 | 168 |
public void endEdition(FLyrVect layer, MapControl mapControl) { |
170 |
EditingNotificationManager editingNotificationManager = MapControlLocator |
|
171 |
.getEditingNotificationManager(); |
|
169 |
if (layer.isEditing()) { |
|
170 |
EditingNotificationManager editingNotificationManager = MapControlLocator |
|
171 |
.getEditingNotificationManager(); |
|
172 | 172 |
|
173 |
EditingNotification notification = editingNotificationManager |
|
174 |
.notifyObservers(this, EditingNotification.BEFORE_EXIT_EDITING_STORE, |
|
175 |
null, layer); |
|
173 |
EditingNotification notification = editingNotificationManager
|
|
174 |
.notifyObservers(this, EditingNotification.BEFORE_EXIT_EDITING_STORE,
|
|
175 |
null, layer);
|
|
176 | 176 |
|
177 |
if (notification.isCanceled()) { |
|
178 |
logger.info("Stop edit layer '" + layer.getName() |
|
179 |
+ "' canceled by somme observer.", new EndEditingException( |
|
180 |
"Stop edit layer '" + layer.getName() + "' canceled.", null)); |
|
177 |
if (notification.isCanceled()) {
|
|
178 |
logger.info("Stop edit layer '" + layer.getName()
|
|
179 |
+ "' canceled by somme observer.", new EndEditingException(
|
|
180 |
"Stop edit layer '" + layer.getName() + "' canceled.", null));
|
|
181 | 181 |
|
182 |
} |
|
182 |
} |
|
183 |
mapControl.getCanceldraw().setCanceled(true); |
|
184 |
int option; |
|
185 |
if (layer.isWritable()) { |
|
186 |
option = showPanelSaveOrDiscard(layer.getName()); |
|
187 |
} |
|
188 |
else { |
|
189 |
option = showPanelExportOrDiscard(layer.getName()); |
|
190 |
} |
|
183 | 191 |
|
184 |
int option; |
|
185 |
if (layer.isWritable()) { |
|
186 |
option = showPanelSaveOrDiscard(layer.getName()); |
|
187 |
} |
|
188 |
else { |
|
189 |
option = showPanelExportOrDiscard(layer.getName()); |
|
190 |
} |
|
192 |
doAction(layer, mapControl, option); |
|
191 | 193 |
|
192 |
doAction(layer, mapControl, option); |
|
194 |
editingNotificationManager.notifyObservers(this, |
|
195 |
EditingNotification.AFTER_EXIT_EDITING_STORE, null, layer); |
|
193 | 196 |
|
194 |
editingNotificationManager.notifyObservers(this, |
|
195 |
EditingNotification.AFTER_EXIT_EDITING_STORE, null, layer); |
|
196 |
|
|
197 |
} |
|
197 | 198 |
} |
198 | 199 |
|
199 | 200 |
private void exportLayer(FLyrVect layer, MapControl mapCotrol) |
... | ... | |
239 | 240 |
mainPanel.add(lbl, cc); |
240 | 241 |
cc.gridx = 1; |
241 | 242 |
mainPanel |
242 |
.add(new JLabel(i18nManager.getTranslation("discard_and_loose_changes")), cc); |
|
243 |
.add( |
|
244 |
new JLabel(i18nManager.getTranslation("discard_and_loose_changes")), |
|
245 |
cc); |
|
243 | 246 |
|
244 | 247 |
cc.gridx = 0; |
245 | 248 |
cc.gridy = 2; |
... | ... | |
248 | 251 |
mainPanel.add(lbl, cc); |
249 | 252 |
cc.gridx = 1; |
250 | 253 |
mainPanel.add( |
251 |
new JLabel(i18nManager.getTranslation("do_not_save_yet_stay_in_editing_mode")),
|
|
252 |
cc); |
|
254 |
new JLabel(i18nManager |
|
255 |
.getTranslation("do_not_save_yet_stay_in_editing_mode")), cc);
|
|
253 | 256 |
|
254 | 257 |
resp.add(mainPanel, BorderLayout.CENTER); |
255 | 258 |
resp.add(topLabel, BorderLayout.NORTH); |
... | ... | |
305 | 308 |
} |
306 | 309 |
|
307 | 310 |
/** |
308 |
* |
|
309 | 311 |
* @param name |
310 | 312 |
* @return |
311 | 313 |
*/ |
... | ... | |
314 | 316 |
" " + i18nManager.getTranslation("discard") + " ", |
315 | 317 |
i18nManager.getTranslation("continue") }; |
316 | 318 |
|
317 |
String question = i18nManager.getTranslation("no_existe_writer_para_este_formato_de_capa_o_no_tiene_permisos_de_escritura_los_datos_que_desea_hacer"); |
|
319 |
String question = i18nManager |
|
320 |
.getTranslation("no_existe_writer_para_este_formato_de_capa_o_no_tiene_permisos_de_escritura_los_datos_que_desea_hacer"); |
|
318 | 321 |
String firstLabel = i18nManager.getTranslation("export"); |
319 | 322 |
String firstDesc = i18nManager.getTranslation("export_to_another_format"); |
320 | 323 |
|
... | ... | |
335 | 338 |
} |
336 | 339 |
return CANCEL; |
337 | 340 |
} |
338 |
|
|
341 |
|
|
339 | 342 |
/** |
340 |
* |
|
341 | 343 |
* @param layerName |
342 | 344 |
* @return |
343 | 345 |
*/ |
... | ... | |
346 | 348 |
" " + PluginServices.getText(this, "_Descartar") + " ", |
347 | 349 |
PluginServices.getText(this, "_Continuar") }; |
348 | 350 |
|
349 |
String question = i18nManager.getTranslation("realmente_desea_guardar_la_capa"); |
|
351 |
String question = i18nManager |
|
352 |
.getTranslation("realmente_desea_guardar_la_capa"); |
|
350 | 353 |
question = question + " '" + layerName + "'?"; |
351 | 354 |
String firstLabel = i18nManager.getTranslation("guardar"); |
352 | 355 |
String firstDesc = i18nManager.getTranslation("save_changes_performed"); |
Also available in: Unified diff