📄 framemain.java
字号:
jMenuItem7.addActionListener(new FrameMain_jMenuItem7_actionAdapter(
this));
jButton12.setText("刷新");
jButton12
.addActionListener(new FrameMain_jButton12_actionAdapter(this));
jMenuItem10.setText("刷新数据");
jMenuItem10.addActionListener(new FrameMain_jMenuItem10_actionAdapter(
this));
jPanel4.setDebugGraphicsOptions(0);
jSplitPane2.setOrientation(JSplitPane.VERTICAL_SPLIT);
jPanel4.setBackground(Color.white);
jPanel3.setLayout(borderLayout2);
jPanel3.setPreferredSize(new Dimension(81, 42));
jPanel3.setRequestFocusEnabled(true);
jPanel3.setToolTipText("");
jPanel3.setVerifyInputWhenFocusTarget(true);
jButton14.setText("删除此航迹");
jButton14
.addActionListener(new FrameMain_jButton14_actionAdapter(this));
jButtonWaypointDelete.setText("删除此航点");
jButtonWaypointDelete
.addActionListener(new FrameMain_jButtonWaypointDelete_actionAdapter(
this));
jButton13.setText("绘制航迹");
jButton13.addActionListener(new Drawing_actionAdapter(this));
jButton13.setActionCommand("Draw_Tracks");
jButtonDrawWaypoint.setText("绘制航点");
jButtonDrawWaypoint.addActionListener(new Drawing_actionAdapter(this));
jButtonDrawWaypoint.setActionCommand("Draw_Waypoint");
jButton19.setText(" 清 除 ");
jButton19.addActionListener(new Drawing_actionAdapter(this));
jButton19.setActionCommand("Clear");
jButton16.setText("插入航点");
jButton16
.addActionListener(new FrameMain_jButton16_actionAdapter(this));
jLabel20.setText("市");
jLabel21.setText("县");
jLabel22.setText("乡/镇");
jLabel23.setText("村");
jTextField4.setText("");
jTextField5.setText("");
jTextField13.setText("");
jLabel24.setText("技术等级:");
jLabel25.setText("始建日期:");
jLabel26.setText("完工日期:"); // jTextField16.setText("");
// jTextField17.setText("");
df1.setDate(null);
df2.setDate(null);
df3.setDate(null);
jButton17.setText("删除其他航迹");
jButton17
.addActionListener(new FrameMain_jButton17_actionAdapter(this));
jButton18.setText("切割与合并");
jButton18
.addActionListener(new FrameMain_jButton18_actionAdapter(this));
jMenuItem11.setText("端口设置");
jMenuItem11.addActionListener(new FrameMain_jMenuItem11_actionAdapter(
this));
jLabel27.setText("建设状况:");
jButtonWaypointDeleteAll.setText("批量删除航点");
jButtonWaypointDeleteAll
.addActionListener(new FrameMain_jButtonWaypointDeleteAll_actionAdapter(
this));
jComboBox2.addItemListener(new FrameMain_jComboBox2_itemAdapter(this));
jLabel28.setText("里 程:");
jLabel_licheng.setText("");
jComboBox5.addItemListener(new FrameMain_jComboBox5_itemAdapter(this));
jB_showXZC.setToolTipText("显示并选取行政村");
jB_showXZC.setText("选取行政村");
jB_showXZC.addActionListener(new FrameMain_jB_showXZC_actionAdapter(
this));
jLabel29.setText("养护质量:");
jLabel30.setText("最近改建:");
jTF_Luji.setText("");
jLabel31.setText("M");
jLabel32.setText("路基宽度:");
jMenuItem12.setText("另存为...");
jMenuItem12.addActionListener(new FrameMain_jMenuItem12_actionAdapter(
this));
jMenu5.setText("批量删除");
jMenuItem13.setText("删除航迹");
jMenuItem13.addActionListener(new FrameMain_jMenuItem13_actionAdapter(
this));
jMenuItem14.setText("删除航点");
jMenuItem14.addActionListener(new FrameMain_jMenuItem14_actionAdapter(
this));
jMenuBar1.add(jMenu1);
jMenuBar1.add(jMenu2);
jMenuBar1.add(jMenu5);
jMenuBar1.add(jMenu3);
jMenuBar1.add(jMenu4);
jMenu4.add(jMenuItem1);
jMenu4.addSeparator();
jMenu4.add(jMenuItem2);
jMenu1.add(jMenuItem7);
jMenu1.add(jMenuItem3);
jMenu1.add(jMenuItem4);
jMenu1.add(jMenuItem12);
jMenu1.addSeparator();
jMenu1.add(jMenuItem10);
jMenu1.addSeparator();
jMenu1.add(jMenuItem8);
jMenu2.add(jMenuItem5);
jMenu2.add(jMenuItem6);
jMenu2.addSeparator();
jMenu2.add(jMenuItem11);
this.getContentPane().add(jToolBar1, BorderLayout.NORTH);
jToolBar1.add(jButton6, null);
jToolBar1.add(jButton1, null);
jToolBar1.add(jButton2, null);
jToolBar1.add(jButton10, null);
jToolBar1.add(jButton11, null);
jToolBar1.add(jButton12, null);
jPanel1.add(jLabel6, new XYConstraints(370, 48, -1, -1));
jPanel1.add(jLabel7, new XYConstraints(370, 142, -1, 16));
jPanel1.add(jTextField1, new XYConstraints(100, 48, 165, -1));
jPanel1.add(jLabel1, new XYConstraints(35, 52, -1, -1)); // jPanel1.add(jTextField17,
// new
// XYConstraints(445,
// 261, 165,
// -1));
jPanel1.add(jLabel26, new XYConstraints(370, 262, 68, 16));
jPanel1.add(jLabel25, new XYConstraints(370, 233, 68, 16));
jPanel1.add(jTextField5, new XYConstraints(234, 11, 77, -1));
jPanel1.add(jTextField4, new XYConstraints(135, 11, 77, -1));
jPanel1.add(jLabel20, new XYConstraints(214, 9, 28, 26));
jPanel1.add(jLabel21, new XYConstraints(318, 14, 26, -1));
jPanel1.add(jTextField13, new XYConstraints(336, 11, 77, -1));
jPanel1.add(jLabel22, new XYConstraints(417, 14, 40, -1));
jPanel1.add(jTextField14, new XYConstraints(454, 11, 77, -1));
jPanel1.add(jLabel23, new XYConstraints(540, 14, -1, -1));
jPanel1.add(jScrollPane4, new XYConstraints(446, 142, 159, 83));
jPanel1.add(jScrollPane3, new XYConstraints(446, 49, 159, 86));
jScrollPane3.getViewport().add(jTextArea1);
jScrollPane4.getViewport().add(jTextArea2);
jTabbedPane1.add(jScrollPane1, "航迹");
jScrollPane1.getViewport().add(jPanel1, null);
jTabbedPane1.add(jScrollPane2, "航点");
// jTabbedPane1.add(jScrollPane3, "地图");
// jScrollPane3.getViewport().add(jPanel3, null);
jPanel3.add(jSplitPane2, BorderLayout.CENTER);
jSplitPane2.add(jPanel4, JSplitPane.BOTTOM);
jSplitPane2.add(jPanel5, JSplitPane.TOP);
jPanel5.add(jButton13, null);
jPanel5.add(jButtonDrawWaypoint, null);
jPanel5.add(jButton19, null);
jScrollPane2.getViewport().add(jPanel2, null);
this.getContentPane().add(jSplitPane1, BorderLayout.CENTER);
jSplitPane1.add(jTree1, JSplitPane.LEFT);
jSplitPane1.add(jTabbedPane1, JSplitPane.RIGHT);
jSplitPane1.setDividerLocation(130);
// jSplitPane2.setDividerLocation(500);
jPanel2.add(jTextField7, new XYConstraints(82, 23, 165, -1));
jPanel2.add(jTextField8, new XYConstraints(82, 61, 165, 22));
jPanel2.add(jLabel9, new XYConstraints(17, 27, -1, -1));
jPanel2.add(jLabel11, new XYConstraints(17, 183, 55, -1));
jPanel2.add(jLabel12, new XYConstraints(17, 146, 55, -1));
jPanel2.add(jTextField9, new XYConstraints(82, 99, 165, 22));
jPanel2.add(jTextField10, new XYConstraints(82, 137, 165, 22));
jPanel2.add(jTextField11, new XYConstraints(82, 175, 165, 22));
jPanel2.add(jComboBox3, new XYConstraints(340, 68, 92, -1));
jPanel2.add(jTextField6, new XYConstraints(451, 68, 49, -1));
jPanel2.add(jTextField12, new XYConstraints(547, 68, 49, -1));
jPanel2.add(jLabel14, new XYConstraints(507, 65, 53, 27));
jPanel2.add(jLabel15, new XYConstraints(612, 69, -1, -1));
jPanel2.add(jLabel16, new XYConstraints(303, 19, 360, 105));
jPanel2.add(jLabel18, new XYConstraints(306, 22, 130, 32));
jPanel2.add(jComboBox5, new XYConstraints(383, 160, 98, -1));
jPanel2.add(jLabel19, new XYConstraints(307, 149, 148, 38));
jPanel2.add(jLabel8, new XYConstraints(17, 104, 55, -1));
jPanel2.add(jLabel10, new XYConstraints(17, 62, 55, -1));
jMenu3.add(jMenuItem9);
jPanel2.add(jButton9, new XYConstraints(171, 315, -1, -1));
jPanel2.add(jButton7, new XYConstraints(69, 315, -1, -1));
jPanel2.add(jButton8, new XYConstraints(266, 315, -1, -1));
jPanel2.add(jButtonWaypointDelete, new XYConstraints(368, 315, -1, -1));
jPanel2.add(jButtonWaypointDeleteAll, new XYConstraints(486, 315, -1,
-1));
// jPanel2.add(cunpanel, new XYConstraints(27, 225, 634, 69));
jPanel2.add(jB_showXZC, new XYConstraints(490, 159, -1, -1));
jPanel2.add(jLabel17, new XYConstraints(303, 134, 360, 74));
jPanel1.add(jButton5, new XYConstraints(207, 409, 75, -1));
jPanel1.add(jButton4, new XYConstraints(45, 409, -1, -1));
jPanel1.add(jButton3, new XYConstraints(128, 409, 67, -1));
jPanel1.add(jButton16, new XYConstraints(298, 409, 94, -1));
jPanel1.add(jButton18, new XYConstraints(419, 409, 94, -1));
jPanel1.add(jButton14, new XYConstraints(142, 456, -1, -1));
jPanel1.add(jButton17, new XYConstraints(278, 456, -1, -1));
jPanel1.add(jLabel30, new XYConstraints(370, 305, -1, -1));
jPanel1.add(jLabel28, new XYConstraints(370, 342, 50, -1));
jPanel1.add(df1, new XYConstraints(438, 232, 181, -1));
jPanel1.add(df2, new XYConstraints(438, 264, 186, -1));
jPanel1.add(df3, new XYConstraints(438, 295, 181, -1));
jPanel1.add(jLabel_licheng, new XYConstraints(445, 340, 126, 20));
jPanel1.add(jTextField2, new XYConstraints(100, 86, 165, -1));
jPanel1.add(jComboBox1, new XYConstraints(100, 125, 165, -1));
jPanel1.add(jCB_Jishu, new XYConstraints(100, 163, 165, -1));
jPanel1.add(jComboBox2, new XYConstraints(100, 201, 165, -1));
jPanel1.add(jTextField3, new XYConstraints(100, 239, 145, -1));
jPanel1.add(jTF_Luji, new XYConstraints(100, 278, 142, -1));
jPanel1.add(jP_Yanghu, new XYConstraints(100, 316, 185, 30));
jPanel1.add(jLabel13, new XYConstraints(251, 237, 24, 24));
jPanel1.add(jLabel31, new XYConstraints(248, 281, 13, -1));
jPanel1.add(constructSelect, new XYConstraints(100, 362, 222, 25));
jPanel1.add(jLabel2, new XYConstraints(35, 91, 58, -1));
jPanel1.add(jLabel3, new XYConstraints(35, 129, 58, -1));
jPanel1.add(jLabel24, new XYConstraints(35, 168, 65, 21));
jPanel1.add(jLabel4, new XYConstraints(35, 212, -1, -1));
jPanel1.add(jLabel5, new XYConstraints(35, 250, -1, -1));
jPanel1.add(jLabel32, new XYConstraints(35, 289, -1, -1));
jPanel1.add(jLabel29, new XYConstraints(35, 327, 74, 20));
jPanel1.add(jLabel27, new XYConstraints(35, 370, -1, -1));
jMenu5.add(jMenuItem13);
jMenu5.add(jMenuItem14);
jMenuItem9.addActionListener(new FrameMain_jMenuItem9_actionAdapter(
this));
ItemValue.isTemp();
jComboBox1.addItem("");
jComboBox1.addItem("村道");
jComboBox1.addItem("乡道");
jComboBox1.addItem("县道");
jComboBox1.addItem("省道");
jComboBox1.addItem("国道");
jComboBox1.addItem("专用道路");
jComboBox2.addItem("");
jComboBox2.addItem("水泥");
jComboBox2.addItem("油路");
jComboBox2.addItem("砂石路");
jComboBox2.addItem("土路");
for (int i = 0; i < TrackType.RS_JTB.length; i++) {
jComboBox2.addItem(TrackType.RS_JTB[i]);
}
jComboBox3.addItem("");
jComboBox3.addItem("水泥→油路");
jComboBox3.addItem("水泥→砂石");
jComboBox3.addItem("水泥→土路");
jComboBox3.addItem("油路→砂石");
jComboBox3.addItem("油路→水泥");
jComboBox3.addItem("油路→土路");
jComboBox3.addItem("砂石→油路");
jComboBox3.addItem("砂石→水泥");
jComboBox3.addItem("砂石→土路");
jComboBox3.addItem("土路→水泥");
jComboBox3.addItem("土路→油路");
jComboBox3.addItem("土路→砂石");
jComboBox5.addItem("");
jComboBox5.addItem("桥梁");
jComboBox5.addItem("涵洞");
jComboBox5.addItem("道路交汇点");
jComboBox5.addItem("行政村");
jComboBox5.addItem("自然村");
jComboBox5.addItem("居民点");
jComboBox5.addItem("学校");
jComboBox5.addItem("乡镇府");
jComboBox5.addItem("政府机关");
jComboBox5.addItem("隧道");
jComboBox5.addItem("渡口");
// jComboBox5.addItem("渡口");
jComboBox5.addItem(WptType.W15_Xianjie);
jComboBox5.addItem(WptType.W16_Xiangjie);
jComboBox5.addItem("起点");
jComboBox5.addItem("终点");
jComboBox5.addItem(WptType.W13_zhuanghao);
jComboBox5.addItem("其他关键点");
jCB_Jishu.addItem("");
jCB_Jishu.addItem(TrackType.Jishu1_Gasu);
jCB_Jishu.addItem(TrackType.Jishu2_1ji);
jCB_Jishu.addItem(TrackType.Jishu3_2ji);
jCB_Jishu.addItem(TrackType.Jishu4_3ji);
jCB_Jishu.addItem(TrackType.Jishu5_4ji);
jCB_Jishu.addItem(TrackType.Jishu6_Dengwai);
this.jButton8.setFocusable(false);
this.jButton9.setFocusable(false);
this.jButton10.setFocusable(false);
initButton(false, "track");
initButton(false, "waypoint");
jTextField8.setEditable(false);
jTextField9.setEditable(false);
jTextField10.setEditable(false);
jTextField11.setEditable(false);
}
void initButton(boolean hasIt, String what) {
if (what.equals("track")) {
jButton3.setEnabled(hasIt);
jButton5.setEnabled(hasIt);
jButton13.setEnabled(hasIt);
this.jButton14.setEnabled(hasIt);
this.jButton16.setEnabled(hasIt);
this.jButton17.setEnabled(hasIt);
this.jButton18.setEnabled(hasIt);
this.jButton19.setEnabled(hasIt);
setJihuaButton();
if (hasIt == false) {
jButton4.setEnabled(hasIt);
}
}
if (what.equals("waypoint")) {
jButton8.setEnabled(hasIt);
jButton9.setEnabled(hasIt);
this.jButtonWaypointDelete.setEnabled(hasIt); //
this.jButtonWaypointDeleteAll.setEnabled(hasIt);
if (ItemValue.tracksNum > 0) {
jButtonDrawWaypoint.setEnabled(true);
} else {
jButtonDrawWaypoint.setEnabled(false);
}
if (hasIt == false) {
jButton7.setEnabled(hasIt);
}
}
this.setThisEnable();
// this.setJihuaButton();
}
/**
* 当作为计划软件为true时,设置以下项目
*/
public void setThisEnable() {
if (ItemValue.IS_JIHUA) {
/**
* 航迹部分
*/
jButton14.setEnabled(false);
jButton16.setEnabled(false);
jButton17.setEnabled(false);
jComboBox1.setEnabled(false);
jComboBox2.setEnabled(false);
jCB_Jishu.setEnabled(false);
jP_Yanghu.setEnabled(false);
jTextField3.setEnabled(false);
jTF_Luji.setEnabled(false);
/**
* 航点部分
*/
jComboBox3.setEnabled(false);
jComboBox5.setEnabled(false);
jB_showXZC.setEnabled(false);
jButtonWaypointDelete.setEnabled(false);
jButtonWaypointDeleteAll.setEnabled(false);
jTextField6.setEnabled(false);
jTextField7.setEnabled(false);
jTextField12.setEnabled(false);
}
}
private void setJihuaButton() {
String sel1 = "";
String sel2 = "";
try {
sel1 = this.jComboBox1.getSelectedItem() + "";
sel2 = this.jComboBox2.getSelectedItem() + "";
} catch (Exception ex) {
}
if ((sel2.equals(TrackType.RS_C_type))
|| (sel2.equals(TrackType.RS_D_bad))) {
if ((sel1.equals(TrackType.Grade_CUN))
|| (sel1.equals(TrackType.Grade_XIANG))
|| (sel1.equals(TrackType.Grade_XIAN))) {
this.constructSelect.setNixuanEnable(true);
return;
}
}
this.constructSelect.setNixuanEnable(false);
}
public static void main(String[] args) {
Image imageGPSIcon = null;
try {
UIManager.setLookAndFeel(new MetouiaLookAndFeel());
} catch (Exception ex) {
}
Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
FrameMain fm = new FrameMain();
fm.setIconImage(ItemValue.getImage("HSDIlogo.gif"));
fm.setTitle(ItemValue.SOFTWARE_NAME);
// fm.setExtendedState(Frame.MAXIMIZED_BOTH);
fm.setSize(830, 700);
fm.setLocation((screenDim.width - 830) / 2,
(screenDim.height - 700) / 2);
fm.show();
}
void jMenuItem8_actionPerformed(ActionEvent e) {
this.close_Frame(null);
}
private void openFile() {
JFileChooser fileDialog = new JFileChooser();
if (!(ItemValue.fileChoosePath.equals(""))) {
// String test =
// fileDialog.MULTI_SELECTION_ENABLED_CHANGED_PROPERTY;
fileDialog.setCurrentDirectory(new File(ItemValue.fileChoosePath));
// fileDialog.setAcceptAllFileFilterUsed(true);
}
fileDialog.setMultiSelectionEnabled(true);
// fileDialog.setCurrentDirectory(new File("D:\\GIS\\GPS测量数据"));
int result = fileDialog.showOpenDialog(this);
if (result == JFileChooser.APPROVE_OPTION) {
// fileDialog.getSelectedFiles();
File[] files = fileDialog.getSelectedFiles();
System.out.println("approveFiles.length:" + files.length);
for (int i = 0; i < files.length; i++) {
System.out.println(" File[" + i + "]:" + files[i].getName());
}
// File f = fileDialog.getSelectedFile();
// System.out.println("approveFile:" + f.getName());
ItemValue.fileChoosePath = files[0].getAbsolutePath();
String savedName = files[0].getName();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -