Exemplo n.º 1
0
 @Override
 public void run() {
   GuiHelper.runInEDTAndWait(
       () -> {
         model.setMode(SaveLayersModel.Mode.UPLOADING_AND_SAVING);
         List<SaveLayerInfo> toUpload = model.getLayersToUpload();
         if (!toUpload.isEmpty()) {
           uploadLayers(toUpload);
         }
         List<SaveLayerInfo> toSave = model.getLayersToSave();
         if (!toSave.isEmpty()) {
           saveLayers(toSave);
         }
         model.setMode(SaveLayersModel.Mode.EDITING_DATA);
         if (model.hasUnsavedData()) {
           warnBecauseOfUnsavedData();
           model.setMode(Mode.EDITING_DATA);
           if (canceled) {
             setUserAction(UserAction.CANCEL);
             closeDialog();
           }
         } else {
           setUserAction(UserAction.PROCEED);
           closeDialog();
         }
       });
   worker.shutdownNow();
 }
Exemplo n.º 2
0
 @Override
 public void tableChanged(TableModelEvent arg0) {
   boolean dis = model.getLayersToSave().isEmpty() && model.getLayersToUpload().isEmpty();
   if (saveAndProceedActionButton != null) {
     saveAndProceedActionButton.setEnabled(!dis);
   }
   saveAndProceedAction.redrawIcon();
 }