Esempio n. 1
0
  /**
   * Store this Projection in the data table
   *
   * @param proj the Projection to store
   */
  public void saveProjection(ProjectionImpl proj) {
    // setVisible(true);  how to make this work? seperate Thread ?

    // force new name
    ProjectionImpl newProj = (ProjectionImpl) proj.constructCopy();
    newProj.setName("");
    setWorkingProjection(newProj);

    // start up edit Dialog
    getEditor().setProjection(current);
    getEditor().setVisible(true);
  }
Esempio n. 2
0
  /**
   * Set the working projection.
   *
   * @param proj projection to use
   */
  private void setWorkingProjection(ProjectionImpl proj) {
    if (proj == null) {
      return;
    }
    if (debug) {
      System.out.println("ProjManager.setWorkingProjection " + proj);
    }
    current = (ProjectionImpl) proj.constructCopy();
    if (debug) {
      System.out.println(
          "ProjManager.setWorkingProjection map area = " + current.getDefaultMapArea());
    }

    if (current != null) {
      mapLabel.setText(current.getName());
    }
    npViewControl.setProjectionImpl(current);
  }
Esempio n. 3
0
    /**
     * Set the projection class for a projection
     *
     * @param pc ProjectionClass
     * @param proj projection to set
     */
    private void setProjectionClass(ProjectionClass pc, ProjectionImpl proj) {
      if ((null == proj) || (null == pc)) {
        return;
      }

      if (debug) {
        System.out.println("Projection setProjectionClass= " + proj);
      }

      setFieldsWithClassParams(pc);
      editProjection = (ProjectionImpl) proj.constructCopy();
      putProjInDialog(pc, editProjection);

      if (debug) {
        System.out.println("Projection setProjectionClass ok ");
      }

      invalidate(); // force new layout
      validate();
    }
Esempio n. 4
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);
    }