📄 constructframe.java
字号:
package net.aetherial.gis.surface.design;
import java.awt.*;
import javax.swing.*;
import net.aetherial.gis.surface.ItemValue;
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 ConstructFrame
extends JFrame {
BorderLayout borderLayout1 = new BorderLayout();
ConstructPlan conPlan = null;
Node trackNode = null;
public ConstructFrame(Node trackNode) {
this.trackNode = trackNode;
try {
jbInit();
}
catch (Exception exception) {
exception.printStackTrace();
}
}
private void init(){
this.setIconImage(ItemValue.getImage("HSDIlogo.gif"));
this.setTitle("上报计划录入窗口");
this.setSize(600, 293);
Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(
(screenDim.width - 600) / 2,
(screenDim.height - 293) / 2
);
this.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
}
private void jbInit() throws Exception {
this.init();
conPlan = new ConstructPlan(this);
getContentPane().setLayout(borderLayout1);
this.getContentPane().add(conPlan, java.awt.BorderLayout.CENTER);
this.initPlan();
}
public void initPlan(){
if (this.trackNode != null) {
this.setPlanvalue(getDataValue());
}else{
System.out.println("trackNode == null");
}
}
private String[] getDataValue(){
String[] tfv = new String[10];
tfv[0] = ItemValue.getTracks_jihua_licheng(this.trackNode);
tfv[1] = ItemValue.getTracks_jihua_touzi(this.trackNode);
tfv[2] = ItemValue.getTracks_jihua_kaigong(this.trackNode);
tfv[3] = ItemValue.getTracks_jihua_wangong(this.trackNode);
tfv[4] = ItemValue.getTracks_jihua_lumian(this.trackNode);
tfv[5] = ItemValue.getTracks_jihua_luji(this.trackNode);
tfv[6] = ItemValue.getTracks_jihua_leixing(this.trackNode);
tfv[7] = ItemValue.getTracks_jihua_beizhu(this.trackNode);
tfv[8] = ItemValue.getTracks_jihua_bianhao(this.trackNode);
tfv[9] = ItemValue.getTracks_jihua_juli(this.trackNode);
return tfv;
}
private void setPlanvalue(String[] tfv){
if (tfv[0].equals("")) {
conPlan.set_licheng(ItemValue.getTracksStringDistance(this.trackNode));
}else{
conPlan.set_licheng(tfv[0]);
}
if (tfv[1].equals("")) {
conPlan.set_touzi(ItemValue.getRound((conPlan.get_licheng() * ItemValue.getTouzi_bili()),3) +"");
}else{
conPlan.set_touzi(tfv[1]);
}
conPlan.set_kaishi(tfv[2]);
conPlan.set_jieshu(tfv[3]);
if (tfv[4].equals("")) {
conPlan.set_lumian(ItemValue.getTracksWidth(this.trackNode));
}else{
conPlan.set_lumian(tfv[4]);
}
if (tfv[5].equals("")) {
conPlan.set_luji(conPlan.get_lumian());
}else{
conPlan.set_luji(tfv[5]);
}
conPlan.set_leixing(tfv[6]);
conPlan.set_beizhu(tfv[7]);
conPlan.set_bianhao(tfv[8]);
conPlan.set_juli(tfv[9]);
}
public void savedValue(){
if (this.trackNode != null) {
ItemValue.setTracks_jihua(this.trackNode, "" + conPlan.get_licheng(),
"" + conPlan.get_touzi(),
"" + conPlan.get_kaishi(),
"" + conPlan.get_jieshu(),
"" + conPlan.get_lumian(),
"" + conPlan.get_luji(),
"" + conPlan.get_leixing(),
"" + conPlan.get_beizhu(),
"" + conPlan.get_bianhao(),
"" + conPlan.get_juli());
}
}
public void setTouzi(){
conPlan.set_touzi(ItemValue.getRound((conPlan.get_licheng() * ItemValue.getTouzi_bili()),3) +"");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -