📄 suidaoframe.java
字号:
package net.aetherial.gis.surface.design.jiaotongbu;
import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import net.aetherial.gis.surface.design.NumberTextField;
import net.aetherial.gis.surface.ItemValue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import net.aetherial.gis.surface.FrameMain;
import org.w3c.dom.Node;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2004</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class SuidaoFrame
extends JFrame {
XYLayout xYLayout1 = new XYLayout();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JTextField jTF_name = new JTextField();
JLabel jLabel3 = new JLabel();
JTextField jTF_number = new JTextField();
JButton jB_Submit = new JButton();
JButton jB_Cancel = new JButton();
private FrameMain fm = null;
NumberTextField jTF_shijian = new NumberTextField();
NumberTextField jTF_zhuanghao = new NumberTextField();
NumberTextField jTF_changdu = new NumberTextField();
NumberTextField jTF_gaodu = new NumberTextField();
NumberTextField jTF_kuandu = new NumberTextField();
JLabel jLabel5 = new JLabel();
JLabel jLabel6 = new JLabel();
JLabel jLabel7 = new JLabel();
JLabel jLabel8 = new JLabel();
JLabel jLabel9 = new JLabel();
JLabel jLabel10 = new JLabel();
JTextArea jTA_beizhu = new JTextArea();
public SuidaoFrame(FrameMain fm) {
this.fm = fm;
try {
jbInit();
}
catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(xYLayout1);
jLabel1.setFont(new java.awt.Font("Dialog", Font.BOLD, 14));
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
jLabel1.setText("设置隧道属性");
jB_Submit.setText("确定");
jB_Submit.addActionListener(new SuidaoFrame_jB_actionAdapter(this));
jB_Cancel.setText("取消");
jB_Cancel.addActionListener(new SuidaoFrame_jB_actionAdapter(this));
xYLayout1.setWidth(423);
xYLayout1.setHeight(468);
jTF_shijian.setText("");
jTF_zhuanghao.setText("");
jTF_changdu.setText("");
jTF_gaodu.setText("");
jTF_kuandu.setText("");
jLabel5.setToolTipText("");
jLabel5.setText("建成时间(年份)");
jLabel6.setText("起点桩号");
jLabel7.setText("隧道长度(米)");
jLabel8.setText("隧道净高(米)");
jLabel9.setText("隧道全宽(米)");
jLabel10.setText(" 备注:");
jLabel3.setToolTipText("");
jLabel3.setText("隧道编号");
jLabel2.setText("隧道名称:");
this.getContentPane().add(jLabel2, new XYConstraints(51, 74, -1, -1));
this.getContentPane().add(jLabel1, new XYConstraints(102, 19, 116, 35));
this.getContentPane().add(jLabel3, new XYConstraints(51, 112, -1, -1));
this.getContentPane().add(jLabel5, new XYConstraints(51, 149, -1, -1));
this.getContentPane().add(jLabel6, new XYConstraints(51, 187, -1, -1));
this.getContentPane().add(jLabel7, new XYConstraints(51, 225, -1, -1));
this.getContentPane().add(jLabel8, new XYConstraints(51, 263, -1, -1));
this.getContentPane().add(jLabel9, new XYConstraints(51, 300, -1, -1));
this.getContentPane().add(jLabel10, new XYConstraints(51, 338, -1, -1));
this.getContentPane().add(jTA_beizhu, new XYConstraints(182, 339, 126, 51));
this.getContentPane().add(jB_Cancel, new XYConstraints(183, 413, -1, -1));
this.getContentPane().add(jB_Submit, new XYConstraints(84, 413, -1, -1));
this.getContentPane().add(jTF_kuandu, new XYConstraints(181, 298, 126, -1));
this.getContentPane().add(jTF_gaodu, new XYConstraints(181, 260, 126, -1));
this.getContentPane().add(jTF_changdu, new XYConstraints(181, 222, 126, -1));
this.getContentPane().add(jTF_zhuanghao,
new XYConstraints(181, 185, 126, -1));
this.getContentPane().add(jTF_shijian, new XYConstraints(181, 147, 126, -1));
this.getContentPane().add(jTF_number, new XYConstraints(181, 109, 126, -1));
this.getContentPane().add(jTF_name, new XYConstraints(181, 71, 126, -1));
this.init();
this.initValue();
}
private void init() {
this.setTitle("设置隧道属性");
this.setSize(390, 490);
this.setIconImage(ItemValue.getImage("HSDIlogo.gif"));
Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(
(screenDim.width - 390) / 2,
(screenDim.height - 490) / 2
);
this.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
}
public void initValue() {
// this.jTF_name.setText(this.fm.getWaypointName());
String[] value = this.fm.getJTB_Suidao();
// System.out.println(value.length);
if (value != null && value.length >= 8) {
this.jTF_name.setText(value[0]);
this.jTF_number.setText(value[1]);
this.jTF_shijian.setText(value[2]);
this.jTF_zhuanghao.setText(value[3]);
this.jTF_changdu.setText(value[4]);
this.jTF_gaodu.setText(value[5]);
this.jTF_kuandu.setText(value[6]);
this.jTA_beizhu.setText(value[7]);
}
else {
this.jTF_number.setText("");
this.jTF_shijian.setText("");
this.jTF_zhuanghao.setText("");
this.jTF_changdu.setText("");
this.jTF_gaodu.setText("");
this.jTF_kuandu.setText("");
this.jTA_beizhu.setText("");
}
}
public static void main(String[] args) {
SuidaoFrame suidaoframe = new SuidaoFrame(null);
}
public void jB_actionPerformed(ActionEvent e) {
if (e.getSource().equals(this.jB_Submit)) {
String[] array = new String[8];
array[0] = this.jTF_name.getText().trim();
array[1] = this.jTF_number.getText().trim();
array[2] = this.jTF_shijian.getText().trim();
array[3] = this.jTF_zhuanghao.getText().trim();
array[4] = this.jTF_changdu.getText().trim();
array[5] = this.jTF_gaodu.getText().trim();
array[6] = this.jTF_kuandu.getText().trim();
array[7] = this.jTA_beizhu.getText().trim();
this.fm.setWaypointName(array[0]);
this.fm.setJTB_Suidao(array);
}
this.hide();
// System.out.println("width:" + this.getWidth() + ",height:" + this.getHeight());
}
}
class SuidaoFrame_jB_actionAdapter
implements ActionListener {
private SuidaoFrame adaptee;
SuidaoFrame_jB_actionAdapter(SuidaoFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jB_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -