Package com.gi.desktop.maptool

Examples of com.gi.desktop.maptool.MapToolApp


    }
  }

  private void configureMap() {
    try {
      MapToolApp app = (MapToolApp) getParent();
      MapDesc mapDesc = app.getMapDesc();

      WkidItem wkidItem = (WkidItem) this.jComboBoxWkid.getSelectedItem();
      mapDesc.setWkid(wkidItem.getWkid());
      mapDesc.setName(this.jTextFieldName.getText());
      mapDesc.setAntiAlias(this.jCheckBoxAntiAlias.isSelected());
      Color bgColor = this.jColorChooserBgColor.getColor();
      mapDesc.setBackgroundColor(bgColor);

      double xmin = Double.parseDouble(jTextFieldXmin.getText()
          .equals("") ? "0" : jTextFieldXmin.getText());
      double xmax = Double.parseDouble(jTextFieldXmax.getText()
          .equals("") ? "0" : jTextFieldXmax.getText());
      double ymin = Double.parseDouble(jTextFieldYmin.getText()
          .equals("") ? "0" : jTextFieldYmin.getText());
      double ymax = Double.parseDouble(jTextFieldYmax.getText()
          .equals("") ? "0" : jTextFieldYmax.getText());
      Envelope initialExtent = new Envelope(xmin, xmax, ymin, ymax);
      mapDesc.setInitialExtent(initialExtent);

      mapDesc.getLayerInfos().clear();
      for (int i = 0, count = this.jListLayersModel.getSize(); i < count; i++) {
        LayerItem item = (LayerItem) this.jListLayersModel
            .getElementAt(i);
        LayerInfo layerInfo = item.getLayerInfo();
        mapDesc.getLayerInfos().add(layerInfo);
      }

      app.getMap().initByMapDesc(mapDesc, app.getMapDescFilePath());
      app.getMapPane().setBackground(bgColor);

      MapContext mapContext = app.getMap().getMapContext();
      if (mapContext != null) {
        app.setMapContext(mapContext);
        app.pack();
      }
    } catch (Exception ex) {
      JOptionPane.showMessageDialog(this, "Configure Map Error!");
    }
  }
View Full Code Here


      JOptionPane.showMessageDialog(this, "Configure Map Error!");
    }
  }

  public void loadMapDesc() {
    MapToolApp app = (MapToolApp) this.getParent();
   
    MapDesc mapDesc = app.getMapDesc();
    if (mapDesc != null) {
      this.jTextFieldName.setText(mapDesc.getName());
      this.jCheckBoxAntiAlias.setSelected(mapDesc.isAntiAlias());
      Envelope initialExtent = mapDesc.getInitialExtent();
      if (initialExtent != null) {
View Full Code Here

    }
  }

  private void loadCurrentExtent() {
    try {
      MapToolApp app = (MapToolApp) this.getParent();
      ReferencedEnvelope env = app.getMapContext().getAreaOfInterest();
      CoordinateReferenceSystem crs = env.getCoordinateReferenceSystem();
      String inSR = SpatialReferenceManager.crsToWkid(crs);

      WkidItem item = (WkidItem) this.jComboBoxWkid.getSelectedItem();
      Envelope extent = GeometryToolkit
View Full Code Here

        if (ds == null) {
          String filePath = jTextFieldFilePath.getText();
          String realPath = PathUtil.fakePathToReal(filePath);
          File file = new File(filePath);
          if (!file.exists()) {
            MapToolApp app = (MapToolApp) this.getParent();
            String mapDescFilePath = app.getMapDescFilePath();
            File mapDescFile = new File(mapDescFilePath);
            String dir = mapDescFile.getParentFile()
                .getAbsolutePath();
            String path = dir + File.separator + realPath;
            file = new File(path);
View Full Code Here

    if (tabName.equals(jPanelFile.getName())) {
      String filePath = jTextFieldFilePath.getText();
      String realPath = PathUtil.fakePathToReal(filePath);
      File file = new File(filePath);
      if (!file.exists()) {
        MapToolApp app = (MapToolApp) this.getParent();
        String mapDescFilePath = app.getMapDescFilePath();
        File mapDescFile = new File(mapDescFilePath);
        String dir = mapDescFile.getParentFile().getAbsolutePath();
        String path = dir + File.separator + realPath;
        file = new File(path);
      }
View Full Code Here

    int returnVal = jFileChooser.showOpenDialog(this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
      String filePath = jFileChooser.getSelectedFile().getAbsolutePath();
      String fakeFilePath = PathUtil.realPathToFake(filePath);

      MapToolApp app = (MapToolApp) this.getParent();
      String mapDescFilePath = app.getMapDescFilePath();
      File mapDescFile = new File(mapDescFilePath);
      String dir = mapDescFile.getParentFile().getAbsolutePath();
      String fakeDir = PathUtil.realPathToFake(dir);

      if (fakeFilePath.startsWith(fakeDir)) {
View Full Code Here

          return "All Supported Type (shp/gml/jpeg/png/gif/tiff)";
        }
      };
      jFileChooserOpenFile.setFileFilter(filter);

      MapToolApp app = (MapToolApp) mapConfDialog.getParent();
      File mapDir = new File(app.getMapDirPath());
      jFileChooserOpenFile.setSelectedFile(mapDir);
    }
    return jFileChooserOpenFile;
  }
View Full Code Here

    int returnVal = jFileChooser.showOpenDialog(this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
      String filePath = jFileChooser.getSelectedFile().getAbsolutePath();
      String fakeFilePath = PathUtil.realPathToFake(filePath);

      MapToolApp app = (MapToolApp) this.getParent();
      String mapDescFilePath = app.getMapDescFilePath();
      File mapDescFile = new File(mapDescFilePath);
      String dir = mapDescFile.getParentFile().getAbsolutePath();
      String fakeDir = PathUtil.realPathToFake(dir);

      if (fakeFilePath.startsWith(fakeDir)) {
View Full Code Here

          return "Styled Layer Descriptor (sld)";
        }
      };
      jFileChooserOpenStyleFile.setFileFilter(filter);

      MapToolApp app = (MapToolApp) mapConfDialog.getParent();
      File mapDir = new File(app.getMapDirPath());
      jFileChooserOpenStyleFile.setSelectedFile(mapDir);
    }
    return jFileChooserOpenStyleFile;
  }
View Full Code Here

TOP

Related Classes of com.gi.desktop.maptool.MapToolApp

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.