📄 mainframe.java
字号:
}); groupMenuItem = new javax.swing.JMenuItem (); groupMenuItem.setText ("Groups"); groupMenuItem.setMnemonic(KeyEvent.VK_G); groupMenuItem.addActionListener (new java.awt.event.ActionListener () { public void actionPerformed (java.awt.event.ActionEvent evt) { jgroupMenuItemActionPerformed (evt); } }); admMenu.add(groupMenuItem); userMenuItem = new javax.swing.JMenuItem (); userMenuItem.setText ("Users"); userMenuItem.setMnemonic(KeyEvent.VK_U); userMenuItem.addActionListener (new java.awt.event.ActionListener () { public void actionPerformed (java.awt.event.ActionEvent evt) { juserMenuItemActionPerformed (evt); } }); admMenu.add(userMenuItem); arminerMenuBar.add(admMenu); aboutMenu = new javax.swing.JMenu (); aboutMenu.setText ("About"); aboutMenu.setMnemonic(KeyEvent.VK_B); aboutMenu.addActionListener (new java.awt.event.ActionListener () { public void actionPerformed (java.awt.event.ActionEvent evt) { jaboutMenuActionPerformed (evt); } }); aboutMenuItem = new javax.swing.JMenuItem (); aboutMenuItem.setText ("About ARMiner"); aboutMenuItem.setMnemonic(KeyEvent.VK_A); aboutMenuItem.addActionListener (new java.awt.event.ActionListener () { public void actionPerformed (java.awt.event.ActionEvent evt) { aboutMenuItemActionPerformed (evt); } }); aboutMenu.add(aboutMenuItem); arminerMenuBar.add(aboutMenu); setJMenuBar(arminerMenuBar); }//GEN-END:initComponents private boolean getUserGroupInfo() { try { Client.getDBConfig1(); } catch(ClientErrorException e) { //catch(Exception e){ JOptionPane.showMessageDialog(this, "MainFrame: Client Error in getting DBConfig:\n " + e.toString() + " \ntransaction aborted!"); return false; } try { users = Client.dbConfig.listUsers(); groups = Client.dbConfig.listGroups(Client.userName); return true; } catch(DBConfigException e) { JOptionPane.showMessageDialog(this, "MainFrame: Error in getting users and groups from DBConfig:\n" + e.toString() + " \ntransaction aborted!"); return false; } } private boolean getAlgGroupInfo() { try { Client.getDBConfig1(); } catch(ClientErrorException e) { JOptionPane.showMessageDialog(this, "MainFrame: Client Error in getting DBConfig:\n " + e.toString() + " \ntransaction aborted!"); return false; } try { groups = Client.dbConfig.listGroups(Client.userName); } catch(DBConfigException e) { JOptionPane.showMessageDialog(this, "MainFrame: Error in getting groups from DBConfig:\n " + e.toString() + " \ntransaction aborted!"); return false; } try { algorithms = Client.dbConfig.listAlgorithms(Client.userName); } catch(DBConfigException e) { JOptionPane.showMessageDialog(this, "MainFrame: Error in getting algorithms from DBConfig:\n " + e.toString() + " \ntransaction aborted!"); return false; } return true; } private void aboutMenuItemActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutMenuItemActionPerformed new AboutDialog(this).show(); }//GEN-LAST:event_aboutMenuItemActionPerformed private void genDBMenuItemActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_genDBMenuItemActionPerformed // Add your handling code here: try { new DatabaseGenerateDialog(this).show(); } catch(ClientException e) { System.out.println(e); } }//GEN-LAST:event_genDBMenuItemActionPerformed private void benchMenuItemActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_benchMenuItemActionPerformed // Add your handling code here: try { new BenchmarkDialog(this).show(); } catch(ClientException e) { System.out.println(e); } }//GEN-LAST:event_benchMenuItemActionPerformed private void exitMenuItemActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed // Add your handling code here: Client.clientExit(); dispose(); System.exit(0); }//GEN-LAST:event_exitMenuItemActionPerformed private void juserMenuItemActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_juserMenuItemActionPerformed // Add your handling code here: if (getUserGroupInfo() == false) return; new UserManagerDialog(this, true, users,groups).show(); }//GEN-LAST:event_juserMenuItemActionPerformed private void jgroupMenuItemActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jgroupMenuItemActionPerformed // Add your handling code here: if (getUserGroupInfo() == false) return; new GroupManagerDialog(this, true, groups, users).show(); }//GEN-LAST:event_jgroupMenuItemActionPerformed private void jmodAlgMenuItemActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmodAlgMenuItemActionPerformed // Add your handling code here: if (getAlgGroupInfo() == false) return; new AlgorithmModifyDialog(this, true, algorithms,groups).show(); }//GEN-LAST:event_jmodAlgMenuItemActionPerformed private void jaddAlgMenuItemActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jaddAlgMenuItemActionPerformed // Add your handling code here: if (getAlgGroupInfo() == false) return; new AlgorithmAddDialog(this, true, groups).show(); }//GEN-LAST:event_jaddAlgMenuItemActionPerformed private void jmodDBMenuItemActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmodDBMenuItemActionPerformed try { DatabaseModifyDialog mf = new DatabaseModifyDialog(this, true); mf.show(); } catch(ClientException e) { JOptionPane.showMessageDialog(this, e.toString()); } } private void jaddDBMenuItemActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jaddDBMenuItemActionPerformed try { DatabaseAddDialog mf = new DatabaseAddDialog(this, true); mf.show(); } catch(ClientException e) { JOptionPane.showMessageDialog(this, e.toString()); } } private void mineMenuActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mineMenuActionPerformed } private void jaboutMenuActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jaboutMenuActionPerformed // Add your handling code here: }//GEN-LAST:event_jaboutMenuActionPerformed private void jadmMenuActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jadmMenuActionPerformed // Add your handling code here: }//GEN-LAST:event_jadmMenuActionPerformed private void jalgMenuActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jalgMenuActionPerformed // Add your handling code here: }//GEN-LAST:event_jalgMenuActionPerformed private void jdbMenuActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jdbMenuActionPerformed // Add your handling code here: }//GEN-LAST:event_jdbMenuActionPerformed private void jfindARMenuItemActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jfindARMenuItemActionPerformed try { MiningDialog mf = new MiningDialog(this, true); mf.show(); } catch(ClientException e) { JOptionPane.showMessageDialog(this, e.toString()); } }//GEN-LAST:event_jfindARMenuItemActionPerformed /** Exit the Application */ private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm Client.clientExit(); dispose(); System.exit(0); }//GEN-LAST:event_exitForm // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JMenuBar arminerMenuBar; private javax.swing.JMenu mineMenu; private javax.swing.JMenu dbMenu; private javax.swing.JMenu algMenu; private javax.swing.JMenu admMenu; private javax.swing.JMenu aboutMenu; private javax.swing.JMenuItem findARMenuItem; private javax.swing.JMenuItem benchMenuItem; private javax.swing.JMenuItem exitMenuItem; private javax.swing.JMenuItem addDBMenuItem; private javax.swing.JMenuItem modDBMenuItem; private javax.swing.JMenuItem genDBMenuItem; private javax.swing.JMenuItem addAlgMenuItem; private javax.swing.JMenuItem modAlgMenuItem; private javax.swing.JMenuItem groupMenuItem; private javax.swing.JMenuItem userMenuItem; private javax.swing.JMenuItem aboutMenuItem; private java.util.Vector users; private java.util.Vector groups; private java.util.Vector algorithms; // End of variables declaration//GEN-END:variables}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -