📄 constructplan.java
字号:
package net.aetherial.gis.surface.design;
import javax.swing.*;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import net.aetherial.gis.dataType.WptType;
import javax.swing.border.TitledBorder;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.*;
import javax.swing.border.Border;
/**
* <p>Title: </p>
*
* <p>Description: 这一组件,描述建设计划</p>
*
* <p>Copyright: Copyright (c) 2004</p>
*
* <p>Company: </p>
*
* @author wangaiguo
* @version 1.0
*/
public class ConstructPlan extends JPanel{
ConstructFrame cf = null;
public ConstructPlan(ConstructFrame cf) {
this.cf = cf;
try {
jbInit();
}
catch (Exception ex) {
ex.printStackTrace();
}
}
public void set_licheng(String data){
this.jT_licheng.setData(data);
}
public double get_licheng(){
return this.jT_licheng.getData();
}
public void set_touzi(String data){
this.jT_touzi.setData(data);
}
private void jbInit() throws Exception {
this.setLayout(xYLayout1);
jLabel1.setText("建设里程:");
jLabel2.setText("投资额:");
xYLayout1.setWidth(661);
xYLayout1.setHeight(300);
jB_set.setText("设置投资比例:");
jB_set.addActionListener(new ConstructPlan_jB_set_actionAdapter(this));
jB_set.setToolTipText("设置里程投资比例:");
jLabel3.setText("路面宽度:");
jLabel4.setText("路基宽度:");
jLabel5.setText("路面类型:");
jLabel6.setText("开工年:");
jLabel7.setText("完工年:");
jLabel8.setText("编号:");
jLabel9.setText("距离:");
jLabel10.setText("备注:");
this.jC_kaishi.addItem("");
this.jC_kaishi.addItem("2005");
this.jC_kaishi.addItem("2006");
this.jC_kaishi.addItem("2007");
this.jC_kaishi.addItem("2008");
this.jC_kaishi.addItem("2009");
this.jC_kaishi.addItem("2010");
this.jC_jieshu.addItem("");
this.jC_jieshu.addItem("2005");
this.jC_jieshu.addItem("2006");
this.jC_jieshu.addItem("2007");
this.jC_jieshu.addItem("2008");
this.jC_jieshu.addItem("2009");
this.jC_jieshu.addItem("2010");
this.jC_leixing.addItem("");
this.jC_leixing.addItem(WptType.RS_A_good);
this.jC_leixing.addItem(WptType.RS_B_good);
this.jC_leixing.addItem(WptType.RS_C_type);
jLabel11.setBorder(titledBorder1);
jLabel11.setToolTipText("建设计划");
jLabel11.setHorizontalAlignment(SwingConstants.CENTER);
jLabel11.setLabelFor(null);
jLabel11.setText("建设计划");
jLabel11.setVerticalAlignment(SwingConstants.TOP);
jLabel12.setBorder(titledBorder1);
jLabel12.setToolTipText("与干线距离");
jLabel12.setHorizontalAlignment(SwingConstants.CENTER);
jLabel12.setText("与干线距离");
jLabel12.setVerticalAlignment(SwingConstants.TOP);
jB_submit.setText("确定");
jB_submit.addActionListener(new ConstructPlan_jB_actionAdapter(this));
jB_cancel.setText("取消");
jB_cancel.addActionListener(new ConstructPlan_jB_actionAdapter(this));
jPanel1.setLayout(boxLayout21);
jT_beizhu.setText("");
this.add(jLabel1, new XYConstraints(23, 32, -1, -1));
this.add(jLabel6, new XYConstraints(23, 71, -1, -1));
this.add(jLabel3, new XYConstraints(23, 110, -1, -1));
this.add(jLabel5, new XYConstraints(23, 155, -1, -1));
this.add(jC_leixing, new XYConstraints(93, 155, 83, -1));
this.add(jT_lumian, new XYConstraints(93, 110, 83, -1));
this.add(jC_kaishi, new XYConstraints(93, 71, -1, -1));
this.add(jT_licheng, new XYConstraints(93, 32, 83, -1));
this.add(jT_touzi, new XYConstraints(253, 32, 83, -1));
this.add(jLabel2, new XYConstraints(197, 32, -1, -1));
this.add(jLabel7, new XYConstraints(197, 71, -1, -1));
this.add(jLabel4, new XYConstraints(197, 110, -1, -1));
this.add(jB_set, new XYConstraints(343, 32, 26, 22));
this.add(jLabel10, new XYConstraints(199, 152, -1, -1));
this.add(jT_bianhao, new XYConstraints(484, 32, 83, -1));
this.add(jLabel8, new XYConstraints(432, 32, -1, -1));
this.add(jLabel9, new XYConstraints(433, 71, -1, -1));
this.add(jT_juli, new XYConstraints(485, 71, 83, -1));
this.add(jB_submit, new XYConstraints(199, 228, -1, -1));
this.add(jB_cancel, new XYConstraints(304, 228, -1, -1));
this.add(jLabel12, new XYConstraints(422, 3, 157, 208));
this.add(jPanel1, new XYConstraints(254, 144, 118, 39));
jPanel1.add(jScrollPane1);
jScrollPane1.getViewport().add(jT_beizhu);
this.add(jC_jieshu, new XYConstraints(253, 71, -1, -1));
this.add(jT_luji, new XYConstraints(253, 110, 83, -1));
this.add(jLabel11, new XYConstraints(14, 4, 387, 208));
this.add(jLabel11, new XYConstraints(14, 4, 387, 208));
}
public double get_touzi() {
return jT_touzi.getData();
}
public double get_lumian() {
return jT_lumian.getData();
}
public double get_luji() {
return jT_luji.getData();
}
public double get_juli() {
return jT_juli.getData();
}
public String get_bianhao() {
return jT_bianhao.getText();
}
public String get_beizhu() {
return jT_beizhu.getText();
}
public String get_leixing() {
return jC_leixing.getSelectedItem()+"";
}
public String get_kaishi() {
return jC_kaishi.getSelectedItem()+"";
}
public String get_jieshu() {
return jC_jieshu.getSelectedItem()+"";
}
public void set_jieshu(String data) {
this.jC_jieshu.setSelectedItem(data);
}
public void set_lumian(double data) {
this.jT_lumian.setData(data);
}
public void set_lumian(String data) {
this.jT_lumian.setData(data);
}
public void set_luji(double data) {
this.jT_luji.setData(data);
}
public void set_luji(String data) {
this.jT_luji.setData(data);
}
public void set_juli(double data) {
this.jT_juli.setData(data);
}
public void set_juli(String data) {
this.jT_juli.setData(data);
}
public void set_bianhao(String data) {
this.jT_bianhao.setText(data);
}
public void set_beizhu(String data) {
jT_beizhu.setText(data);
}
public void set_leixing(String data) {
this.jC_leixing.setSelectedItem(data);
}
public void set_kaishi(String data) {
this.jC_kaishi.setSelectedItem(data);
}
XYLayout xYLayout1 = new XYLayout();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
NumberTextField jT_licheng = new NumberTextField();//里程
NumberTextField jT_touzi = new NumberTextField();//投资额
JButton jB_set = new JButton();//设置投资比例
JLabel jLabel3 = new JLabel();
NumberTextField jT_lumian = new NumberTextField();//路面宽度
NumberTextField jT_luji = new NumberTextField();//路基宽度
JLabel jLabel4 = new JLabel();
JComboBox jC_leixing = new JComboBox();//建设路面类型
JLabel jLabel5 = new JLabel();
JLabel jLabel6 = new JLabel();
JComboBox jC_kaishi = new JComboBox();//开工年
JComboBox jC_jieshu = new JComboBox();//完工年
JLabel jLabel7 = new JLabel();
JLabel jLabel8 = new JLabel();
JTextField jT_bianhao = new JTextField();//主干线编号
JLabel jLabel9 = new JLabel();
NumberTextField jT_juli = new NumberTextField();//与主干线距离
JLabel jLabel10 = new JLabel();
JLabel jLabel11 = new JLabel();
JLabel jLabel12 = new JLabel();
TitledBorder titledBorder1 = new TitledBorder("");
JButton jB_submit = new JButton();
JButton jB_cancel = new JButton();
JPanel jPanel1 = new JPanel();
BoxLayout2 boxLayout21 = new BoxLayout2();
JScrollPane jScrollPane1 = new JScrollPane();
JTextArea jT_beizhu = new JTextArea();
public void jB_actionPerformed(ActionEvent e) {
System.out.println("宽度:" + this.cf.getWidth() +",高度:" + this.cf.getHeight());
if (e.getSource().equals(this.jB_cancel)) {
cf.hide();
}else {
this.cf.savedValue();
cf.hide();
}
}
public void jB_set_actionPerformed(ActionEvent e) {
ConstructDialog cd = new ConstructDialog(this.cf);
cd.show();
}
}
class ConstructPlan_jB_set_actionAdapter
implements ActionListener {
private ConstructPlan adaptee;
ConstructPlan_jB_set_actionAdapter(ConstructPlan adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jB_set_actionPerformed(e);
}
}
class ConstructPlan_jB_actionAdapter
implements ActionListener {
private ConstructPlan adaptee;
ConstructPlan_jB_actionAdapter(ConstructPlan adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jB_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -