📄 search.java
字号:
}
}
private Node[] getNewTracks(Node[] refTracks) {
Node[] trks = ItemValue.getTracks();
Vector newTrks = new Vector();
boolean find = false;
for (int i = 0; trks != null && i < trks.length; i++) {
find = false;
for (int j = 0; refTracks != null && j < refTracks.length; j++) {
if (trks[i] == refTracks[j]) {
find = true;
}
}
if (!find) {
newTrks.add(trks[i]);
}
}
Node[] temp = new Node[newTrks.size()];
newTrks.copyInto(temp);
return temp;
}
private void refreshShuxing(File gpsFile, Node[] trks) {
if (isCundaoTrk(gpsFile)) {
for (int i = 0; trks != null && i < trks.length; i++) {
ItemValue.setTracksGrade(trks[i], TrackType.Grade_CUN);
}
}
String gpsPath = gpsFile.getAbsolutePath();
File zhengliwanbi = new File(gpsPath.substring(0, gpsPath.indexOf("整理完毕")));
String xian = zhengliwanbi.getName();
String shi = zhengliwanbi.getParentFile().getName();
for (int i = 0; trks != null && i < trks.length; i++) {
ItemValue.setTracksT1(trks[i], shi);
ItemValue.setTracksT2(trks[i], xian);
}
}
private boolean isCundaoTrk(File currentFile) {
if (currentFile == null) {
return false;
}
String parentFileName = currentFile.getParentFile().getName();
if (parentFileName.indexOf("村") != -1 ||
parentFileName.indexOf("非年报") != -1) {
return true;
}
else {
return false;
}
}
private String getXianName(File f) {
if (f == null) {
return "";
}
String prePath = f.getAbsolutePath();
File prexianFile = new File(prePath.substring(0, prePath.indexOf("整理完毕")));
return prexianFile.getName();
}
private String getShiName(File f) {
if (f == null) {
return "";
}
String prePath = f.getAbsolutePath();
File prexianFile = new File(prePath.substring(0, prePath.indexOf("整理完毕")));
return prexianFile.getParentFile().getName();
}
private boolean isXianChenged(File preFile, File currentFile) {
if (preFile == null || currentFile == null) {
return true;
}
String prePath = preFile.getAbsolutePath();
String currentPath = currentFile.getAbsolutePath();
File prexianFile = new File(prePath.substring(0, prePath.indexOf("整理完毕")));
File curxianFile = new File(currentPath.substring(0,
currentPath.indexOf("整理完毕")));
if (prexianFile.getName().equals(curxianFile.getName())) {
return false;
}
else {
return true;
}
}
private boolean isShiChenged(File preFile, File currentFile) {
if (preFile == null || currentFile == null) {
return true;
}
String prePath = preFile.getAbsolutePath();
String currentPath = currentFile.getAbsolutePath();
File prexianFile = new File(prePath.substring(0, prePath.indexOf("整理完毕")));
File curxianFile = new File(currentPath.substring(0,
currentPath.indexOf("整理完毕")));
if (prexianFile.getParentFile().getName().equals(curxianFile.getParentFile().
getName())) {
return false;
}
else {
return true;
}
}
// private boolean checkWP(Node track, String typeStr) {
//// boolean result = false;
//// System.out.println("KP: "+ typeStr);
// if (track != null && typeStr != null && typeStr.length() > 1) {
// Node[] wpts = ItemValue.getTracksWaypoint(track);
// Node[] wpt2 = ItemValue.getXingZCInWaypoint(wpts);
// for (int i = 0; wpts != null && i < wpts.length; i++) {
// String kp = ItemValue.getWaypointKP(wpts[i]);
//// System.out.println("result: "+ (typeStr.indexOf(kp) > -1));
// if (kp != null && kp.length() > 0 &&
// ( (typeStr.indexOf(kp) > -1) ||
// ("行政村".equals(kp) && wpt2 != null && wpt2.length > 0))) {
// return true;
// }
// }
// }
// return false;
// }
/**
* 是否包含该航点仅此一条航迹
*/
private boolean checkWP(Node track, String typeStr) {
if (track != null && typeStr != null && typeStr.length() > 1) {
Node[] wpts = ItemValue.getTracksWaypoint(track);
Node[] wpt2 = ItemValue.getXingZCInWaypoint(wpts);
Node[] wptTrack = null;
// ItemValue.getWaypointHisTrack(null);
for (int i = 0; wpts != null && i < wpts.length; i++) {
String kp = ItemValue.getWaypointKP(wpts[i]);
// System.out.println("result: "+ (typeStr.indexOf(kp) > -1));
if (kp != null && kp.length() > 0 &&
( (typeStr.indexOf(kp) > -1) ||
("行政村".equals(kp) && wpt2 != null && wpt2.length > 0))) {
// System.out.println("typeStr.indexOf(\"唯一\") == " + typeStr.indexOf("唯一"));
if (typeStr.indexOf("唯一") != -1) {
wptTrack = WPTsTrack.getWptNearTrack(wpts[i]);
if (wptTrack.length == 1) {
return true;
}
}
else {
return true;
}
}
}
}
return false;
}
/**
* checkNotLinkLx
*
* @param track Node
* @param typeStr String
* @return boolean
*/
private boolean checkNotLinkLx(Node track, String linkStr, Across cross) {
if (linkStr.length() != 0 &&
linkStr.indexOf("T型路线") != -1) {
if (cross.isTrkInXOrT(track)) {
return true;
}
else {
return false;
}
}
if (linkStr.length() != 0 &&
linkStr.indexOf("断头路") != -1) {
if (cross.isTrkInDuantou(track)) {
return true;
}
else {
return false;
}
}
return false;
}
private boolean checkIsYixingLx(Node track, Across cross) {
if (cross.isTrkInXOrT(track)) {
return true;
}
else {
return false;
}
}
private boolean checkIsDuantouLx(Node track, Across cross) {
if (cross.isTrkInDuantou(track)) {
return true;
}
else {
return false;
}
}
private boolean check(String w1, String oper, String w2) {
boolean result = false;
System.out.print(w1 + " " + oper + " " + w2);
if(w1.length() == 0) w1 = "0";
if(w2.length() == 0) w2 = "0";
try {
float wf1 = Float.parseFloat(w1);
float wf2 = Float.parseFloat(w2);
if ("等于".equals(oper)) {
result = wf1 == wf2;
}
if ("大于".equals(oper)) {
result = wf1 > wf2;
}
if ("小于".equals(oper)) {
result = wf1 < wf2;
}
}
catch (NumberFormatException ex) {
result = false;
}
System.out.print(result + "\r\n");
return result;
}
private Vector findOutGPSFiles(String inputPath) {
Vector gpsFiles = new Vector();
String gradeDir = "";
File base = new File(inputPath);
File[] all = base.listFiles();
for (int i = 0; all != null && i < all.length; i++) {
if (all[i].isDirectory()) {
// System.out.println(all[i].getAbsolutePath());
gpsFiles.addAll(findOutGPSFiles(all[i].getAbsolutePath()));
}
}
File[] gps = base.listFiles(new java.io.FilenameFilter() {
public boolean accept(File file, String name) {
return
file != null &&
checkGradePath(file.getAbsolutePath(), gradeStr) &&
name.length() > 4 &&
".gps".equalsIgnoreCase(name.substring(name.length() - 4));
}
});
for (int i = 0; gps != null && i < gps.length; i++) {
gpsFiles.add(gps[i]);
}
return gpsFiles;
}
private boolean checkGradePath(String path, String gradeStr) {
boolean result = false;
if (gradeStr.length() == 0) {
result = path.indexOf("整理完毕") > -1;
}
else {
if (gradeStr.indexOf("国道") > -1) {
result |= path.indexOf("整理完毕\\国") > -1;
}
if (gradeStr.indexOf("省道") > -1) {
result |= path.indexOf("整理完毕\\省") > -1;
}
if (gradeStr.indexOf("县道") > -1) {
result |= path.indexOf("整理完毕\\县") > -1;
}
if (gradeStr.indexOf("乡道") > -1) {
result |= path.indexOf("整理完毕\\乡") > -1;
}
if (gradeStr.indexOf("村道") > -1) {
result |= path.indexOf("整理完毕\\村") > -1 || path.indexOf("整理完毕\\乡村") > -1;
}
if (gradeStr.indexOf("专用道路") > -1) {
result |= path.indexOf("整理完毕\\专") > -1;
}
}
return result;
}
public void jCheckBox1_actionPerformed(ActionEvent e) {
}
public void jCheckBox4_actionPerformed(ActionEvent e) {
}
public void jCheckBox_itemStateChanged(ItemEvent e) {
JCheckBox temp = (JCheckBox) e.getSource();
if (temp.equals(this.jCheckBox24)) {
if (temp.isSelected()) {
this.jCheckBox25.setSelected(false);
}
}
else if (temp.equals(this.jCheckBox25)) {
if (temp.isSelected()) {
this.jCheckBox24.setSelected(false);
}
}
else if (temp.equals(this.jCheckBox26)) {
if (temp.isSelected()) {
this.jCheckBox27.setSelected(false);
}
}
else if (temp.equals(this.jCheckBox27)) {
if (temp.isSelected()) {
this.jCheckBox26.setSelected(false);
}
}
if (temp.isSelected()) {
if (! (this.jCheckBox26.isSelected() || this.jCheckBox27.isSelected())) {
this.jCheckBox27.setSelected(true);
}
}
if ( (! (this.jCheckBox24.isSelected() || this.jCheckBox25.isSelected())) &&
(this.jCheckBox26.isSelected() || this.jCheckBox27.isSelected())) {
this.jCheckBox26.setSelected(false);
this.jCheckBox27.setSelected(false);
}
}
public void setCommandTrue() {
this.isCommand = true;
}
public void setYixinglu() {
this.isYixinglu = true;
}
}
class Search_jCheckBox_itemAdapter
implements ItemListener {
private Search adaptee;
Search_jCheckBox_itemAdapter(Search adaptee) {
this.adaptee = adaptee;
}
public void itemStateChanged(ItemEvent e) {
adaptee.jCheckBox_itemStateChanged(e);
}
}
class Search_jCheckBox4_actionAdapter
implements ActionListener {
private Search adaptee;
Search_jCheckBox4_actionAdapter(Search adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jCheckBox4_actionPerformed(e);
}
}
class Search_jCheckBox1_actionAdapter
implements ActionListener {
private Search adaptee;
Search_jCheckBox1_actionAdapter(Search adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jCheckBox1_actionPerformed(e);
}
}
class Search_jButton3_actionAdapter
implements ActionListener {
private Search adaptee;
Search_jButton3_actionAdapter(Search adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton3_actionPerformed(e);
}
}
class Search_jButton1_actionAdapter
implements ActionListener {
private Search adaptee;
Search_jButton1_actionAdapter(Search adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
class Search_jButton2_actionAdapter
implements ActionListener {
private Search adaptee;
Search_jButton2_actionAdapter(Search adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton2_actionPerformed(e);
}
}
class Search_jComboBox1_actionAdapter
implements ActionListener {
private Search adaptee;
Search_jComboBox1_actionAdapter(Search adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jComboBox1_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -