📄 runall.java
字号:
package net.aetherial.gis.our.allauto.create;
import net.aetherial.gis.our.allauto.frame.FrameWizard;
import net.aetherial.gis.our.allauto.chek.Xian;
import net.aetherial.gis.our.allauto.chek.Zhengli;
import net.aetherial.gis.our.allauto.chek.zhengli.XiangcunDao;
import net.aetherial.gis.our.FrameOur;
import net.aetherial.gis.surface.ItemValue;
import net.aetherial.gis.our.allauto.chek.zhengli.XianDao;
import net.aetherial.gis.our.allauto.chek.zhengli.GuoDao;
import net.aetherial.gis.our.allauto.chek.zhengli.ShengDao;
import net.aetherial.gis.our.allauto.chek.zhengli.ZhuanyongDao;
import net.aetherial.gis.our.auto.SubmitWord;
import net.aetherial.gis.table.WuWei;
import java.io.File;
import net.aetherial.gis.surface.CreateFile;
import net.aetherial.gis.our.allauto.create.xzc.XzcStatistic;
import net.aetherial.gis.our.allauto.chek.zhengli.XiangDao;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2004</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class RunAll
extends Thread {
/**
* 控制显示
*/
private FrameWizard fw = null;
/**
*
*/
private String[] fwPath = null;
/**
*
*/
private CreateDirect cd = null;
private FrameOur fo = null;
private printSatuts ps = null;
private ScanArray sa = null;
private boolean isCreatePickUp = false;
private boolean isCreateSHP = false;
private boolean isCreateExcel = false;
private boolean isCreateStatistic = false;
public RunAll(FrameWizard fw) {
this.fw = fw;
ps = new printSatuts(this.fw);
}
/**
* set fwPath
*/
public void setPath(String p1, String p2, String p3) {
this.fwPath = new String[3];
this.fwPath[0] = p1;
this.fwPath[1] = p2;
this.fwPath[2] = p3;
cd = new CreateDirect(p2);
}
public void setFrameOur(FrameOur fo) {
this.fo = fo;
}
/**
* popup message
*/
public void msg(String message) {
this.fw.msg(message);
}
private void getFunctionSelected() {
this.isCreatePickUp = this.fw.getIsCreatePickupFile();
this.isCreateSHP = this.fw.getIsCreateSHP();
this.isCreateExcel = this.fw.getIsCreateExcel();
this.isCreateStatistic = this.fw.getIsCreateStastic();
}
/**
* 输出打印的信息
*/
private void println(String message) {
ItemValue.setRunAllMessage(message);
}
/**
*检查目录,
* 如果可以通过,返回true;
*/
private boolean checkPathCanRun() {
String checkinput = (CheckPath.checkInput(this.fwPath[0])).trim();
if (! (checkinput.equals(""))) {
this.msg(checkinput);
return false;
}
String checkouput = (CheckPath.checkOutput(this.fwPath[1])).trim();
if (! (checkouput.equals(""))) {
this.msg(checkouput);
return false;
}
String arrayPath = (CheckPath.checkArrayPath(this.fwPath[2])).trim();
if (! (arrayPath.equals(""))) {
this.msg(arrayPath);
return false;
}
else {
ItemValue.setArrayPath(this.fwPath[2]);
}
return true;
}
private String getExactParent(String zhengliPath) {
String parent = zhengliPath.substring(this.fwPath[0].trim().length(),
zhengliPath.trim().length());
parent = this.fwPath[1] + "程序处理\\" + parent;
return parent;
}
/**
* 让printSatuts程序继续运行
*/
private void setThreadRun() {
try {
Thread.currentThread().notifyAll();
}
catch (Exception ex) {
System.out.println(ex.getMessage());
}
}
/**
*
*/
private void analyse() {
this.getFunctionSelected();
if (! (this.isCreateExcel || this.isCreatePickUp || this.isCreateSHP ||
this.isCreateStatistic)) {
return;
}
Xian xian = new Xian(this.fwPath[0]);
//得到Zhengli对象
Zhengli[] zl = xian.getZhengli();
if (zl != null) {
if (zl.length > 1) {
String temp = "在目录" + this.fwPath[0] + "下有" + zl.length +
"个\"整理完毕\",分别是:\r\n";
for (int i = 0; i < zl.length; i++) {
if (i > 5) {
temp = temp + "................\r\n";
break;
}
else {
temp = temp + (i + 1) + "." + zl[i].getAbsolutePath() + "\r\n";
}
}
temp = temp + "继续运行吗?(如果继续运行,目录结构将按照原路径匹配,根目录为\"程序处理\".)";
ps.yield();
int i = this.fw.msgQuestion(temp,
"遇到" + zl.length + "个\"整理完毕\",请问是否继续运行?");
if (i == 2) {
this.setThreadRun();
return;
}
else {
this.setThreadRun();
}
}
for (int i = 0; i < zl.length; i++) {
if (zl.length > 1) {
this.cd.setParent(this.getExactParent(zl[i].getParentFile().
getAbsolutePath()));
this.sa = new ScanArray(zl[i].getParentFile().
getAbsolutePath());
ItemValue.setArrayPath(this.sa.getArrayPath());
}
if (this.isCreatePickUp) {
this.createToPick(zl[i]);
}
if (this.isCreateSHP) {
this.createToSHP(zl[i]);
}
if (this.isCreateExcel) {
this.createToExcel(zl[i]);
} //isCreateStatistic
if (this.isCreateStatistic) {
this.createToStatistic(zl[i]);
this.createToCheck(zl[i]);
}
}
}
//在整理中得到各子文件
//创建提取数据目录和各子目录
//按照创建目录,提取数据,
}
/**
* 提取文件
*/
private void createToPick(Zhengli zl) {
XiangcunDao xiangcun = null;
XianDao xiandao = null;
XiangDao xiangdao = null;
this.cd.create_TiQu_Dir();
xiangcun = zl.getXiangcun();
if (xiangcun != null) {
System.out.println(this.cd.getTiqu_xian_tulu());
xiangcun.setCreateDirect(this.cd);
xiangcun.setFrameOur(this.fo);
this.println("正在将" + xiangcun.getAbsolutePath() + "文件提取出来!");
xiangcun.createPickUpFile();
this.println("正在将" + xiangcun.getAbsolutePath() + "文件提取出来!");
}
xiangdao = zl.getXiang();
if (xiangdao != null) {
xiangdao.setCreateDirect(this.cd);
xiangdao.setFrameOur(this.fo);
this.println("正在将" + xiangdao.getAbsolutePath() + "文件提取出来!");
xiangdao.createPickUpFile();
this.println("正在将" + xiangdao.getAbsolutePath() + "文件提取出来!");
}
xiandao = zl.getXian();
if (xiandao != null) {
xiandao.setCreateDirect(this.cd);
xiandao.setFrameOur(this.fo);
this.println("正在将" + xiandao.getAbsolutePath() + "文件提取出来!");
xiandao.createPickUpFile();
this.println("正在将" + xiandao.getAbsolutePath() + "文件提取出来!");
}
}
/**
* 生成SHP文件
*/
private void createToSHP(Zhengli zl) {
GuoDao guodao = zl.getGuo();
ShengDao shengdao = zl.getSheng();
XianDao xiandao = zl.getXian();
XiangDao xiangdao = zl.getXiang();
XiangcunDao xiangcun = zl.getXiangcun();
ZhuanyongDao zhunayong = zl.getZhuanyong();
this.cd.create_SHP_Dir();
if (guodao != null) {
guodao.setCreateDirect(this.cd);
guodao.setFrameOur(this.fo);
guodao.createSHP();
}
if (shengdao != null) {
shengdao.setCreateDirect(this.cd);
shengdao.setFrameOur(this.fo);
shengdao.createSHP();
}
if (xiangdao != null) {
xiangdao.setCreateDirect(this.cd);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -