📄 requiredialog.java
字号:
package view;import java.awt.*;import javax.swing.*;import javax.swing.table.*;import com.borland.jbcl.layout.*;import java.awt.event.*;import brgeometry.*;import java.util.*;import helper.ProBag.*;import com.versant.fund.*;import com.versant.trans.*;import operation.*;import javax.swing.border.*;public class requireDialog extends JDialog { DefaultTableModel SolidDtm; //定义体(平面体.曲面体)表格的数据模型 DefaultTableModel cuboidDtm; //定义长方体表格的数据模型 DefaultTableModel squareDtm; //定义立方体表格的数据模型 DefaultTableModel cylinderDtm; //定义圆柱体表格的数据模型 DefaultTableModel coneDtm; //定义圆锥体表格的数据模型 DefaultTableModel SphereDtm; //定义球体表格的数据模型 DefaultTableModel faceDtm;//定义面的数据表格 DefaultTableModel edgeDtm;//定义边的数据表格 DefaultTableModel verticeDtm; //定义点的数据表格 Vector SolidVCdata =new Vector(); //定义表的列名(以vector存储) Vector cuboidVCdata =new Vector(); //定义表的列名(以vector存储) Vector squareVCdata =new Vector(); //定义表的列名(以vector存储) Vector cylinderVCdata =new Vector(); //定义表的列名(以vector存储) Vector coneVCdata =new Vector(); //定义表的列名(以vector存储) Vector sphereVCdata =new Vector(); //定义表的列名(以vector存储) Vector faceVCdata =new Vector(); //定义表的列名(以vector存储) Vector edgeVCdata =new Vector(); //定义表的列名(以vector存储) Vector verticeVCdata =new Vector(); //定义表的列名(以vector存储) VEnumeration result = null; //查询表的数据集合 private JPanel panel1 = new JPanel(); private XYLayout xYLayout1 = new XYLayout(); private JLabel jLabel1 = new JLabel(); private JTabbedPane jTabbedPane1 = new JTabbedPane(); private JPanel jPanel1 = new JPanel(); private JPanel jPanel2 = new JPanel(); private JPanel jPanel4 = new JPanel(); private JRadioButton jRadioButton1 = new JRadioButton(); private XYLayout xYLayout2 = new XYLayout(); private JRadioButton jRadioButton2 = new JRadioButton(); private JRadioButton jRadioButton3 = new JRadioButton(); private JRadioButton jRadioButton4 = new JRadioButton(); private ButtonGroup buttonGroup1 = new ButtonGroup(); private JComboBox jComboBox1 = new JComboBox(); private JLabel jLabel2 = new JLabel(); private JRadioButton jRadioButton5 = new JRadioButton(); private XYLayout xYLayout3 = new XYLayout(); private JRadioButton jRadioButton6 = new JRadioButton(); private JRadioButton jRadioButton9 = new JRadioButton(); private JRadioButton jRadioButton7 = new JRadioButton(); private JRadioButton jRadioButton8 = new JRadioButton(); private JTextField jTextField1 = new JTextField(); private JLabel jLabel3 = new JLabel(); private JButton jButton1 = new JButton(); private JButton jButton2 = new JButton(); private JButton jButton3 = new JButton(); private JButton jButton6 = new JButton(); private JButton jButton4 = new JButton(); private XYLayout xYLayout5 = new XYLayout(); private JLabel jLabel5 = new JLabel(); private JLabel jLabel6 = new JLabel(); private JLabel jLabel7 = new JLabel(); private JTextField jTextField3 = new JTextField(); private JLabel jLabel8 = new JLabel(); private JComboBox jComboBox2 = new JComboBox(); private JLabel jLabel4 = new JLabel(); private JLabel jLabel9 = new JLabel(); private JLabel jLabel10 = new JLabel(); private JRadioButton jRadioButton10 = new JRadioButton(); private JRadioButton jRadioButton11 = new JRadioButton(); private ButtonGroup buttonGroup2 = new ButtonGroup(); private ButtonGroup buttonGroup3 = new ButtonGroup(); private JPopupMenu jPopupMenu1 = new JPopupMenu(); private JButton jButton5 = new JButton(); private JButton jButton7 = new JButton(); private JButton jButton8 = new JButton(); private TitledBorder titledBorder1; private TitledBorder titledBorder2; private TitledBorder titledBorder3; private JScrollPane jScrollPane1 = new JScrollPane(); private JTable jTable1 = new JTable(); private JRadioButton jRadioButton12 = new JRadioButton(); private JRadioButton jRadioButton13 = new JRadioButton(); private JRadioButton jRadioButton14 = new JRadioButton(); private JPanel jPanel3 = new JPanel(); private JPanel jPanel5 = new JPanel(); //private jdbTable jTdbTable=new JdbTable(); public requireDialog(Frame frame, String title, boolean modal) { super(frame, title, modal); try { jbInit(); userInit(); //自定义的操作都在次方法中 pack(); } catch(Exception ex) { ex.printStackTrace(); } } public requireDialog() { this(null, "", false); } private void jbInit() throws Exception { titledBorder1 = new TitledBorder(""); titledBorder2 = new TitledBorder(""); titledBorder3 = new TitledBorder(""); panel1.setLayout(xYLayout1); panel1.setBackground(SystemColor.info); jLabel1.setFont(new java.awt.Font("Dialog", 0, 20)); jLabel1.setForeground(Color.red); jLabel1.setText("查询"); jTabbedPane1.setBackground(SystemColor.info); jTabbedPane1.setBorder(BorderFactory.createEtchedBorder()); jPanel4.setBackground(SystemColor.info); jPanel4.setBorder(BorderFactory.createLineBorder(Color.black)); jPanel4.setLayout(xYLayout5); jPanel2.setBackground(SystemColor.info); jPanel2.setBorder(BorderFactory.createLineBorder(Color.black)); jPanel2.setLayout(xYLayout3); jPanel1.setBackground(SystemColor.info); jPanel1.setBorder(BorderFactory.createLineBorder(Color.black)); jPanel1.setLayout(xYLayout2); jRadioButton1.setBackground(SystemColor.info); jRadioButton1.setSelected(true); jRadioButton1.setText("查询所有体"); jRadioButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jRadioButton1_actionPerformed(e); } }); jRadioButton2.setBackground(SystemColor.info); jRadioButton2.setText("查询所有平面体"); jRadioButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jRadioButton2_actionPerformed(e); } }); jRadioButton3.setBackground(SystemColor.info); jRadioButton3.setText("查询所有曲面体"); jRadioButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jRadioButton3_actionPerformed(e); } }); jRadioButton4.setBackground(SystemColor.info); jRadioButton4.setText("查询所有的具体的体"); jRadioButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jRadioButton4_actionPerformed(e); } }); jLabel2.setText("请输入所要查询的体的类型"); jRadioButton5.setBackground(SystemColor.info); jRadioButton5.setSelected(true); jRadioButton5.setText("按表面查询"); jRadioButton6.setBackground(SystemColor.info); jRadioButton6.setText("按体积查询"); jRadioButton9.setBackground(SystemColor.info); jRadioButton9.setText("大于"); jRadioButton7.setBackground(SystemColor.info); jRadioButton7.setSelected(true); jRadioButton7.setText("小于"); jRadioButton8.setBackground(SystemColor.info); jRadioButton8.setText("等于"); jLabel3.setText("指定条件"); jButton1.setBackground(SystemColor.inactiveCaptionText); jButton1.setBorder(BorderFactory.createLineBorder(Color.black)); jButton1.setText("确定"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); jButton2.setBackground(SystemColor.inactiveCaptionText); jButton2.setBorder(BorderFactory.createLineBorder(Color.black)); jButton2.setText("重置"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton2_actionPerformed(e); } }); jButton3.setBackground(SystemColor.inactiveCaptionText); jButton3.setBorder(BorderFactory.createLineBorder(Color.black)); jButton3.setText("取消"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton3_actionPerformed(e); } }); jButton6.setBackground(SystemColor.inactiveCaptionText); jButton6.setBorder(BorderFactory.createLineBorder(Color.black)); jButton6.setText("取消"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton6_actionPerformed(e); } }); jButton4.setBackground(SystemColor.inactiveCaptionText); jButton4.setBorder(BorderFactory.createLineBorder(Color.black)); jButton4.setText("确定"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton4_actionPerformed(e); } }); jLabel5.setBorder(BorderFactory.createEtchedBorder()); jLabel5.setText(" 面"); jLabel6.setBorder(BorderFactory.createEtchedBorder()); jLabel6.setText(" 线"); jLabel7.setBorder(BorderFactory.createEtchedBorder()); jLabel7.setText(" 点"); jLabel8.setText("请输入您要查询的体"); jLabel4.setText("查询体"); jLabel9.setText("查询面"); jLabel10.setText("查询线"); jRadioButton10.setBackground(SystemColor.info); jRadioButton10.setText(" 按面积查询"); jRadioButton11.setBackground(SystemColor.info); jRadioButton11.setText("按长度查询"); jButton5.setBackground(SystemColor.inactiveCaptionText); jButton5.setBorder(BorderFactory.createLineBorder(Color.black)); jButton5.setText("确定"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton5_actionPerformed(e); } }); jButton7.setBackground(SystemColor.inactiveCaptionText); jButton7.setBorder(BorderFactory.createLineBorder(Color.black)); jButton7.setText("重置"); jButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton7_actionPerformed(e); } }); jButton8.setBackground(SystemColor.inactiveCaptionText); jButton8.setBorder(BorderFactory.createLineBorder(Color.black)); jButton8.setText("取消"); jButton8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton8_actionPerformed(e); } }); jComboBox1.setEnabled(false); jComboBox1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jComboBox1_actionPerformed(e); } }); jScrollPane1.getViewport().setBackground(UIManager.getColor("CheckBoxMenuItem.background")); jScrollPane1.setBorder(BorderFactory.createLineBorder(Color.black)); jTable1.setBackground(SystemColor.activeCaptionText); jTable1.setBorder(BorderFactory.createLineBorder(Color.blue)); jTable1.setToolTipText("查询显示"); jTable1.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); jTable1.setGridColor(Color.blue); jTable1.setSelectionForeground(Color.darkGray); jTable1.setTableHeader(null); jRadioButton12.setBackground(SystemColor.info); jRadioButton12.setText(" 查询所有的线"); jRadioButton12.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jRadioButton12_actionPerformed(e); } }); jRadioButton13.setBackground(SystemColor.info); jRadioButton13.setText("查询所有的点"); jRadioButton13.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jRadioButton13_actionPerformed(e); } }); jRadioButton14.setBackground(SystemColor.info); jRadioButton14.setText("查询所有的面"); jRadioButton14.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jRadioButton14_actionPerformed(e); } }); jPanel3.setBackground(SystemColor.info); jPanel5.setBackground(SystemColor.info); jList1.setBackground(SystemColor.menu); jList1.setBorder(BorderFactory.createEtchedBorder()); jList1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(MouseEvent e) { jList1_mouseClicked(e); } }); jList2.setBackground(SystemColor.menu); jList2.setBorder(titledBorder2); jList2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(MouseEvent e) { jList2_mouseClicked(e); } }); jList3.setBackground(SystemColor.menu); jList3.setBorder(titledBorder1); getContentPane().add(panel1); panel1.add(jTabbedPane1, new XYConstraints(54, 104, 364, 358)); jPanel1.add(jButton4, new XYConstraints(53, 236, 64, 26)); jPanel1.add(jButton6, new XYConstraints(176, 235, 54, 27)); jPanel1.add(jComboBox1, new XYConstraints(19, 168, 143, 24)); jPanel1.add(jLabel2, new XYConstraints(11, 144, -1, -1)); jPanel1.add(jRadioButton2, new XYConstraints(10, 71, -1, -1)); jPanel1.add(jRadioButton3, new XYConstraints(9, 40, -1, -1)); jPanel1.add(jRadioButton4, new XYConstraints(10, 102, -1, -1)); jPanel1.add(jRadioButton1, new XYConstraints(10, 11, -1, -1)); jPanel1.add(jRadioButton13, new XYConstraints(190, 93, -1, -1)); jPanel1.add(jRadioButton12, new XYConstraints(192, 57, -1, -1)); jPanel1.add(jRadioButton14, new XYConstraints(193, 25, -1, -1)); jTabbedPane1.add(jPanel2, "条件查询"); jPanel2.add(jRadioButton5, new XYConstraints(18, 43, -1, -1)); jPanel2.add(jLabel4, new XYConstraints(38, 17, 67, -1)); jPanel2.add(jRadioButton6, new XYConstraints(18, 68, -1, -1)); jPanel2.add(jLabel9, new XYConstraints(127, 17, -1, -1)); jPanel2.add(jRadioButton10, new XYConstraints(109, 41, -1, -1)); jPanel2.add(jLabel10, new XYConstraints(227, 19, -1, -1)); jPanel2.add(jRadioButton11, new XYConstraints(209, 41, -1, -1)); jPanel2.add(jRadioButton8, new XYConstraints(108, 120, -1, -1)); jPanel2.add(jLabel3, new XYConstraints(29, 158, 74, 27)); jPanel2.add(jTextField1, new XYConstraints(101, 162, 122, 26)); jPanel2.add(jRadioButton7, new XYConstraints(19, 121, -1, -1)); jPanel2.add(jRadioButton9, new XYConstraints(210, 121, -1, -1)); jPanel2.add(jButton3, new XYConstraints(219, 226, 75, 27)); jPanel2.add(jButton2, new XYConstraints(125, 226, 77, 27)); jPanel2.add(jButton1, new XYConstraints(30, 226, 80, 28)); jTabbedPane1.add(jPanel4, "高级查询"); jPanel4.add(jTextField3, new XYConstraints(24, 89, 106, 25)); jPanel4.add(jLabel8, new XYConstraints(23, 61, 167, 20)); jPanel4.add(jComboBox2, new XYConstraints(22, 32, 113, -1)); jPanel4.add(jButton5, new XYConstraints(172, 56, 73, 29)); jPanel4.add(jButton7, new XYConstraints(277, 57, 65, 27)); jPanel4.add(jButton8, new XYConstraints(370, 56, 61, 27)); jPanel4.add(jLabel6, new XYConstraints(126, 120, 95, 21)); jPanel4.add(jLabel7, new XYConstraints(243, 121, 96, 21)); jPanel4.add(jLabel5, new XYConstraints(19, 120, 86, 23)); jPanel4.add(jScrollPane2, new XYConstraints(16, 148, 97, 152)); jScrollPane2.getViewport().add(jList1, null); jPanel4.add(jScrollPane3, new XYConstraints(122, 146, 109, 155)); jScrollPane3.getViewport().add(jList2, null); jPanel4.add(jScrollPane4, new XYConstraints(240, 146, 104, 154)); jScrollPane4.getViewport().add(jList3, null); jTabbedPane1.add(jPanel1, "展示性查询"); panel1.add(jScrollPane1, new XYConstraints(425, 103, 569, 354)); jScrollPane1.getViewport().add(jTable1, null); //jScrollPane1. // jScrollPane1.getViewport().add(jTable2, null); panel1.add(jLabel1, new XYConstraints(200, 60, 107, -1)); panel1.add(jPanel3, new XYConstraints(53, 475, 921, 91)); panel1.add(jPanel5, new XYConstraints(999, 105, 28, 482)); buttonGroup1.add(jRadioButton1); buttonGroup1.add(jRadioButton2); buttonGroup1.add(jRadioButton3); buttonGroup1.add(jRadioButton4); buttonGroup1.add(jRadioButton14); buttonGroup1.add(jRadioButton12); buttonGroup1.add(jRadioButton13); buttonGroup2.add(jRadioButton5); buttonGroup2.add(jRadioButton6); buttonGroup2.add(jRadioButton10); buttonGroup2.add(jRadioButton11); buttonGroup3.add(jRadioButton8); buttonGroup3.add(jRadioButton7); buttonGroup3.add(jRadioButton9); jComboBox1.addItem(""); jComboBox1.addItem("长方体"); jComboBox1.addItem("立方体"); jComboBox1.addItem("圆柱体"); jComboBox1.addItem("圆锥体");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -