⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 findmultitrk.java

📁 基于Java的地图数据管理软件。使用MySQL数据库管理系统。
💻 JAVA
字号:
package net.aetherial.gis.output.toLd.repeate;

import net.aetherial.gis.surface.ItemValue;
import net.aetherial.gis.output.toLd.*;
import java.io.File;
import org.w3c.dom.Node;
import net.aetherial.gis.our.FrameOur;
import java.util.Vector;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class FindMultiTrk {
  private OpenDirectory od = new OpenDirectory();
  private FrameOur fo = null;
  public FindMultiTrk() {
  }

  /**
   * 是否拥有多条航迹
   */
  private boolean isMultiTrack(File f) {
    if (this.fo == null) {
      this.fo = new FrameOur();
    }
    ItemValue.setShowDialogMessage(false);
    this.fo.openFile(f);
    Node[] tracks = ItemValue.getTracks();
    if (tracks == null) {
      return false;
    }
    int trklength = tracks.length;
    this.fo.reset();
    if (trklength >= 2) {
      return true;
    }
    else {
      return false;
    }
  }

  public File[] getMultiTrackFile(String inputPath) {
    File[] allFiles = od.getOpenFile(inputPath);
    if (allFiles == null) {
      System.out.println("allFiles is null!");
    }
    Vector ve = new Vector();
    if (allFiles == null) {
      return null;
    }
    for (int i = 0; i < allFiles.length; i++) {
      if (this.isMultiTrack(allFiles[i])) {
        ve.add(allFiles[i]);
      }
    }
    File[] fs = new File[ve.size()];
    for (int i = 0; i < fs.length; i++) {
      fs[i] = (File) ve.get(i);
    }
    return fs;
  }

  public File[] getGradeMore_NumberLess_File(File f) {
    return od.get_GradeMore_NumberLess_File(f);
  }

  public File[] getAllExceptThis(File f) {
    od.setGradeStr("国道|省道|县道|乡道|村道");

    File[] gpsFiles = od.getOpenFile(f.getParentFile().getParentFile().
                                     getParentFile().getAbsolutePath());
    Vector alls = new Vector();
    for (int i = 0; gpsFiles != null && i < gpsFiles.length; i++) {
      if (gpsFiles[i] != f) {
        alls.add(gpsFiles[i]);
      }
    }
    gpsFiles = new File[alls.size()];
    alls.copyInto(gpsFiles);
    return gpsFiles;
  }

  private String checkAllFile_isMultiTrack(String inputPath) {
    File[] allFiles = od.getOpenFile(inputPath);
    File[] hisFiles = null;
    String n = "有多条航迹的文件是\r\n";
    for (int i = 0; i < allFiles.length; i++) {
      if (this.isMultiTrack(allFiles[i])) {
        n = n + allFiles[i].getName() + " : " + allFiles[i].getParent() +
            "\r\n";
        hisFiles = od.get_GradeMore_NumberLess_File(allFiles[i]);
        if (hisFiles != null) {
          for (int j = 0; j < hisFiles.length; j++) {
            n = n + "\t" + hisFiles[j] + "\r\n";
          }
        }

      }
    }
    return n;
  }

  public void setFo(FrameOur fo) {
    this.fo = fo;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -