📄 reportpanel.java
字号:
/* * ReportPanel.java * * Created on 2004年1月19日, 下午2:35 */package romulus.Manager;/** * * @author Administrator */public class ReportPanel extends javax.swing.JPanel { /** Creates new form ReportPanel */ public ReportPanel(ManagerToolSet mts) { try{ this.mts = mts; initComponents(); ReportTable.setModel(this.mts.getReportTable(ManagerToolSet.MTS_Default, true)); } catch(Exception e){ e.printStackTrace(); firePropertyChange(RomulusManagerClientFrame.ShowMSGProp, RomulusManagerClientFrame.ExitMSGProp, "Errors"); } } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ private void initComponents() {//GEN-BEGIN:initComponents java.awt.GridBagConstraints gridBagConstraints; ParamGroup = new javax.swing.ButtonGroup(); SortGroup = new javax.swing.ButtonGroup(); ParamPanel = new javax.swing.JPanel(); DefalutRadioButton = new javax.swing.JRadioButton(); NameRadioButton = new javax.swing.JRadioButton(); TestRadioButton = new javax.swing.JRadioButton(); ScoreRadioButton = new javax.swing.JRadioButton(); ASCRadioButton = new javax.swing.JRadioButton(); DECRadioButton = new javax.swing.JRadioButton(); CommitButton = new javax.swing.JButton(); ScrollPane = new javax.swing.JScrollPane(); ReportTable = new javax.swing.JTable(); setLayout(new java.awt.BorderLayout()); setFont(getFont()); ParamPanel.setLayout(new java.awt.GridBagLayout()); ParamPanel.setFont(getFont()); DefalutRadioButton.setFont(getFont()); DefalutRadioButton.setSelected(true); DefalutRadioButton.setText("\u9ed8\u8ba4\u987a\u5e8f"); ParamGroup.add(DefalutRadioButton); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; ParamPanel.add(DefalutRadioButton, gridBagConstraints); NameRadioButton.setFont(getFont()); NameRadioButton.setText("\u59d3\u540d\u987a\u5e8f"); ParamGroup.add(NameRadioButton); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; ParamPanel.add(NameRadioButton, gridBagConstraints); TestRadioButton.setFont(getFont()); TestRadioButton.setText("\u8003\u8bd5\u987a\u5e8f"); ParamGroup.add(TestRadioButton); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; ParamPanel.add(TestRadioButton, gridBagConstraints); ScoreRadioButton.setFont(getFont()); ScoreRadioButton.setText("\u6210\u7ee9\u987a\u5e8f"); ParamGroup.add(ScoreRadioButton); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; ParamPanel.add(ScoreRadioButton, gridBagConstraints); ASCRadioButton.setFont(getFont()); ASCRadioButton.setSelected(true); ASCRadioButton.setText("\u9012\u589e\u987a\u5e8f"); SortGroup.add(ASCRadioButton); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; ParamPanel.add(ASCRadioButton, gridBagConstraints); DECRadioButton.setFont(getFont()); DECRadioButton.setText("\u9012\u51cf\u987a\u5e8f"); SortGroup.add(DECRadioButton); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; ParamPanel.add(DECRadioButton, gridBagConstraints); CommitButton.setFont(getFont()); CommitButton.setText("\u67e5\u8be2"); CommitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { CommitButtonActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; ParamPanel.add(CommitButton, gridBagConstraints); add(ParamPanel, java.awt.BorderLayout.SOUTH); ScrollPane.setFont(getFont()); ReportTable.setFont(getFont()); ReportTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null}, {null, null} }, new String [] { "Title 1", "Title 2" } )); ScrollPane.setViewportView(ReportTable); add(ScrollPane, java.awt.BorderLayout.CENTER); }//GEN-END:initComponents private void CommitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CommitButtonActionPerformed // Add your handling code here: try{ String param1 = ManagerToolSet.MTS_Default; boolean param2 = true; if(this.DefalutRadioButton.isSelected()){ param1 = ManagerToolSet.MTS_Default; } else if(this.NameRadioButton.isSelected()){ param1 = ManagerToolSet.MTS_Student; } else if(this.TestRadioButton.isSelected()){ param1 = ManagerToolSet.MTS_Test; } else if(this.ScoreRadioButton.isSelected()){ param1 = ManagerToolSet.MTS_Score; } if(this.DECRadioButton.isSelected()){ param2 = false; } ReportTable.setModel(this.mts.getReportTable(param1, param2)); } catch(Exception e){ e.printStackTrace(); firePropertyChange(RomulusManagerClientFrame.ShowMSGProp, RomulusManagerClientFrame.ExitMSGProp, "Errors"); } }//GEN-LAST:event_CommitButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JRadioButton DECRadioButton; private javax.swing.JRadioButton ScoreRadioButton; private javax.swing.JScrollPane ScrollPane; private javax.swing.JRadioButton DefalutRadioButton; private javax.swing.JRadioButton TestRadioButton; private javax.swing.JRadioButton NameRadioButton; private javax.swing.ButtonGroup SortGroup; private javax.swing.JRadioButton ASCRadioButton; private javax.swing.JButton CommitButton; private javax.swing.JPanel ParamPanel; private javax.swing.ButtonGroup ParamGroup; private javax.swing.JTable ReportTable; // End of variables declaration//GEN-END:variables private ManagerToolSet mts;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -