📄 testmanagerpanel.java
字号:
/* * TestManagerPanel.java * * Created on 2004年1月22日, 下午1:56 */package romulus.Manager;/** * * @author S */public class TestManagerPanel extends javax.swing.JPanel { /** Creates new form TestManagerPanel */ public TestManagerPanel(ManagerToolSet mts) { initComponents(); this.mts = mts; } /** 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; XMLButton = new javax.swing.JButton(); FullTestButton = new javax.swing.JButton(); ScrollPane = new javax.swing.JScrollPane(); TestList = new javax.swing.JList(); QuePanel = new javax.swing.JPanel(); setLayout(new java.awt.GridBagLayout()); XMLButton.setFont(getFont()); XMLButton.setText("LoadXML..."); XMLButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { XMLButtonActionPerformed(evt); } }); 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; add(XMLButton, gridBagConstraints); FullTestButton.setFont(getFont()); FullTestButton.setText("LoadTest"); 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; add(FullTestButton, gridBagConstraints); TestList.setFont(getFont()); ScrollPane.setViewportView(TestList); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(ScrollPane, gridBagConstraints); QuePanel.setLayout(new java.awt.BorderLayout()); QuePanel.setFont(getFont()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 3; gridBagConstraints.gridheight = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 10.0; gridBagConstraints.weighty = 10.0; add(QuePanel, gridBagConstraints); }//GEN-END:initComponents private void XMLButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_XMLButtonActionPerformed javax.swing.JFileChooser jfc = new javax.swing.JFileChooser(); jfc.addChoosableFileFilter(new javax.swing.filechooser.FileFilter(){ public boolean accept(java.io.File f) { if (f.isDirectory()) { return true; } String ext = null; String s = f.getName(); int i = s.lastIndexOf('.'); if (i > 0 && i < s.length() - 1) { ext = s.substring(i+1).toLowerCase(); } if (ext != null && ext.equalsIgnoreCase("xml")){ return true; } else { return false; } } public String getDescription() { return "Just XML files"; } }); int retval = jfc.showOpenDialog(this); try{ if (retval == javax.swing.JFileChooser.APPROVE_OPTION) { java.io.File file = jfc.getSelectedFile(); romulus.Test ret = romulus.XMLChanger.GetTestFromXML(file); this.QuePanel.add(new romulus.UI.QuestionPanel(ret, true)); } else { System.out.println("Open command cancelled by user." ); } this.getTopLevelAncestor().repaint(); this.getTopLevelAncestor().validate(); } catch(Exception e){ e.printStackTrace(); firePropertyChange(RomulusManagerClientFrame.ShowMSGProp, RomulusManagerClientFrame.ExitMSGProp, "Errors"); } }//GEN-LAST:event_XMLButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JScrollPane ScrollPane; private javax.swing.JList TestList; private javax.swing.JButton XMLButton; private javax.swing.JPanel QuePanel; private javax.swing.JButton FullTestButton; // End of variables declaration//GEN-END:variables private ManagerToolSet mts;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -