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

📄 framecountrytransfer.java

📁 基于Java的地图数据管理软件。使用MySQL数据库管理系统。
💻 JAVA
字号:
/*
 * 创建日期 2006-9-5
 * 作    者  朱 闰
 * TODO 要更改此生成的文件的模板,请转至
 * 窗口 - 首选项 - Java - 代码样式 - 代码模板
 */

package net.aetherial.gis.baobu.countrytransfer.Frame;
import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import net.aetherial.gis.surface.ItemValue;
import net.aetherial.gis.baobu.countrytransfer.CountryTransfer;
import net.aetherial.gis.our.FrameOur;
import net.aetherial.gis.our.auto.count.count.CountNoCut;
import net.aetherial.gis.our.auto.count.frame.JInput;

import java.awt.event.MouseEvent;
import java.awt.event.MouseAdapter;
import net.aetherial.gis.surface.main.CopyCutPaste;
public class FrameCountryTransfer  extends JFrame {

	  BorderLayout borderLayout1 = new BorderLayout();
	  JSplitPane jSplitPane1 = new JSplitPane();
	  JInput panel = new JInput();
	  JScrollPane jScrollPane1 = new JScrollPane();
	  JTextArea jTextPane1 = new JTextArea();
	  BoxLayout2 boxLayout21 = new BoxLayout2();
	  JPanel jPanel1 = new JPanel();
	  JButton jButtonRun = new JButton();
	  private String n = "";
	  private long count = 1;
	  private FrameOur fo = null;
	  public FrameCountryTransfer(FrameOur fo) {
	    try {
	      jbInit();
	      this.fo = fo;
	    }
	    catch (Exception ex) {
	      ex.printStackTrace();
	    }
	  }

	  private void jbInit() throws Exception {
	    getContentPane().setLayout(borderLayout1);
	    jTextPane1.setText("");
	    jTextPane1.addMouseListener(new CopyCutPaste(jTextPane1));
	    jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT);
	    panel.setLayout(boxLayout21);
	    jButtonRun.setText("运行");
	    jButtonRun.addActionListener(new FrameCountryTransfer_jButtonRun_actionAdapter(this));
	    this.getContentPane().add(jSplitPane1, java.awt.BorderLayout.CENTER);
	    jSplitPane1.add(panel, JSplitPane.LEFT);
	    jSplitPane1.add(jScrollPane1, JSplitPane.RIGHT);
	    jScrollPane1.getViewport().add(jTextPane1);
	    this.getContentPane().add(jPanel1, java.awt.BorderLayout.SOUTH);
	    jPanel1.add(jButtonRun);
	    this.init();
	  }

	  public static void main(String[] args) {
		  FrameCountryTransfer framecount = new FrameCountryTransfer(null);
	    framecount.show();
	  }
	  public void println(String message){
	    this.n = n +"[ Line" + (count++) + " ] : " +message + "\r\n";
	    this.jTextPane1.setText(this.n);
	  }
	  public String getInput(){
	    return this.panel.getInput();
	  }
	  public void jButtonRun_actionPerformed(ActionEvent e) {
	    RunCount rc = new RunCount(this,this.fo);
	    rc.start();
	  }
	  private void init(){
	    Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
	    this.setTitle("计算水泥\\油路\\砂石\\土路里程");
	    this.setSize(500, 600);
	    this.setLocation(
	        (screenDim.width - 500) / 2,
	        (screenDim.height - 600) / 2
	        );

	    this.setIconImage(ItemValue.getImage("HSDIlogo.gif"));
	  }
	  /**
	   * 运行开始,要屏蔽掉许多东西
	   */
	  protected void start(){
	   this.jButtonRun.setEnabled(false);
	   if (this.fo != null) {
	     this.fo.hide();
	   }

	   this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
	  }
	  /**
	   * 运行结束的时候,要把开始时屏蔽的东西,重新开放
	   */
	  protected void end(){
	    this.jButtonRun.setEnabled(true);
	    if (this.fo != null) {
	      this.fo.show();
	    }
	    this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
	    this.toFront();
	    this.println("程序运行结束!####################################");
	    this.n = "";
	    this.count = 1;
	  }
	}
	/**
	 * 线程计算,这样用来显示运行状态
	 */
	class RunCount
	    extends Thread {
	  private FrameCountryTransfer fc = null;
	  private FrameOur fo = null;
	  public RunCount(FrameCountryTransfer fc, FrameOur fo) {
	    this.fo = fo;
	    this.fc = fc;
	  }

	  public void run() {
	    this.fc.start();
	    CountryTransfer ct=new CountryTransfer();
		 // ct.RemoveTrackAndPoint("D:\\测试用数据\\怀宁县");
	    ct.CountryTransfer("D:\\测试用数据\\祁门县");
	    this.fc.end();
	  }
	}

	class FrameCountryTransfer_jButtonRun_actionAdapter
	    implements ActionListener {
	  private FrameCountryTransfer adaptee;
	  FrameCountryTransfer_jButtonRun_actionAdapter(FrameCountryTransfer adaptee) {
	    this.adaptee = adaptee;
	  }

	  public void actionPerformed(ActionEvent e) {
	    adaptee.jButtonRun_actionPerformed(e);
	  }
	}

⌨️ 快捷键说明

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