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

📄 frametojtbinterface.java

📁 基于Java的地图数据管理软件。使用MySQL数据库管理系统。
💻 JAVA
字号:
package net.aetherial.gis.jiaotongbu.outputJTB.txtOutput.view;

import java.awt.*;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import net.aetherial.gis.our.allauto.frame.PathSelect;
import net.aetherial.gis.our.FrameOur;
import net.aetherial.gis.jiaotongbu.outputJTB.txtOutput.view.scan.FindedItem;
import net.aetherial.gis.jiaotongbu.outputJTB.txtOutput.view.scan.ScanPath;
import java.io.File;
import net.aetherial.gis.jiaotongbu.outputJTB.txtOutput.view.scan.Table;
import net.aetherial.gis.jiaotongbu.outputJTB.txtOutput.work.Work;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class FrameToJTBInterface
    extends JFrame {
  public final static String title = "生成交通部报表接口";
  private BorderLayout borderLayout1 = new BorderLayout();
  private JPanel jPanel2 = new JPanel();
  private JButton jButton = new JButton();
  private JSplitPane jSplitPane1 = new JSplitPane();
  private JPanel jPanelPathAll = new JPanel();
  private JTBItemSelect jPanelItem = new JTBItemSelect();
  private BorderLayout borderLayout2 = new BorderLayout();
  private JSplitPane jSplitPane2 = new JSplitPane();
  private JTBPathSelect jSelectPath = new JTBPathSelect(this);
  private FindedItem jTable = new FindedItem();
  private ScanPath scan = new ScanPath();
  private FrameOur fo = null;
  /**
   * array
   * 整理完毕
   * 补报表格
   * 输出路径
   *
   */
  public FrameToJTBInterface(FrameOur fo) {
    try {
      jbInit();
    }
    catch (Exception exception) {
      exception.printStackTrace();
    }
    this.fo = fo;
  }

public String getShi(){
  return jSelectPath.getShi();
}
public String getXian(){
  return jSelectPath.getXian();
}
  public void show(){
      Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
      this.setTitle(this.title);
      this.setSize(510, 637);
      this.setLocation(
          (screenDim.width - 510) / 2,
          (screenDim.height - 637) / 2
          );
      this.jSplitPane1.setDividerLocation(400);
      this.jSplitPane2.setDividerLocation(215);
      super.show();
      this.jSelectPath.setDefaultPath();
  }

  public ScanPath getScanPath(){
    return this.scan;
  }

  public Table getTable(){
    return this.jTable.getTableInstance();
  }

  public boolean[] getFunctionSelected(){
    return this.jPanelItem.getSelectedItem();
  }

  public void repaintTable(){
    this.setSacnPathPaths();
    this.jTable.removeAllElemnt();
    /**
     * 添加out
     */
    jTable.addRowData(scan.getPathOutObject());
    /**
     * 添加补报
     */
     Object[][] ob = scan.getPathsBaobiaosObject();
     for (int i = ob.length-1; i >= 0; i--) {
       jTable.addRowData(ob[i]);
     }
     /**
      * 添加完毕
      */
     jTable.addRowData(scan.getPathWanbiObject());
     /**
      * 添加array
      */
     jTable.addRowData(scan.getPathArrayObject());
  }

  /**
   * 将选择的路径传入ScanPath scan对象处理
   */
  private void setSacnPathPaths(){
    String[] paths = this.jSelectPath.getPath();
    if (paths != null) {
      scan.setPathArray(paths[0]);
      scan.setPathWanbi(paths[1]);
      scan.setPathBubao(paths[2]);
      scan.setPathOut(paths[3]);
    }
  }

  private void jbInit() throws Exception {
    getContentPane().setLayout(borderLayout1);
    jButton.addActionListener(new FrameToJTB_jButton_actionAdapter(this));
    jButton.setText("运行");
    jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT);
    jPanelPathAll.setLayout(borderLayout2);
    jSplitPane2.setOrientation(JSplitPane.VERTICAL_SPLIT);
    jSplitPane2.setDividerSize(2);
    this.getContentPane().add(jPanel2, java.awt.BorderLayout.SOUTH);
    jPanel2.add(jButton);
    this.getContentPane().add(jSplitPane1, java.awt.BorderLayout.CENTER);
    jSplitPane1.add(jPanelPathAll, JSplitPane.LEFT);
    jSplitPane1.add(jPanelItem, JSplitPane.RIGHT);
    jSplitPane2.add(jSelectPath, JSplitPane.LEFT);
    jSplitPane2.add(jTable, JSplitPane.RIGHT);
    jPanelPathAll.add(jSplitPane2, java.awt.BorderLayout.CENTER);
  }

  public void jButton_actionPerformed(ActionEvent e) {

    Work work = new Work(this,this.scan);
    work.setFrameOur(this.fo);
    work.run();
  }
}

class FrameToJTB_jButton_actionAdapter
    implements ActionListener {
  private FrameToJTBInterface adaptee;
  FrameToJTB_jButton_actionAdapter(FrameToJTBInterface adaptee) {
    this.adaptee = adaptee;
  }

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

⌨️ 快捷键说明

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