Esempio n. 1
0
 /** Accept a change. */
 public void accept() {
   ProjectionRect bb = mapViewPanel.getMapArea();
   if ((bb == null) || (current == null)) {
     return;
   }
   current.setDefaultMapArea(new ProjectionRect(bb));
   lm.sendEvent(new java.beans.PropertyChangeEvent(this, PROPERTY_CHANGE, null, current));
 }
Esempio n. 2
0
    /** user has hit the "accept/save" button */
    private void accept() {
      ProjectionClass projClass = findProjectionClass(editProjection);
      if (null == projClass) {
        System.out.println(
            "Projection Manager accept: findProjectionClass failed" + editProjection);
        return;
      }
      setProjFromDialog(projClass, editProjection);
      ProjectionRect mapArea = mapEditPanel.getSelectedRegion();
      if (mapArea == null) {
        mapArea = mapEditPanel.getMapArea();
      }
      editProjection.setDefaultMapArea(mapArea);

      if (debug) {
        System.out.println("Projection Manager accept bb =" + editProjection.getDefaultMapArea());
      }
      ProjectionImpl newProj = (ProjectionImpl) editProjection.constructCopy(); // use a copy

      if (viewDialog != null) {
        //                if ( !viewDialog.checkSaveOK(startingName,
        //                                             newProj.getName())) {
        //                    return;
        //                }
      }

      if (ProjectionManager.this.contains(newProj.getName())) {
        projTable.replaceProjection(newProj);
      } else {
        projTable.addProjection(newProj);
      }

      // set new projection to working projection and exit this Dialog
      setWorkingProjection(newProj);
      NewProjectionDialog.this.setVisible(false);
    }