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

📄 framecount.java

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

import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.XYLayout;
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.our.FrameOur;
import net.aetherial.gis.our.auto.count.count.CountNoCut;
import java.awt.event.MouseEvent;
import java.awt.event.MouseAdapter;
import net.aetherial.gis.surface.main.CopyCutPaste;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class FrameCount
    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 FrameCount(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 FrameCount_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) {
    FrameCount framecount = new FrameCount(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 FrameCount fc = null;
  private FrameOur fo = null;
  public RunCount(FrameCount fc, FrameOur fo) {
    this.fo = fo;
    this.fc = fc;
  }

  public void run() {
    this.fc.start();
    CountNoCut cnc = new CountNoCut(this.fo, this.fc);
    if (this.fo != null) {
      cnc.setInputDirectory(this.fc.getInput());
      cnc.countAllFile();
    }
    this.fc.end();
  }
}

class FrameCount_jButtonRun_actionAdapter
    implements ActionListener {
  private FrameCount adaptee;
  FrameCount_jButtonRun_actionAdapter(FrameCount adaptee) {
    this.adaptee = adaptee;
  }

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

⌨️ 快捷键说明

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