📄 frameour.java
字号:
}
void setLocalName(String town,String city){
int[] pos = ItemValue.getPosition("track");
Node node = null;
for (int i = 0; i < pos.length; i++) {
node = ItemValue.getTracks(pos[i]);
ItemValue.setTracksT1(node,town);
ItemValue.setTracksT2(node,city);
}
}
boolean getRidOfActive() {
int[] pos = ItemValue.getPosition("track");
Node node = null;
for (int i = 0; i < pos.length; i++) {
node = ItemValue.getTracks(pos[i]);
if (ItemValue.getTracksName(node).equals("ACTIVE LOG")) {
System.out.println("发现ACTIVE LOG,清除该航迹");
ItemValue.deleteTracks(node);
return true;
}
}
return false;
}
void initToMap() {
}
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(new MetouiaLookAndFeel());
}
catch (Exception ex) {
}
FrameOur fo = new FrameOur();
fo.show();
}
public void memoryShow() {
// this.tree.memoryShow();
}
public void memoryShow(boolean trackExpand, boolean waypointExpand) {
this.tree.memoryShow(trackExpand, waypointExpand);
}
public void initPosition(Frame f) {
f.setSize(830, 600);
f.setIconImage(ItemValue.getImage("HSDIlogo.gif"));
f.setTitle(this.title);
Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
f.setLocation(
(screenDim.width - 830) / 2,
(screenDim.height - 600) / 2
);
}
private void openFile() {
ItemValue.encrypt = this.inputEncript;
// JFileChooser fileDialog = new JFileChooser();
// if (! (ItemValue.fileChoosePath.equals(""))) {
// fileDialog.setCurrentDirectory(new File(ItemValue.fileChoosePath));
// }
//
// //fileDialog.setCurrentDirectory(new File("D:\\GIS\\GPS测量数据"));
// int result = fileDialog.showOpenDialog(this);
// if (result == JFileChooser.APPROVE_OPTION) {
// File f = fileDialog.getSelectedFile();
// ItemValue.fileChoosePath = f.getAbsolutePath();
// //this.jTextField1.setText(f.getAbsolutePath());
// //new FileToElement(f);
// //this.insertText();
// this.setTitle("[" + f.getAbsolutePath() + "]" + this.title);
// ItemValue.fileName = f.getName();
// new FileToElement(f, this).start();
// //this.insertText();
// }
this.fm.protectOnlyReadFile();
}
public void openFile(File f) {
System.out.println("正在打开:" + f.getName());
new FileToElement(f, this).run();
}
public void saveFile(File f) {
System.out.println("正在保存:" + f.getName());
CreateFile cf = new CreateFile(f);
Document d1 = GarminGMLDoc.d;
Element root1 = GarminGMLDoc.root;
ItemValue.getRidOfTracksAndWaypointIDNew();
//cf.memoryToFile(GarminGMLDoc.printDoc());
if (ItemValue.encrypt == true) {
try {
cf.memoryToFile(Encryption.encryptFromString(GarminGMLDoc.printDoc(),
Encryption.key));
}
catch (Exception ex) {
}
}
else {
cf.memoryToFile(GarminGMLDoc.printDoc());
}
GarminGMLDoc.d = d1;
GarminGMLDoc.root = root1;
}
public void jButton_actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("打开数据")) { //open data
this.openFile();
}
else if (e.getActionCommand().equals("保存数据")) { //save the data
ItemValue.encrypt = this.outputEncript;
FrameMain.SaveFile(this);
}
else if (e.getActionCommand().equals("批处理")) { //save the data
this.batch = true;
FrameFunction ff = new FrameFunction(this);
ff.show();
}
else if (e.getActionCommand().equals("检查所有项目")) { //save the data
this.batch = true;
FrameAllCheck fac = new FrameAllCheck(this);
fac.show();
}
else if (e.getActionCommand().equals("所有功能集成在一起")) { //
this.batch = true;
FrameWizard fw = new FrameWizard(this);
fw.show();
}
else if (e.getActionCommand().equals("里程计算")) { //里程计算
this.batch = true;
FrameCount fw = new FrameCount(this);
fw.show();
}
else if (e.getActionCommand().equals("生成交通部上报表格")) { //里程计算
this.batch = true;
FrameToJTB fw = new FrameToJTB(this);
fw.show();
// TrackDecussate.main(null);
}
else if (e.getActionCommand().equals(FrameToJTBInterface.title)) { //里程计算
this.batch = true;
FrameToJTBInterface fi = new FrameToJTBInterface(this);
fi.show();
}
else if (e.getActionCommand().equals("与公路局数据比较")) { //里程计算
this.batch = true;
FrameDuibi fi = new FrameDuibi(this);
fi.show();
}
else if (e.getSource().equals(this.jButtonSearchSpecial)) { //save the data
SeachSpecial special = new SeachSpecial(this);
special.show();
}
}
public void reset() {
GarminGMLDoc.d = null;
GarminGMLDoc.root = null;
GarminGMLDoc.id = null;
GarminGMLDoc.id = new Vector();
ConsoleFrame.resetAll();
this.tree.clear();
//ItemValue.data = 0;
ItemValue.deadThread = false;
ItemValue.oldWaypointTopPos = 0;
ItemValue.RecieveCount = 0;
ItemValue.SendCount = 0;
ItemValue.hasTrack = false;
ItemValue.tracksNum = 0;
ItemValue.waypointPre = false;
ItemValue.hasWaypoint = false;
ItemValue.waypointNum = 0;
ItemValue.luDuanBianMa.clear();
ItemValue.namedTracks.clear();
ItemValue.numberedTracks.clear();
ItemValue.hanDongShuLiang.clear();
ItemValue.luDuanTracks.clear();
ItemValue.hanDongTracks.clear();
ItemValue.jzcZuoBiao.clear();
ItemValue.sameBE.clear();
ItemValue.nianBao = false;
ItemValue.baoBu = false;
}
public void jMenuItem_actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("打开文件")) { //open data
this.openFile();
}
else if (e.getActionCommand().equals("jMenuItem5")) { //save the data
System.exit(0);
}
else if (e.getActionCommand().equals("重新开始")) { //save the data
this.fm.reset();
// this.reset();
// this.setTitle(this.title);
}
else if (e.getActionCommand().equals("经纬通格式")) { //save the data
ToFile tf = new ToFile();
tf.saveWptTrk(this);
}
else if (e.getActionCommand().equals("经纬通导入")) { //save the data
Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
FrameToXml frameToXml = new FrameToXml();
frameToXml.setSize(600, 500);
frameToXml.setLocation(
(screenDim.width - 600) / 2,
(screenDim.height - 500) / 2
);
frameToXml.show();
}
else if (e.getActionCommand().equals("航点显示优化")) { //save the data
WipeWaypoint ww = new WipeWaypoint();
ww.run();
}
else if (e.getActionCommand().equals("切割航迹")) { //save the data
DialogCutTrack dct = new DialogCutTrack(this);
dct.show();
}
else if (e.getActionCommand().equals("合并航迹")) { //save the data
DialogUniteTrack dut = new DialogUniteTrack(this);
dut.show();
}
else if (e.getActionCommand().equals("jMenuItemInputEncript")) { //save the data
this.inputEncript = !this.inputEncript;
this.setEncriptButton();
}
else if (e.getActionCommand().equals("jMenuItemOutputEncript")) { //save the data
this.outputEncript = !this.outputEncript;
this.setEncriptButton();
}
}
public void jMenuItem15_actionPerformed(ActionEvent e) {
ToShape tf = new ToShape();
tf.save(this);
}
public void jButton_Search_actionPerformed(ActionEvent e) {
Search search = new Search(this);
// search.pack();
search.show();
}
}
class FrameOur_jButton_Search_actionAdapter
implements ActionListener {
private FrameOur adaptee;
FrameOur_jButton_Search_actionAdapter(FrameOur adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton_Search_actionPerformed(e);
}
}
class FrameOur_jMenuItem_actionAdapter
implements ActionListener {
private FrameOur adaptee;
FrameOur_jMenuItem_actionAdapter(FrameOur adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem_actionPerformed(e);
}
}
class FrameOur_jMenuItem15_actionAdapter
implements ActionListener {
private FrameOur adaptee;
FrameOur_jMenuItem15_actionAdapter(FrameOur adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jMenuItem15_actionPerformed(e);
}
}
class FrameOur_jButton_actionAdapter
implements ActionListener {
private FrameOur adaptee;
FrameOur_jButton_actionAdapter(FrameOur adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -