diff --git a/Common/build/classes/common/Config.class b/Common/build/classes/common/Config.class index b4531e3..124f434 100644 Binary files a/Common/build/classes/common/Config.class and b/Common/build/classes/common/Config.class differ diff --git a/Common/build/classes/common/Const.class b/Common/build/classes/common/Const.class index 90d7b64..c16b772 100644 Binary files a/Common/build/classes/common/Const.class and b/Common/build/classes/common/Const.class differ diff --git a/Common/build/classes/common/FileFinder.class b/Common/build/classes/common/FileFinder.class index 07c2c5e..24da688 100644 Binary files a/Common/build/classes/common/FileFinder.class and b/Common/build/classes/common/FileFinder.class differ diff --git a/Common/build/classes/common/LangSelector$PlaceHolder.class b/Common/build/classes/common/LangSelector$PlaceHolder.class new file mode 100644 index 0000000..38558ea Binary files /dev/null and b/Common/build/classes/common/LangSelector$PlaceHolder.class differ diff --git a/Common/build/classes/common/LangSelector.class b/Common/build/classes/common/LangSelector.class new file mode 100644 index 0000000..602e1b0 Binary files /dev/null and b/Common/build/classes/common/LangSelector.class differ diff --git a/Common/build/classes/persistence/ObjectRelation_interface/CommonDAO.class b/Common/build/classes/persistence/ObjectRelation_interface/CommonDAO.class index 2cc529f..517c3a3 100644 Binary files a/Common/build/classes/persistence/ObjectRelation_interface/CommonDAO.class and b/Common/build/classes/persistence/ObjectRelation_interface/CommonDAO.class differ diff --git a/Common/dist/Common.jar b/Common/dist/Common.jar index 4642743..5a645a5 100644 Binary files a/Common/dist/Common.jar and b/Common/dist/Common.jar differ diff --git a/Common/src/common/Config.java b/Common/src/common/Config.java index faaa18e..815e775 100644 --- a/Common/src/common/Config.java +++ b/Common/src/common/Config.java @@ -25,7 +25,7 @@ public class Config { static { try { - InputStream in = new FileInputStream(FileFinder.findFile("config.properties")); + InputStream in = new FileInputStream(FileFinder.findFile("config/config.properties")); prop.load(in); DEBUG = Integer.valueOf(prop.getProperty("Debug")); // isCppRelative = prop.getProperty("isCppRelative").equals("true") ? true : false; @@ -42,6 +42,7 @@ public class Config { } else { JavaRelative = -1; } + } catch (Exception e) { Log.writeExceptionLog(e.getClass()+e.getMessage()); e.printStackTrace(); @@ -50,11 +51,11 @@ public class Config { public static void freshConfig() { try { - InputStream in = new FileInputStream(FileFinder.findFile("config.properties")); + InputStream in = new FileInputStream(FileFinder.findFile("config/config.properties")); prop.load(in); DEBUG = Integer.valueOf(prop.getProperty("Debug")); -// isCppRelative = prop.getProperty("isCppRelative").equals("true") ? true : false; -// isJavaRelative = prop.getProperty("isJavaRelative").equals("true")?true: false; + + String tmp = prop.getProperty(Const.MinGWRelative); if (tmp != null && !"".equals(tmp)) { @@ -86,7 +87,7 @@ public class Config { public static void save() { try { // 文件输出流 - FileOutputStream fos = new FileOutputStream(FileFinder.findFile("config.properties")); + FileOutputStream fos = new FileOutputStream(FileFinder.findFile("config/config.properties")); // 将Properties集合保存到流中 prop.store(fos, "update config.properties"); fos.close();// 关闭流 @@ -127,9 +128,9 @@ public class Config { if (language.equals("c") || language.equals("cpp") || language.equals("c++")) //返回各种语言的编译器地址 { - dir = System.getProperty("user.dir") + Const.RelativeMinGWCompileDir; + dir = System.getProperty("user.dir") + Const.MinGWDir; } else if (language.equals("java")) { - dir = System.getProperty("user.dir") + Const.RelativeJavaCompileDir; + dir = System.getProperty("user.dir") + Const.JavaCompilerDir; } return dir; } diff --git a/Common/src/common/Const.java b/Common/src/common/Const.java index a4db6ea..9ccb743 100644 --- a/Common/src/common/Const.java +++ b/Common/src/common/Const.java @@ -41,9 +41,9 @@ public class Const { return null; } - public static final String cCompilerDirIdentify = "cCompilerDir"; - public static final String cppCompilerDirIdentify = "cppCompilerDir"; - public static final String javaCompilerDirIdentify = "javaCompilerDir"; + public static final String cCompilerDirIdentify = "MinGWDir";//"cCompilerDir"; + public static final String cppCompilerDirIdentify = "MinGWDir";//"cppCompilerDir" + public static final String javaCompilerDirIdentify = "JavaCompileDir"; public static final String JavaCompilerDir = "JavaCompileDir"; public static final String RelativeJavaCompileDir = "\\Java\\bin"; public static final String JavaRelative = "JavaRelative"; diff --git a/Common/src/common/FileFinder.java b/Common/src/common/FileFinder.java index b562602..beafda6 100644 --- a/Common/src/common/FileFinder.java +++ b/Common/src/common/FileFinder.java @@ -14,9 +14,38 @@ import java.util.List; * @author Administrator */ public class FileFinder { - + private static String findFilePath(String fileName) { + String currentPath = System.getProperty("user.dir"); + String configFile = fileName; + + // Try to find config.xml in the current directory + File currentDirConfigFile = new File(currentPath, configFile); + System.out.print(currentDirConfigFile.getAbsoluteFile()); + if (currentDirConfigFile.exists()) { + return currentDirConfigFile.getAbsolutePath(); + } + + // If not found, recursively search in parent directories + return findInParentDirectory(new File(currentPath), configFile); + } + + private static String findInParentDirectory(File directory, String configFile) { + File configFileInParent = new File(directory, configFile); + if (configFileInParent.exists()) { + return configFileInParent.getAbsolutePath(); + } + + // If not found and not the root directory, recursively search in parent + File parentDirectory = directory.getParentFile(); + if (parentDirectory != null) { + return findInParentDirectory(parentDirectory, configFile); + } + + // If reached the root directory and still not found, return null + return null; + } public static File findFile(String fileName){ - return new File("config/"+fileName); + return new File(findFilePath(fileName)); } public static boolean isExistFile(String fileName){ diff --git a/Common/src/common/LangSelector.java b/Common/src/common/LangSelector.java new file mode 100644 index 0000000..f631d47 --- /dev/null +++ b/Common/src/common/LangSelector.java @@ -0,0 +1,157 @@ +package common; +import java.io.File; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import java.util.HashMap; +import javax.swing.JOptionPane; + +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + +import org.w3c.dom.Document; + +/** + * + * @author Jared Ye + */ +public abstract class LangSelector { + + private static String ConfigPath=""; + private static Document Data; + public static boolean Loaded=false; + private static XPath xpath = XPathFactory.newInstance().newXPath(); + static { + try { + ConfigPath=findConfigFilePath(); + Data = init(ConfigPath); + Loaded=true; + } catch (Exception e) { + //初始化的时候没有读到config.xml + } + } + private static String findConfigFilePath() { + String currentPath = System.getProperty("user.dir"); + String configFile = "config.xml"; + + // Try to find config.xml in the current directory + File currentDirConfigFile = new File(currentPath, configFile); + if (currentDirConfigFile.exists()) { + return currentDirConfigFile.getAbsolutePath(); + } + + // If not found, recursively search in parent directories + return findConfigInParentDirectory(new File(currentPath), configFile); + } + + private static String findConfigInParentDirectory(File directory, String configFile) { + File configFileInParent = new File(directory, configFile); + if (configFileInParent.exists()) { + return configFileInParent.getAbsolutePath(); + } + + // If not found and not the root directory, recursively search in parent + File parentDirectory = directory.getParentFile(); + if (parentDirectory != null) { + return findConfigInParentDirectory(parentDirectory, configFile); + } + + // If reached the root directory and still not found, return null + return null; + } + //自动递归向上级获取config.xml的路径 + public static String getConfigPath(){ + return ConfigPath; + } + + public static String getDefaultCompilerName(String languageName){ + //if(languageName.charAt(0)>='a')languageName + try{ + String exp="/languages/language"+ "[@id='" +languageName+ "']"+"/compiler[1]/@name"; + return (String) xpath.evaluate(exp,Data); + } catch (XPathExpressionException e) { + System.out.println(e.getMessage()); + return null; + } + } + //当没有指定具体的编译器时,自动获取一个默认的编译器。 + + + + public static Document init(String ConfigPath) throws Exception { + // 创建Document对象 + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setValidating(false); + DocumentBuilder db = dbf.newDocumentBuilder(); + // 创建XPath对象 + LangSelector.ConfigPath =ConfigPath; + //JOptionPane.showMessageDialog(null,"当前工作目录:"+ConfigPath); +// LangSelector.ConfigPath=new File(LangSelector.ConfigPath).getAbsolutePath(); + return db.parse(LangSelector.ConfigPath); + } + + + public static String getCompilerPath(String languageName,String compilerName) { + if(compilerName==null)compilerName=getDefaultCompilerName(languageName); + try{ + String exp="/languages/language"+ "[@id='" +languageName+ "']"+"//compiler[@name='"+compilerName+"']//path/text()"; + return (String) xpath.evaluate(exp,Data); + } catch (XPathExpressionException e) { + System.out.println(e.getMessage()); + return null; + } + } + public static String getCompileCommand(String languageName,String compilerName){ + if(compilerName==null)compilerName=getDefaultCompilerName(languageName); + try{ + String exp="/languages/language"+ "[@id='" +languageName+ "']"+"//compiler[@name='"+compilerName+"']//compileCmd/text()"; + return (String) xpath.evaluate(exp,Data); + } catch (XPathExpressionException e) { + System.out.println(e.getMessage()); + return null; + } + } + public static String getLinkCommand(String languageName,String compilerName){ + if(compilerName==null)compilerName=getDefaultCompilerName(languageName); + try{ + String exp="/languages/language"+ "[@id='" +languageName+ "']"+"//compiler[@name='"+compilerName+"']//linkCmd/text()"; + return (String) xpath.evaluate(exp,Data); + } catch (XPathExpressionException e) { + System.out.println(e.getMessage()); + return null; + } + } + public static String getRunCommand(String languageName,String compilerName){ + if(compilerName==null)compilerName=getDefaultCompilerName(languageName); + try{ + String exp="/languages/language"+ "[@id='" +languageName+ "']"+"//compiler[@name='"+compilerName+"']//runCmd/text()"; + return (String) xpath.evaluate(exp,Data); + } catch (XPathExpressionException e) { + System.out.println(e.getMessage()); + return null; + } + } + public enum PlaceHolder{ + + SourceFile("$sourceFile$"), + ObjFile("$objFile$"), + ExeFile("$exeFile$"), + CompilerPath("$compilerPath$"); + private final String strPlaceHolder; + private PlaceHolder(String str){ + strPlaceHolder=str; + } + public String getStr(){ + return strPlaceHolder; + } + } + public static String matchPlaceHolder(String src, HashMapmap){ + for (java.util.Map.Entry Entry : map.entrySet()) { + src = src.replace(Entry.getKey(), Entry.getValue()); + System.out.println(Entry.getKey() + "已替换:" + Entry.getValue()); + } + return src; + } + + +} diff --git a/Common/test/common/LangSelectorTest.java b/Common/test/common/LangSelectorTest.java new file mode 100644 index 0000000..adafaef --- /dev/null +++ b/Common/test/common/LangSelectorTest.java @@ -0,0 +1,29 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package common; + +import static common.LangSelector.*; +import java.util.HashMap; + +/** + * + * @author tange + */ +public class LangSelectorTest { + public static void main(String[] args) { + + String compileCmd=getCompileCommand("C++","MinGW"); + HashMap map=new HashMap(){ + { + put(LangSelector.PlaceHolder.SourceFile.getStr(), "TestSourceFile"); + put(LangSelector.PlaceHolder.ObjFile.getStr(), "TestObjFile"); + } + }; + compileCmd=matchPlaceHolder(compileCmd,map); + System.out.println(compileCmd); + System.out.println(getDefaultCompilerName("C++")); + } +} diff --git a/Common/test/common/config.xml b/Common/test/common/config.xml new file mode 100644 index 0000000..3fa697b --- /dev/null +++ b/Common/test/common/config.xml @@ -0,0 +1,63 @@ + + + + + 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 + + helloworld + + + + + 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 + + + + + + + + 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/ConfigEditor.deps.json b/ConfigEditor.deps.json new file mode 100644 index 0000000..45d765f --- /dev/null +++ b/ConfigEditor.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v6.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v6.0": { + "ConfigEditor/1.0.0": { + "runtime": { + "ConfigEditor.dll": {} + } + } + } + }, + "libraries": { + "ConfigEditor/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/ConfigEditor.dll b/ConfigEditor.dll new file mode 100644 index 0000000..ca07dac Binary files /dev/null and b/ConfigEditor.dll differ diff --git a/ConfigEditor.exe b/ConfigEditor.exe new file mode 100644 index 0000000..1510895 Binary files /dev/null and b/ConfigEditor.exe differ diff --git a/ConfigEditor.runtimeconfig.json b/ConfigEditor.runtimeconfig.json new file mode 100644 index 0000000..54681bc --- /dev/null +++ b/ConfigEditor.runtimeconfig.json @@ -0,0 +1,18 @@ +{ + "runtimeOptions": { + "tfm": "net6.0", + "frameworks": [ + { + "name": "Microsoft.NETCore.App", + "version": "6.0.0" + }, + { + "name": "Microsoft.WindowsDesktop.App", + "version": "6.0.0" + } + ], + "configProperties": { + "System.Reflection.Metadata.MetadataUpdater.IsSupported": false + } + } +} \ No newline at end of file diff --git a/JuderUI/build/built-jar.properties b/JuderUI/build/built-jar.properties index e5d6bcc..6d4efde 100644 --- a/JuderUI/build/built-jar.properties +++ b/JuderUI/build/built-jar.properties @@ -1,4 +1,4 @@ -#Fri, 12 Jan 2024 21:11:15 +0800 +#Fri, 12 Jan 2024 23:38:16 +0800 K\:\\OJ\\JuderUI= diff --git a/JuderUI/build/classes/gui/MainFrame$1.class b/JuderUI/build/classes/gui/MainFrame$1.class index f04759d..27526b7 100644 Binary files a/JuderUI/build/classes/gui/MainFrame$1.class and b/JuderUI/build/classes/gui/MainFrame$1.class differ diff --git a/JuderUI/build/classes/gui/MainFrame$10.class b/JuderUI/build/classes/gui/MainFrame$10.class index 0be02f0..53914ca 100644 Binary files a/JuderUI/build/classes/gui/MainFrame$10.class and b/JuderUI/build/classes/gui/MainFrame$10.class differ diff --git a/JuderUI/build/classes/gui/MainFrame$11.class b/JuderUI/build/classes/gui/MainFrame$11.class index a7a5bb5..3dca7b2 100644 Binary files a/JuderUI/build/classes/gui/MainFrame$11.class and b/JuderUI/build/classes/gui/MainFrame$11.class differ diff --git a/JuderUI/build/classes/gui/MainFrame$12.class b/JuderUI/build/classes/gui/MainFrame$12.class new file mode 100644 index 0000000..48583e6 Binary files /dev/null and b/JuderUI/build/classes/gui/MainFrame$12.class differ diff --git a/JuderUI/build/classes/gui/MainFrame$2.class b/JuderUI/build/classes/gui/MainFrame$2.class index bff546d..04aacc0 100644 Binary files a/JuderUI/build/classes/gui/MainFrame$2.class and b/JuderUI/build/classes/gui/MainFrame$2.class differ diff --git a/JuderUI/build/classes/gui/MainFrame$3.class b/JuderUI/build/classes/gui/MainFrame$3.class index bf033d2..df86e6c 100644 Binary files a/JuderUI/build/classes/gui/MainFrame$3.class and b/JuderUI/build/classes/gui/MainFrame$3.class differ diff --git a/JuderUI/build/classes/gui/MainFrame$4.class b/JuderUI/build/classes/gui/MainFrame$4.class index 65ef058..f88e55e 100644 Binary files a/JuderUI/build/classes/gui/MainFrame$4.class and b/JuderUI/build/classes/gui/MainFrame$4.class differ diff --git a/JuderUI/build/classes/gui/MainFrame$5.class b/JuderUI/build/classes/gui/MainFrame$5.class index 0f2dfa3..07637a7 100644 Binary files a/JuderUI/build/classes/gui/MainFrame$5.class and b/JuderUI/build/classes/gui/MainFrame$5.class differ diff --git a/JuderUI/build/classes/gui/MainFrame$6.class b/JuderUI/build/classes/gui/MainFrame$6.class index bb794b0..e12d9a0 100644 Binary files a/JuderUI/build/classes/gui/MainFrame$6.class and b/JuderUI/build/classes/gui/MainFrame$6.class differ diff --git a/JuderUI/build/classes/gui/MainFrame$7.class b/JuderUI/build/classes/gui/MainFrame$7.class index 4986508..bdc10ca 100644 Binary files a/JuderUI/build/classes/gui/MainFrame$7.class and b/JuderUI/build/classes/gui/MainFrame$7.class differ diff --git a/JuderUI/build/classes/gui/MainFrame$8.class b/JuderUI/build/classes/gui/MainFrame$8.class index 1976970..e16d3a9 100644 Binary files a/JuderUI/build/classes/gui/MainFrame$8.class and b/JuderUI/build/classes/gui/MainFrame$8.class differ diff --git a/JuderUI/build/classes/gui/MainFrame$9.class b/JuderUI/build/classes/gui/MainFrame$9.class index 10fb9d2..83f10f4 100644 Binary files a/JuderUI/build/classes/gui/MainFrame$9.class and b/JuderUI/build/classes/gui/MainFrame$9.class differ diff --git a/JuderUI/build/classes/gui/MainFrame.class b/JuderUI/build/classes/gui/MainFrame.class index 30988b1..514ef80 100644 Binary files a/JuderUI/build/classes/gui/MainFrame.class and b/JuderUI/build/classes/gui/MainFrame.class differ diff --git a/JuderUI/config/Config.properties b/JuderUI/config/Config.properties index 041b526..937f0af 100644 --- a/JuderUI/config/Config.properties +++ b/JuderUI/config/Config.properties @@ -1,5 +1,5 @@ #update config.properties -#Fri Jan 12 21:11:20 CST 2024 +#Fri Jan 12 23:38:08 CST 2024 srcDir=G\:\\org\\JuderUI\\test isCppRelative=true relativeJavaCompilerDir=C\:\\Program Files\\Java\\jdk1.8.0_40\\bin @@ -8,19 +8,19 @@ cCompilerDir=C\:\\\u65B0\u5EFA\u6587\u4EF6\u5939 ThreadNumber=1 distributorPort=80 exeDir=G\:\\org\\JuderUI\\TMP -MinGWDir=Z\:\\project\\OJ\\client\\MinGW\\bin +MinGWDir=C\:\\MinGW\\bin relativeCCompilerDir=\\MinGW\\bin distributorIP=106.15.36.190 -JavaRelative=2 +JavaRelative=3 >>>>>>>=.r76 isJavaRelative=true <<<<<<<=.mine MinGWRelative=3 relativeCppCompilerDir=\\MinGW\\bin javaCompilerDir=\\\\vmware-host\\Shared Folders\\\u6587\u7A3F\\NetBeansProjects\\oj\\client\\MinGW\\bin -JavaCompileDir=C\:\\Program Files\\Java\\jdk1.8.0_202\\bin +JavaCompileDir=C\:\\Program Files\\Java\\jdk1.8.0_121\\bin Debug=1 URLaddress=10.202.40.190 StartThreadAuto=true -cppCompilerDir=\\\\vmware-host\\Shared Folders\\\u6587\u7A3F\\NetBeansProjects\\oj\\client\\MinGW\\bin =\=\=\=\=\=\= +cppCompilerDir=\\\\vmware-host\\Shared Folders\\\u6587\u7A3F\\NetBeansProjects\\oj\\client\\MinGW\\bin diff --git a/JuderUI/dist.zip b/JuderUI/dist.zip new file mode 100644 index 0000000..b7a75f7 Binary files /dev/null and b/JuderUI/dist.zip differ diff --git a/JuderUI/dist/JuderUI.jar b/JuderUI/dist/JuderUI.jar index e5ad898..4475ba5 100644 Binary files a/JuderUI/dist/JuderUI.jar and b/JuderUI/dist/JuderUI.jar differ diff --git a/JuderUI/dist/lib/Common.jar b/JuderUI/dist/lib/Common.jar index fac8f86..5a645a5 100644 Binary files a/JuderUI/dist/lib/Common.jar and b/JuderUI/dist/lib/Common.jar differ diff --git a/JuderUI/dist/lib/Judger.jar b/JuderUI/dist/lib/Judger.jar index 9c0417d..7ee5700 100644 Binary files a/JuderUI/dist/lib/Judger.jar and b/JuderUI/dist/lib/Judger.jar differ diff --git a/JuderUI/log/exception/20240112.log b/JuderUI/log/exception/20240112.log new file mode 100644 index 0000000..0224b3b --- /dev/null +++ b/JuderUI/log/exception/20240112.log @@ -0,0 +1,3 @@ +22:27:04 class java.lang.NullPointerExceptionnull +22:28:50 class java.lang.NullPointerExceptionnull +22:31:39 class java.lang.NullPointerExceptionnull diff --git a/Common/build/classes/.netbeans_automatic_build b/JuderUI/log/info/20240112.log similarity index 100% rename from Common/build/classes/.netbeans_automatic_build rename to JuderUI/log/info/20240112.log diff --git a/JuderUI/src/gui/MainFrame.form b/JuderUI/src/gui/MainFrame.form index 5915b9f..8d55810 100644 --- a/JuderUI/src/gui/MainFrame.form +++ b/JuderUI/src/gui/MainFrame.form @@ -80,7 +80,9 @@ - + + + @@ -133,6 +135,7 @@ + @@ -515,6 +518,14 @@ + + + + + + + + diff --git a/JuderUI/src/gui/MainFrame.java b/JuderUI/src/gui/MainFrame.java index f065507..1e2625d 100644 --- a/JuderUI/src/gui/MainFrame.java +++ b/JuderUI/src/gui/MainFrame.java @@ -8,10 +8,13 @@ package gui; import cache.ProblemsCachManager; import common.Config; import common.FileFinder; +import common.LangSelector; import java.awt.Component; +import java.awt.Desktop; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; +import java.io.IOException; import javax.swing.JOptionPane; import javax.xml.namespace.QName; import share.gui.NewCompileSetting; @@ -88,7 +91,7 @@ public class MainFrame extends javax.swing.JFrame { jLabel5 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); - jComboBox1 = new javax.swing.JComboBox<>(); + jComboBox1 = new javax.swing.JComboBox(); threadManagerTabb = new javax.swing.JTabbedPane(); jPanel7 = new javax.swing.JPanel(); jLabel15 = new javax.swing.JLabel(); @@ -109,6 +112,7 @@ public class MainFrame extends javax.swing.JFrame { jLabel17 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); buttonCompilersConfig1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); @@ -145,7 +149,7 @@ public class MainFrame extends javax.swing.JFrame { jLabel7.setText("߳:"); - jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "1", "2", "3", "4" })); + jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4" })); jLabel15.setText("һϢ:"); @@ -267,6 +271,13 @@ public class MainFrame extends javax.swing.JFrame { } }); + jButton2.setText("鿴ļ"); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( @@ -279,6 +290,8 @@ public class MainFrame extends javax.swing.JFrame { .addComponent(buttonCompilersConfig) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(buttonCompilersConfig1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton2) .addGap(18, 18, 18) .addComponent(jLabel3) .addGap(0, 0, Short.MAX_VALUE) @@ -325,7 +338,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(buttonCompilersConfig1) + .addComponent(jButton2)) .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))) @@ -440,7 +454,7 @@ public class MainFrame extends javax.swing.JFrame { if (tmp == null || "".equals(tmp) || !FileFinder.isExistFile(tmp + File.separator + "gcc.exe") || !FileFinder.isExistFile(tmp + File.separator + "g++.exe")) { //ñ - JOptionPane.showMessageDialog(this, "Cñ"); + JOptionPane.showMessageDialog(this, "CԱ"); NewCompileSetting window = new NewCompileSetting("c", this, true); window.setVisible(true); return false; @@ -449,7 +463,7 @@ public class MainFrame extends javax.swing.JFrame { tmp = Config.getCompilerDir("java"); if (tmp == null || "".equals(tmp) || !FileFinder.isExistFile(tmp + File.separator + "javac.exe")) { - JOptionPane.showMessageDialog(this, "Javañ"); + JOptionPane.showMessageDialog(this, "Java"); NewCompileSetting window = new NewCompileSetting("java", this, true); window.setVisible(true); return false; @@ -477,6 +491,17 @@ public class MainFrame extends javax.swing.JFrame { javaConfig.setVisible(true); }//GEN-LAST:event_buttonCompilersConfig1ActionPerformed + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + Desktop desktop = Desktop.getDesktop(); + + try { + // ļ + desktop.open(new File(LangSelector.getConfigPath())); + } catch (IOException e) { + e.printStackTrace(); + } + }//GEN-LAST:event_jButton2ActionPerformed + private void loadConfig() { this.distributorIP.setText(Config.getValue("distributorIP")); this.distributorPort.setText(Config.getValue("distributorPort")); @@ -560,6 +585,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; private javax.swing.JCheckBox jCheckBox1; javax.swing.JComboBox jComboBox1; javax.swing.JLabel jLabel14; diff --git a/Judger/build/classes/.netbeans_automatic_build b/Judger/build/classes/.netbeans_automatic_build deleted file mode 100644 index e69de29..0000000 diff --git a/Judger/build/classes/.netbeans_update_resources b/Judger/build/classes/.netbeans_update_resources deleted file mode 100644 index e69de29..0000000 diff --git a/Judger/build/classes/kernel/ExeCommand$Kernel32.class b/Judger/build/classes/kernel/ExeCommand$Kernel32.class index 735daeb..a02dd88 100644 Binary files a/Judger/build/classes/kernel/ExeCommand$Kernel32.class and b/Judger/build/classes/kernel/ExeCommand$Kernel32.class differ diff --git a/Judger/build/classes/kernel/ExeCommand.class b/Judger/build/classes/kernel/ExeCommand.class index f1a9c31..e9924ab 100644 Binary files a/Judger/build/classes/kernel/ExeCommand.class and b/Judger/build/classes/kernel/ExeCommand.class differ diff --git a/Judger/build/classes/kernel/Judger.class b/Judger/build/classes/kernel/Judger.class index 03ab9c9..ca23e12 100644 Binary files a/Judger/build/classes/kernel/Judger.class and b/Judger/build/classes/kernel/Judger.class differ diff --git a/Judger/build/classes/kernel/LimitTime.class b/Judger/build/classes/kernel/LimitTime.class index 0022e29..44dc7bf 100644 Binary files a/Judger/build/classes/kernel/LimitTime.class and b/Judger/build/classes/kernel/LimitTime.class differ diff --git a/Judger/build/classes/kernel/ReadInfo.class b/Judger/build/classes/kernel/ReadInfo.class index 262f26d..7826ccd 100644 Binary files a/Judger/build/classes/kernel/ReadInfo.class and b/Judger/build/classes/kernel/ReadInfo.class differ diff --git a/Judger/build/classes/kernel/WriteInfo.class b/Judger/build/classes/kernel/WriteInfo.class index 6bdd291..ab0ce97 100644 Binary files a/Judger/build/classes/kernel/WriteInfo.class and b/Judger/build/classes/kernel/WriteInfo.class differ diff --git a/Judger/build/classes/main/Process.class b/Judger/build/classes/main/Process.class index 86d2d50..0c86854 100644 Binary files a/Judger/build/classes/main/Process.class and b/Judger/build/classes/main/Process.class differ diff --git a/Judger/build/classes/scripes/ChangeScore.class b/Judger/build/classes/scripes/ChangeScore.class index 3360861..a471524 100644 Binary files a/Judger/build/classes/scripes/ChangeScore.class and b/Judger/build/classes/scripes/ChangeScore.class differ diff --git a/Judger/build/classes/share/gui/CompilesInRegisty.class b/Judger/build/classes/share/gui/CompilesInRegisty.class index 7be6f8e..c89d45e 100644 Binary files a/Judger/build/classes/share/gui/CompilesInRegisty.class and b/Judger/build/classes/share/gui/CompilesInRegisty.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$1.class b/Judger/build/classes/share/gui/NewCompileSetting$1.class index 31c82d1..3d4d8d9 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$1.class and b/Judger/build/classes/share/gui/NewCompileSetting$1.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$10.class b/Judger/build/classes/share/gui/NewCompileSetting$10.class index 204fb34..031a652 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$10.class and b/Judger/build/classes/share/gui/NewCompileSetting$10.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$11.class b/Judger/build/classes/share/gui/NewCompileSetting$11.class index 8b70c0f..dbfc810 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$11.class and b/Judger/build/classes/share/gui/NewCompileSetting$11.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$12.class b/Judger/build/classes/share/gui/NewCompileSetting$12.class index 7338987..3f3ff8b 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$12.class and b/Judger/build/classes/share/gui/NewCompileSetting$12.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$13.class b/Judger/build/classes/share/gui/NewCompileSetting$13.class index 3b7dd69..889da0b 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$13.class and b/Judger/build/classes/share/gui/NewCompileSetting$13.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$14.class b/Judger/build/classes/share/gui/NewCompileSetting$14.class index caa2d4e..e257292 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$14.class and b/Judger/build/classes/share/gui/NewCompileSetting$14.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$15.class b/Judger/build/classes/share/gui/NewCompileSetting$15.class index b77502b..276ed41 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$15.class and b/Judger/build/classes/share/gui/NewCompileSetting$15.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$16$1.class b/Judger/build/classes/share/gui/NewCompileSetting$16$1.class index 4c7ffe6..117e673 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$16$1.class and b/Judger/build/classes/share/gui/NewCompileSetting$16$1.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$16.class b/Judger/build/classes/share/gui/NewCompileSetting$16.class index 484a67b..f7dd419 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$16.class and b/Judger/build/classes/share/gui/NewCompileSetting$16.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$2.class b/Judger/build/classes/share/gui/NewCompileSetting$2.class index 58ef4a5..41376da 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$2.class and b/Judger/build/classes/share/gui/NewCompileSetting$2.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$3.class b/Judger/build/classes/share/gui/NewCompileSetting$3.class index 5a5e928..a162d2e 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$3.class and b/Judger/build/classes/share/gui/NewCompileSetting$3.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$4.class b/Judger/build/classes/share/gui/NewCompileSetting$4.class index 7871b2e..20ceed8 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$4.class and b/Judger/build/classes/share/gui/NewCompileSetting$4.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$5.class b/Judger/build/classes/share/gui/NewCompileSetting$5.class index 1a6684f..bd9eba1 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$5.class and b/Judger/build/classes/share/gui/NewCompileSetting$5.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$6.class b/Judger/build/classes/share/gui/NewCompileSetting$6.class index d60b9e5..1a1ebe1 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$6.class and b/Judger/build/classes/share/gui/NewCompileSetting$6.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$7.class b/Judger/build/classes/share/gui/NewCompileSetting$7.class index 0ac1eda..9b71be8 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$7.class and b/Judger/build/classes/share/gui/NewCompileSetting$7.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$8.class b/Judger/build/classes/share/gui/NewCompileSetting$8.class index cb76096..b6e1db1 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$8.class and b/Judger/build/classes/share/gui/NewCompileSetting$8.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting$9.class b/Judger/build/classes/share/gui/NewCompileSetting$9.class index e20206d..9bebf4d 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting$9.class and b/Judger/build/classes/share/gui/NewCompileSetting$9.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting.class b/Judger/build/classes/share/gui/NewCompileSetting.class index 208586d..a05135f 100644 Binary files a/Judger/build/classes/share/gui/NewCompileSetting.class and b/Judger/build/classes/share/gui/NewCompileSetting.class differ diff --git a/Judger/build/classes/share/gui/NewCompileSetting.form b/Judger/build/classes/share/gui/NewCompileSetting.form deleted file mode 100644 index cee6d31..0000000 --- a/Judger/build/classes/share/gui/NewCompileSetting.form +++ /dev/null @@ -1,471 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Judger/build/classes/tool/ThreadTool.class b/Judger/build/classes/tool/ThreadTool.class index 143e6b2..ef15e9d 100644 Binary files a/Judger/build/classes/tool/ThreadTool.class and b/Judger/build/classes/tool/ThreadTool.class differ diff --git a/Judger/build/classes/tool/Tool.class b/Judger/build/classes/tool/Tool.class index ad70dff..56be82f 100644 Binary files a/Judger/build/classes/tool/Tool.class and b/Judger/build/classes/tool/Tool.class differ diff --git a/Judger/dist/Judger.jar b/Judger/dist/Judger.jar index f381eb5..5420095 100644 Binary files a/Judger/dist/Judger.jar and b/Judger/dist/Judger.jar differ diff --git a/Judger/dist/lib/Common.jar b/Judger/dist/lib/Common.jar index 4642743..5a645a5 100644 Binary files a/Judger/dist/lib/Common.jar and b/Judger/dist/lib/Common.jar differ diff --git a/Judger/src/kernel/Judger.java b/Judger/src/kernel/Judger.java index 37d7159..23be52d 100644 --- a/Judger/src/kernel/Judger.java +++ b/Judger/src/kernel/Judger.java @@ -120,7 +120,7 @@ public class Judger { } else if (language.equals("java")) { compileCommand += "\"" + Config.getCompilerDir(language) + File.separator + "javac\" " + sourceFile; //todoļ· } else if (language.equals("cpp")||language.equals("c++")) { - compileCommand += "\"" + Config.getCompilerDir(language) + File.separator + "g++\" -Wall -g -std=c++0x -c " + compileCommand += "\"" + Config.getCompilerDir(language) + File.separator + "g++\" -Wall -g -std=c++14 -c " + "\""+sourceFile+"\"" + " -o " + "\""+Config.getTargetPath()+ File.separator+"output"+ File.separator + "Main"+".o"+"\"\n"; } else { CompileInfo.info = "this programing language is not support!!!"; diff --git a/Judger/src/share/gui/NewCompileSetting.java b/Judger/src/share/gui/NewCompileSetting.java index ee89787..9ad0fdb 100644 --- a/Judger/src/share/gui/NewCompileSetting.java +++ b/Judger/src/share/gui/NewCompileSetting.java @@ -64,24 +64,20 @@ public class NewCompileSetting extends javax.swing.JDialog { private void saveConfig() { try { //radiobuttonѡжд - if (cSystem.isSelected()) { + if (cSystem.isSelected()||cRegistry.isSelected()||cSelf.isSelected()) { //·ΪԴ· Config.getProp().setProperty(Const.MinGWDir, Config.CompilerDir("c")); Config.getProp().setProperty(Const.MinGWRelative, "1"); - } else if (cRegistry.isSelected()) { Config.getProp().setProperty(Const.MinGWDir, lblCRegistryMessage.getText()); Config.getProp().setProperty(Const.MinGWRelative, "2"); - } else if (cSelf.isSelected()) { Config.getProp().setProperty(Const.MinGWDir, cDir.getText()); Config.getProp().setProperty(Const.MinGWRelative, "3"); } - if (javaSystem.isSelected()) { + if (javaSystem.isSelected()||javaRegistry.isSelected()||javaSelf.isSelected()) { Config.getProp().setProperty(Const.JavaCompilerDir, Config.CompilerDir("java")); Config.getProp().setProperty(Const.JavaRelative, "1"); - } else if (javaRegistry.isSelected()) { Config.getProp().setProperty(Const.JavaCompilerDir, lblJavaRegistryMessage.getText()); Config.getProp().setProperty(Const.JavaRelative, "2"); - } else if (javaSelf.isSelected()) { Config.getProp().setProperty(Const.JavaCompilerDir, javaDir.getText()); Config.getProp().setProperty(Const.JavaRelative, "3"); } diff --git a/clientUpdater/log/exception/20240112.log b/clientUpdater/log/exception/20240112.log new file mode 100644 index 0000000..af7df77 --- /dev/null +++ b/clientUpdater/log/exception/20240112.log @@ -0,0 +1,3 @@ +21:12:38 class java.net.ConnectExceptionConnection timed out: connect +21:12:59 class java.net.ConnectExceptionConnection timed out: connect +21:13:20 class java.net.ConnectExceptionConnection timed out: connect diff --git a/Common/build/classes/.netbeans_update_resources b/clientUpdater/log/info/20240112.log similarity index 100% rename from Common/build/classes/.netbeans_update_resources rename to clientUpdater/log/info/20240112.log diff --git a/config.xml b/config.xml new file mode 100644 index 0000000..e20b262 --- /dev/null +++ b/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