From 05802a952429cd979259756f32d45e583b377947 Mon Sep 17 00:00:00 2001 From: Jered Ye <87924680+JeredYe@users.noreply.github.com> Date: Mon, 15 Jan 2024 14:38:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0config.xml=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 裁判机的编译器配置读写改在config.xml中实现 --- .gitignore | 8 +++ JuderUI/build/classes/gui/MainFrame$1.class | Bin 942 -> 942 bytes JuderUI/build/classes/gui/MainFrame$2.class | Bin 742 -> 742 bytes JuderUI/build/classes/gui/MainFrame$3.class | Bin 722 -> 722 bytes JuderUI/config.xml | 63 ++++++++++++++++++++ JuderUI/dist/lib/Common.jar | Bin 73646 -> 73701 bytes JuderUI/src/gui/Control.java | 5 +- JuderUI/src/gui/MainFrame.form | 9 ++- JuderUI/src/gui/MainFrame.java | 45 ++++++++------ 9 files changed, 109 insertions(+), 21 deletions(-) create mode 100644 JuderUI/config.xml diff --git a/.gitignore b/.gitignore index 933e274..d830644 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,11 @@ clientUpdater/dist/README.TXT Common/dist/Common.jar Judger/dist/Judger.jar Judger/dist/lib/Common.jar +*.class +*.properties +*.html +*.cpp +*.jar +*.class +*.zip +*.jar diff --git a/JuderUI/build/classes/gui/MainFrame$1.class b/JuderUI/build/classes/gui/MainFrame$1.class index 27526b778fecd11f9951416127dcd393fa806da0..c183ce04ebda6adb11a9f169e111decb32ac410a 100644 GIT binary patch delta 31 ncmZ3-zK(sv4<<&#$v>Imcug4C7)%)i7|a=D7%V5JFna+2lF$c_ delta 31 ncmZ3-zK(sv4<<(a$v>Imc#Rm?7>pSN7)%*t7|bW9Fna+2l1c}K diff --git a/JuderUI/build/classes/gui/MainFrame$2.class b/JuderUI/build/classes/gui/MainFrame$2.class index 04aacc069b19c5b0685855f407541037299fa553..a69c4eeb7daca26d57199c1a972d09be3987c9ed 100644 GIT binary patch delta 27 icmaFH`iymhJrkq#WCx}YPJ0F}1_uTq2B*n$nLGh$-v*8V delta 27 icmaFH`iymhJrkqlWCx}YPFn^p20I2J28YRWnLGh$g9e5G diff --git a/JuderUI/build/classes/gui/MainFrame$3.class b/JuderUI/build/classes/gui/MainFrame$3.class index df86e6c15d23f148c9d6871319282d66c5e339f1..e7809990deabbe8618e4e984382202136890f6be 100644 GIT binary patch delta 23 ecmcb_dWm&|6BA?AWM?KX)*1#5hT6%Km>d9DK?bb= delta 23 ecmcb_dWm&|6BA>_WM?KX)+z=LhU&?am>d9D2L`7A diff --git a/JuderUI/config.xml b/JuderUI/config.xml new file mode 100644 index 0000000..9e9423f --- /dev/null +++ b/JuderUI/config.xml @@ -0,0 +1,63 @@ + + + + + K:\Dev-Cpp\MinGW64\bin + g++.exe -Wall -g -std=c++14 -c $sourceFile$ -o $objFile$ + + g++.exe -o $exeFile$ $objFile$ -O1 + + "$exeFile$" + + + C:/MinGW/bin/ + g++.exe -Wall -g -std=c++14 -c $sourceFile$ -o $objFile$ + + g++.exe -o $exeFile$ $objFile$ -O1 + + msvc + + + + + C:/JDK8/bin + g++.exe -Wall -g -std=c++14 -c $sourceFile$ -o $objFile$ + + g++.exe -o $exeFile$ $objFile$ -O1 + + "$compilerPath$ java -cp $sourceFile$\output\$exeFile$" + + + C:/MinGW/bin/ + g++.exe -Wall -g -std=c++14 -c $sourceFile$ -o $objFile$ + + g++.exe -o $exeFile$ $objFile$ -O1 + + + + + + + + C:/MinGW/bin/ + g++.exe -Wall -g -std=c++14 -c $sourceFile$ -o $objFile$ + + g++.exe -o $exeFile$ $objFile$ -O1 + + $exeFile$ + + + C:/MinGW/bin/ + g++.exe -Wall -g -std=c++14 -c $sourceFile$ -o $objFile$ + + g++.exe -o $exeFile$ $objFile$ -O1 + + + + + + + + + + \ No newline at end of file diff --git a/JuderUI/dist/lib/Common.jar b/JuderUI/dist/lib/Common.jar index 6d9b549d913f26c6935d0e40f2e4048821f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+ + diff --git a/JuderUI/src/gui/MainFrame.java b/JuderUI/src/gui/MainFrame.java index 1e2625d..cf10850 100644 --- a/JuderUI/src/gui/MainFrame.java +++ b/JuderUI/src/gui/MainFrame.java @@ -15,6 +15,8 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.swing.JOptionPane; import javax.xml.namespace.QName; import share.gui.NewCompileSetting; @@ -124,6 +126,7 @@ public class MainFrame extends javax.swing.JFrame { }); buttonCompilersConfig.setText("C/C++"); + buttonCompilersConfig.setEnabled(false); buttonCompilersConfig.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonCompilersConfigActionPerformed(evt); @@ -265,13 +268,14 @@ public class MainFrame extends javax.swing.JFrame { }); buttonCompilersConfig1.setText("JAVA"); + buttonCompilersConfig1.setEnabled(false); buttonCompilersConfig1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonCompilersConfig1ActionPerformed(evt); } }); - jButton2.setText("鿴ļ"); + jButton2.setText("༭ļ"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); @@ -338,8 +342,8 @@ public class MainFrame extends javax.swing.JFrame { .addComponent(buttonCompilersConfig) .addComponent(distributorIP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3) - .addComponent(buttonCompilersConfig1) - .addComponent(jButton2)) + .addComponent(jButton2) + .addComponent(buttonCompilersConfig1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(distributorPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) @@ -410,13 +414,18 @@ public class MainFrame extends javax.swing.JFrame { }//GEN-LAST:event_buttonStopActionPerformed private void buttonCompilersConfigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCompilersConfigActionPerformed - - NewCompileSetting cConfig = new NewCompileSetting("c", this, true); - cConfig.setVisible(true); - Config.freshConfig(); + JOptionPane.showMessageDialog(this, "ֱļ޸ģ"); +// NewCompileSetting cConfig = new NewCompileSetting("c", this, true); +// cConfig.setVisible(true); +// Config.freshConfig(); }//GEN-LAST:event_buttonCompilersConfigActionPerformed private void button_StartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_StartActionPerformed + try { + LangSelector.init(); + } catch (Exception ex) { + Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex); + }//ˢļ if (!checkForCompile()) { return; } @@ -426,9 +435,9 @@ public class MainFrame extends javax.swing.JFrame { if (Control.startJudgerForNet(ip, Integer.parseInt(port))) { this.jLabel14.setText("- -"); //߳̿ʼ󣬲༭ - this.buttonCompilersConfig.setEnabled(false); - this.buttonCompilersConfig1.setEnabled(false); - +// this.buttonCompilersConfig.setEnabled(false); +// this.buttonCompilersConfig1.setEnabled(false); + this.jButton2.setEnabled(false);//ñ༭ļ Control.setRunStatus(); this.button_Start.setEnabled(false); this.buttonStop.setEnabled(true); @@ -455,8 +464,8 @@ public class MainFrame extends javax.swing.JFrame { //ñ JOptionPane.showMessageDialog(this, "CԱ"); - NewCompileSetting window = new NewCompileSetting("c", this, true); - window.setVisible(true); +// NewCompileSetting window = new NewCompileSetting("c", this, true); +// window.setVisible(true); return false; } @@ -464,8 +473,8 @@ public class MainFrame extends javax.swing.JFrame { if (tmp == null || "".equals(tmp) || !FileFinder.isExistFile(tmp + File.separator + "javac.exe")) { JOptionPane.showMessageDialog(this, "Java"); - NewCompileSetting window = new NewCompileSetting("java", this, true); - window.setVisible(true); +// NewCompileSetting window = new NewCompileSetting("java", this, true); +// window.setVisible(true); return false; } return true; @@ -487,8 +496,9 @@ public class MainFrame extends javax.swing.JFrame { private void buttonCompilersConfig1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCompilersConfig1ActionPerformed // TODO add your handling code here: - NewCompileSetting javaConfig = new NewCompileSetting("java", this, true); - javaConfig.setVisible(true); + JOptionPane.showMessageDialog(this, "ֱļ޸ģ"); +// NewCompileSetting javaConfig = new NewCompileSetting("java", this, true); +// javaConfig.setVisible(true); }//GEN-LAST:event_buttonCompilersConfig1ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed @@ -497,6 +507,7 @@ public class MainFrame extends javax.swing.JFrame { try { // ļ desktop.open(new File(LangSelector.getConfigPath())); +// desktop.open(FileFinder.findFile("ConfigEditor.exe"))); } catch (IOException e) { e.printStackTrace(); } @@ -585,7 +596,7 @@ public class MainFrame extends javax.swing.JFrame { private javax.swing.JTextField distributorIP; private javax.swing.JTextField distributorPort; private javax.swing.JButton jButton1; - private javax.swing.JButton jButton2; + javax.swing.JButton jButton2; private javax.swing.JCheckBox jCheckBox1; javax.swing.JComboBox jComboBox1; javax.swing.JLabel jLabel14;