From b4f17edeaadbf2b1f4e24b958ef0e16fd0436e03 Mon Sep 17 00:00:00 2001 From: xiaoxuaaaaa <11044056+xiaoxuaaaaa@user.noreply.gitee.com> Date: Thu, 26 May 2022 09:08:47 +0000 Subject: [PATCH 01/12] add LICENSE. --- LICENSE | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ee58399 --- /dev/null +++ b/LICENSE @@ -0,0 +1,127 @@ + 木兰宽松许可证, 第2版 + + 木兰宽松许可证, 第2版 + 2020年1月 http://license.coscl.org.cn/MulanPSL2 + + + 您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束: + + 0. 定义 + + “软件”是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。 + + “贡献”是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。 + + “贡献者”是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。 + + “法人实体”是指提交贡献的机构及其“关联实体”。 + + “关联实体”是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。 + + 1. 授予版权许可 + + 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。 + + 2. 授予专利许可 + + 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。 + + 3. 无商标许可 + + “本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。 + + 4. 分发限制 + + 您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。 + + 5. 免责声明与责任限制 + + “软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。 + + 6. 语言 + “本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。 + + 条款结束 + + 如何将木兰宽松许可证,第2版,应用到您的软件 + + 如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步: + + 1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字; + + 2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中; + + 3, 请将如下声明文本放入每个源文件的头部注释中。 + + Copyright (c) [Year] [name of copyright holder] + [Software Name] is licensed under Mulan PSL v2. + You can use this software according to the terms and conditions of the Mulan PSL v2. + You may obtain a copy of Mulan PSL v2 at: + http://license.coscl.org.cn/MulanPSL2 + THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + See the Mulan PSL v2 for more details. + + + Mulan Permissive Software License,Version 2 + + Mulan Permissive Software License,Version 2 (Mulan PSL v2) + January 2020 http://license.coscl.org.cn/MulanPSL2 + + Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions: + + 0. Definition + + Software means the program and related documents which are licensed under this License and comprise all Contribution(s). + + Contribution means the copyrightable work licensed by a particular Contributor under this License. + + Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License. + + Legal Entity means the entity making a Contribution and all its Affiliates. + + Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity. + + 1. Grant of Copyright License + + Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not. + + 2. Grant of Patent License + + Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken. + + 3. No Trademark License + + No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4. + + 4. Distribution Restriction + + You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software. + + 5. Disclaimer of Warranty and Limitation of Liability + + THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + 6. Language + + THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL. + + END OF THE TERMS AND CONDITIONS + + How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software + + To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps: + + i Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner; + + ii Create a file named “LICENSE” which contains the whole context of this License in the first directory of your software package; + + iii Attach the statement to the appropriate annotated syntax at the beginning of each source file. + + + Copyright (c) [Year] [name of copyright holder] + [Software Name] is licensed under Mulan PSL v2. + You can use this software according to the terms and conditions of the Mulan PSL v2. + You may obtain a copy of Mulan PSL v2 at: + http://license.coscl.org.cn/MulanPSL2 + THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + See the Mulan PSL v2 for more details. -- Gitee From dd6f55358db80b36c0493c6aa006f612c33eedd7 Mon Sep 17 00:00:00 2001 From: xuwenhan <805208622@qq.com> Date: Thu, 26 May 2022 20:15:50 +0800 Subject: [PATCH 02/12] first commit --- .classpath | 10 --- .gitignore | 1 - .idea/.name | 1 + .idea/misc.xml | 6 ++ .idea/modules.xml | 8 ++ .idea/uiDesigner.xml | 124 ++++++++++++++++++++++++++ .idea/vcs.xml | 6 ++ .project | 17 ---- .settings/org.eclipse.jdt.core.prefs | 14 --- LICENSE | 127 --------------------------- java2022spring1.iml | 11 +++ readme.md | 2 - src/java2022spring/Test.java | 7 +- 13 files changed, 160 insertions(+), 174 deletions(-) delete mode 100644 .classpath delete mode 100644 .gitignore create mode 100644 .idea/.name create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/uiDesigner.xml create mode 100644 .idea/vcs.xml delete mode 100644 .project delete mode 100644 .settings/org.eclipse.jdt.core.prefs delete mode 100644 LICENSE create mode 100644 java2022spring1.iml delete mode 100644 readme.md diff --git a/.classpath b/.classpath deleted file mode 100644 index ac9ce57..0000000 --- a/.classpath +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ae3c172..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/bin/ diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..0e12420 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +java2022spring \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..0548357 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..1148eb3 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.project b/.project deleted file mode 100644 index b7e8a74..0000000 --- a/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - java2022spring - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index dbc27c5..0000000 --- a/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,14 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=17 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=17 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index ee58399..0000000 --- a/LICENSE +++ /dev/null @@ -1,127 +0,0 @@ - 木兰宽松许可证, 第2版 - - 木兰宽松许可证, 第2版 - 2020年1月 http://license.coscl.org.cn/MulanPSL2 - - - 您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束: - - 0. 定义 - - “软件”是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。 - - “贡献”是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。 - - “贡献者”是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。 - - “法人实体”是指提交贡献的机构及其“关联实体”。 - - “关联实体”是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。 - - 1. 授予版权许可 - - 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。 - - 2. 授予专利许可 - - 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。 - - 3. 无商标许可 - - “本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。 - - 4. 分发限制 - - 您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。 - - 5. 免责声明与责任限制 - - “软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。 - - 6. 语言 - “本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。 - - 条款结束 - - 如何将木兰宽松许可证,第2版,应用到您的软件 - - 如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步: - - 1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字; - - 2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中; - - 3, 请将如下声明文本放入每个源文件的头部注释中。 - - Copyright (c) [Year] [name of copyright holder] - [Software Name] is licensed under Mulan PSL v2. - You can use this software according to the terms and conditions of the Mulan PSL v2. - You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - See the Mulan PSL v2 for more details. - - - Mulan Permissive Software License,Version 2 - - Mulan Permissive Software License,Version 2 (Mulan PSL v2) - January 2020 http://license.coscl.org.cn/MulanPSL2 - - Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions: - - 0. Definition - - Software means the program and related documents which are licensed under this License and comprise all Contribution(s). - - Contribution means the copyrightable work licensed by a particular Contributor under this License. - - Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License. - - Legal Entity means the entity making a Contribution and all its Affiliates. - - Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity. - - 1. Grant of Copyright License - - Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not. - - 2. Grant of Patent License - - Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken. - - 3. No Trademark License - - No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4. - - 4. Distribution Restriction - - You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software. - - 5. Disclaimer of Warranty and Limitation of Liability - - THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - 6. Language - - THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL. - - END OF THE TERMS AND CONDITIONS - - How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software - - To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps: - - i Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner; - - ii Create a file named “LICENSE” which contains the whole context of this License in the first directory of your software package; - - iii Attach the statement to the appropriate annotated syntax at the beginning of each source file. - - - Copyright (c) [Year] [name of copyright holder] - [Software Name] is licensed under Mulan PSL v2. - You can use this software according to the terms and conditions of the Mulan PSL v2. - You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - See the Mulan PSL v2 for more details. diff --git a/java2022spring1.iml b/java2022spring1.iml new file mode 100644 index 0000000..e1006ff --- /dev/null +++ b/java2022spring1.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/readme.md b/readme.md deleted file mode 100644 index 4af16ad..0000000 --- a/readme.md +++ /dev/null @@ -1,2 +0,0 @@ -# ѧ -0103 \ No newline at end of file diff --git a/src/java2022spring/Test.java b/src/java2022spring/Test.java index 24deb29..04c733a 100644 --- a/src/java2022spring/Test.java +++ b/src/java2022spring/Test.java @@ -1,7 +1,8 @@ package java2022spring; public class Test { - public static void main(String[] args) { - System.out.println("Hello world!"); - } + public static void main(String[] args) { + System.out.println("Hello world!"); + //test commit + } } -- Gitee From 84e297313f25f6a563b7e352f224971de77ba843 Mon Sep 17 00:00:00 2001 From: xiaoxuaaaaa <11044056+xiaoxuaaaaa@user.noreply.gitee.com> Date: Thu, 26 May 2022 12:24:23 +0000 Subject: [PATCH 03/12] add LICENSE. --- LICENSE | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..29f81d8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. -- Gitee From 8736767ecd6ca4484bf506b226042f845cec6741 Mon Sep 17 00:00:00 2001 From: xuwenhan <805208622@qq.com> Date: Thu, 2 Jun 2022 17:29:07 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/java2022spring/Notepad.java | 56 +++++++++++++++++++++++++++++++++ src/java2022spring/Test.java | 8 ----- 2 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 src/java2022spring/Notepad.java delete mode 100644 src/java2022spring/Test.java diff --git a/src/java2022spring/Notepad.java b/src/java2022spring/Notepad.java new file mode 100644 index 0000000..a69793f --- /dev/null +++ b/src/java2022spring/Notepad.java @@ -0,0 +1,56 @@ +package java2022spring; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; + +public class Notepad implements ActionListener { + private JFrame frame = new JFrame("小许的记事本"); + private JTextArea textArea = new JTextArea(); + private JMenuBar menuBar = new JMenuBar(); + private int fonts = 20; + //菜单栏 + JMenu file,edit,view,help; + //“文件”的菜单项 + JMenuItem New,Open,Save,SaveAs,Exit; + //“编辑”的菜单项 + JMenuItem Undo,Cut,Copy,Paste,Delete; + //“格式”的菜单栏 + JMenuItem WordWrap; + //“查看”的菜单项 + JMenuItem StatusBar; + //“帮助”的菜单项 + JMenuItem check,about; + public Notepad() { + //菜单栏内容 + file = new JMenu("文件(F)"); + edit = new JMenu("编辑(E)"); + view = new JMenu("查看(V)"); + help = new JMenu("帮助(H)"); + + menuBar.add(file); + menuBar.add(edit); + menuBar.add(view); + menuBar.add(help); + + textArea.requestFocus(); + frame.setJMenuBar(menuBar); + + textArea.setLineWrap(true); + JScrollPane scrollPane = new JScrollPane(textArea); + frame.add(scrollPane); + + frame.setSize(800, 600); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + @Override + public void actionPerformed(ActionEvent e) { + + } + + public static void main(String[] args) { + Notepad myNote = new Notepad(); + } +} diff --git a/src/java2022spring/Test.java b/src/java2022spring/Test.java deleted file mode 100644 index 04c733a..0000000 --- a/src/java2022spring/Test.java +++ /dev/null @@ -1,8 +0,0 @@ -package java2022spring; - -public class Test { - public static void main(String[] args) { - System.out.println("Hello world!"); - //test commit - } -} -- Gitee From 35b725c750f5e37f6d62f7162d4661f3867a347e Mon Sep 17 00:00:00 2001 From: xuwenhan <805208622@qq.com> Date: Sun, 5 Jun 2022 20:55:49 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E7=9A=84=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/java2022spring/Notepad.java | 91 ++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/src/java2022spring/Notepad.java b/src/java2022spring/Notepad.java index a69793f..25a932b 100644 --- a/src/java2022spring/Notepad.java +++ b/src/java2022spring/Notepad.java @@ -3,6 +3,9 @@ package java2022spring; import java.awt.*; import java.awt.event.*; import javax.swing.*; +import java.io.*; +import javax.swing.filechooser.FileFilter; +import javax.swing.undo.UndoManager; public class Notepad implements ActionListener { private JFrame frame = new JFrame("小许的记事本"); @@ -10,7 +13,7 @@ public class Notepad implements ActionListener { private JMenuBar menuBar = new JMenuBar(); private int fonts = 20; //菜单栏 - JMenu file,edit,view,help; + JMenu file,edit,layout,view,help; //“文件”的菜单项 JMenuItem New,Open,Save,SaveAs,Exit; //“编辑”的菜单项 @@ -20,11 +23,12 @@ public class Notepad implements ActionListener { //“查看”的菜单项 JMenuItem StatusBar; //“帮助”的菜单项 - JMenuItem check,about; + JMenuItem Check,About; public Notepad() { //菜单栏内容 file = new JMenu("文件(F)"); edit = new JMenu("编辑(E)"); + layout = new JMenu("格式(O)"); view = new JMenu("查看(V)"); help = new JMenu("帮助(H)"); @@ -50,7 +54,90 @@ public class Notepad implements ActionListener { } + private void frameSetting() { + // 文件菜单 + file.setMnemonic('F');// 设置快捷键ALT+F + New = new JMenuItem("新建"); + New.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, 2)); + New.addActionListener(this); + Open = new JMenuItem("打开..."); + Open.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, 2)); + Open.addActionListener(this); + Save = new JMenuItem("保存"); + Save.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, 2)); + Save.addActionListener(this); + SaveAs = new JMenuItem("另存为..."); + SaveAs.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, 3)); + SaveAs.addActionListener(this); + Exit = new JMenuItem("退出"); + Exit.addActionListener(this); + // 编辑菜单 + edit.setMnemonic('E');// 设置快捷键ALT+E + Undo = new JMenuItem("撤销"); + Undo.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, 2)); + Undo.addActionListener(this); + Cut = new JMenuItem("剪切"); + Cut.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, 2)); + Cut.addActionListener(this); + Copy = new JMenuItem("复制"); + Copy.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, 2)); + Copy.addActionListener(this); + Paste = new JMenuItem("粘贴"); + Paste.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, 2)); + Paste.addActionListener(this); + Delete = new JMenuItem("删除"); + Delete.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)); + Delete.addActionListener(this); + // 格式菜单 + layout.setMnemonic('O');// 设置快捷键ALT+O + WordWrap = new JMenuItem("自动换行"); + WordWrap.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, 2)); + WordWrap.addActionListener(this); + // 查看菜单 + view.setMnemonic('V');// 设置快捷键ALT+V + StatusBar = new JMenuItem("状态栏"); + StatusBar.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, 2)); + StatusBar.addActionListener(this); + // 帮助菜单 + help.setMnemonic('H');// 设置快捷键ALT+H + Check = new JMenuItem("查看帮助"); + Check.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, 3)); + Check.addActionListener(this); + About = new JMenuItem("关于"); + About.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, 3)); + About.addActionListener(this); + //添加到菜单 + file.add(New); + file.addSeparator(); + file.add(Open); + file.add(Save); + file.add(SaveAs); + file.addSeparator(); + file.add(Exit); + + edit.add(Undo); + edit.addSeparator(); + edit.add(Cut); + edit.add(Copy); + edit.add(Paste); + edit.add(Delete); + + layout.add(WordWrap); + + view.add(StatusBar); + + help.add(Check); + help.add(About); + } + + public static void main(String[] args) { Notepad myNote = new Notepad(); + myNote.frame.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { +// myNote.Exit(); + } + }); } } + -- Gitee From d1d1ce3ec43f3cb45b7272b8324a2f85eee16c35 Mon Sep 17 00:00:00 2001 From: xuwenhan <805208622@qq.com> Date: Wed, 8 Jun 2022 16:05:07 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=92=8C=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E9=80=BB=E8=BE=91=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/java2022spring/Notepad.java | 237 +++++++++++++++++++++++++++----- 1 file changed, 202 insertions(+), 35 deletions(-) diff --git a/src/java2022spring/Notepad.java b/src/java2022spring/Notepad.java index 25a932b..5ff860a 100644 --- a/src/java2022spring/Notepad.java +++ b/src/java2022spring/Notepad.java @@ -2,53 +2,73 @@ package java2022spring; import java.awt.*; import java.awt.event.*; -import javax.swing.*; import java.io.*; +import javax.swing.*; +import javax.swing.event.CaretEvent; +import javax.swing.event.CaretListener; import javax.swing.filechooser.FileFilter; -import javax.swing.undo.UndoManager; public class Notepad implements ActionListener { private JFrame frame = new JFrame("小许的记事本"); private JTextArea textArea = new JTextArea(); private JMenuBar menuBar = new JMenuBar(); private int fonts = 20; - //菜单栏 - JMenu file,edit,layout,view,help; + private boolean flag = true; + private boolean autoLineFlag = true; + private boolean bottomFlag = true; + private String txt = ""; + private File f; + private String encoding = "UTF-8"; + private String res = ""; // 命令行界面的输出结果参数 + //菜单栏内容 + JMenu file, edit, view, help, out; //“文件”的菜单项 - JMenuItem New,Open,Save,SaveAs,Exit; + JMenuItem New, Open, Save, SaveAs, Exit; //“编辑”的菜单项 - JMenuItem Undo,Cut,Copy,Paste,Delete; - //“格式”的菜单栏 - JMenuItem WordWrap; - //“查看”的菜单项 - JMenuItem StatusBar; + JMenuItem Undo, Redo, Cut, Copy, Paste, Delete, All; + //“格式”的菜单项 + JMenuItem autoLine; + //查看 菜单栏 + JMenuItem showBar; //“帮助”的菜单项 - JMenuItem Check,About; + JMenuItem About; + + JLabel statistic; + JToolBar bottomBar; + + public Notepad() { - //菜单栏内容 + // 菜单栏内容 file = new JMenu("文件(F)"); edit = new JMenu("编辑(E)"); - layout = new JMenu("格式(O)"); + out = new JMenu("格式(O)"); view = new JMenu("查看(V)"); help = new JMenu("帮助(H)"); + frameSetting(); + menuBar.add(file); menuBar.add(edit); + menuBar.add(out); menuBar.add(view); menuBar.add(help); + //窗口排布 textArea.requestFocus(); frame.setJMenuBar(menuBar); - - textArea.setLineWrap(true); - JScrollPane scrollPane = new JScrollPane(textArea); - frame.add(scrollPane); - + // 文字编辑界面的设置 + textArea.setLineWrap(autoLineFlag); + autoLine.setText(autoLineFlag ? "√ 自动换行" : "× 自动换行"); + JScrollPane jsp = new JScrollPane(textArea); + textArea.setFont(new Font("宋体", Font.PLAIN, fonts)); + //窗口运行设置 frame.setSize(800, 600); frame.setLocationRelativeTo(null); frame.setVisible(true); + frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); } + @Override public void actionPerformed(ActionEvent e) { @@ -76,6 +96,9 @@ public class Notepad implements ActionListener { Undo = new JMenuItem("撤销"); Undo.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, 2)); Undo.addActionListener(this); + Redo = new JMenuItem("重做"); + Redo.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, 2)); + Redo.addActionListener(this); Cut = new JMenuItem("剪切"); Cut.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, 2)); Cut.addActionListener(this); @@ -88,25 +111,26 @@ public class Notepad implements ActionListener { Delete = new JMenuItem("删除"); Delete.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)); Delete.addActionListener(this); + All = new JMenuItem("全选"); + All.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, 2)); + All.addActionListener(this); // 格式菜单 - layout.setMnemonic('O');// 设置快捷键ALT+O - WordWrap = new JMenuItem("自动换行"); - WordWrap.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, 2)); - WordWrap.addActionListener(this); + out.setMnemonic('O');// 设置快捷键ALT+O + autoLine = new JMenuItem("自动换行"); + autoLine.addActionListener(e -> { + autoLineFlag = !autoLineFlag; + textArea.setLineWrap(autoLineFlag); + autoLine.setText(autoLineFlag ? "√ 自动换行" : "× 自动换行"); + }); // 查看菜单 view.setMnemonic('V');// 设置快捷键ALT+V - StatusBar = new JMenuItem("状态栏"); - StatusBar.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, 2)); - StatusBar.addActionListener(this); + // 帮助菜单 help.setMnemonic('H');// 设置快捷键ALT+H - Check = new JMenuItem("查看帮助"); - Check.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, 3)); - Check.addActionListener(this); About = new JMenuItem("关于"); About.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, 3)); About.addActionListener(this); - //添加到菜单 + // 添加到菜单 file.add(New); file.addSeparator(); file.add(Open); @@ -116,28 +140,171 @@ public class Notepad implements ActionListener { file.add(Exit); edit.add(Undo); + edit.add(Redo); edit.addSeparator(); edit.add(Cut); edit.add(Copy); edit.add(Paste); edit.add(Delete); + edit.add(All); - layout.add(WordWrap); + out.add(autoLine); - view.add(StatusBar); + view.add(showBar); - help.add(Check); help.add(About); } + public void write() { + if (f.exists()) { + int i = JOptionPane.showConfirmDialog(null, "此位置已出现重名文件,是否保存该文件并删除之前文件", "确认保存", JOptionPane.YES_NO_OPTION); + if (i == JOptionPane.OK_OPTION) { + try { + if (encoding.equals("UTF-8")) { + BufferedWriter fos = new BufferedWriter( + new OutputStreamWriter(new FileOutputStream(f), encoding)); + System.out.println("已成功删除已有文件并保持当前文件"); + fos.write(textArea.getText()); + System.out.println("22222"); + fos.close(); + } else { + Writer fos = new OutputStreamWriter(new FileOutputStream(f, false), "GB2312"); + System.out.println("已成功删除已有文件并保持当前文件"); + fos.write(textArea.getText()); + fos.close(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } else + try { + if (encoding.equals("UTF-8")) { + BufferedWriter fos = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f), encoding)); + System.out.println("已成功删除已有文件并保持当前文件"); + fos.write(textArea.getText()); + System.out.println("22222"); + fos.close(); + } else { + Writer fos = new OutputStreamWriter(new FileOutputStream(f, false), "GB2312"); + System.out.println("已成功删除已有文件并保持当前文件"); + fos.write(textArea.getText()); + fos.close(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void Exit() { + String tst = new String(textArea.getText()); + if (!flag) { + if (txt.equals(tst)) { + } else { + int i = JOptionPane.showConfirmDialog(null, "是否保存您所做的更改?点击“否”将直接退出不做更改!", "确认保存", + JOptionPane.YES_NO_CANCEL_OPTION); + if (i == JOptionPane.OK_OPTION) { + write(); + } else if (i == JOptionPane.NO_OPTION) { + System.exit(0); + } + } + } else { + if (txt.equals(tst)) { + System.exit(0); + } else { + int i = JOptionPane.showConfirmDialog(null, "是否保存您所做的更改?点击“否”将直接退出不做更改!", "确认保存", + JOptionPane.YES_NO_CANCEL_OPTION); + if (i == JOptionPane.OK_OPTION) { + SaveF rep = new SaveF(); + f = rep.f; + write(); + } else if (i == JOptionPane.NO_OPTION) { + System.exit(0); + } + } + } + } + public static void main(String[] args) { - Notepad myNote = new Notepad(); - myNote.frame.addWindowListener(new WindowAdapter() { + Notepad note = new Notepad(); + note.frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { -// myNote.Exit(); + note.Exit(); } }); } + } +class T1 extends FileFilter { + String ends; + String description; + + public T1(String ends, String description) { + this.ends = ends; + this.description = description; + } + + @Override + + public boolean accept(File file) { + if (file.isDirectory()) + return true; + String fileName = file.getName(); + if (fileName.toUpperCase().endsWith(this.ends.toUpperCase())) + return true; + return false; + } + + @Override + + public String getDescription() { + if (this.description == "所有文件") + this.description = "文件"; + return this.description; + } + + + public String getEnds() { + return this.ends; + } +} + +class SaveF { // 保存文件类 + File f; + JFileChooser rep = new JFileChooser("%homepath%"); + T1 txtFilter = new T1(".txt", "文件文档 (*.txt)"); + T1 txtFilter1 = new T1(".ini", "配置文件 (*.ini)"); + + SaveF() { + rep.addChoosableFileFilter(txtFilter); + rep.addChoosableFileFilter(txtFilter1); + int returnVal = rep.showDialog(null, "保存"); + if (returnVal == JFileChooser.APPROVE_OPTION) { // 在文件选择后再执行保存命令 + if (!(rep.getFileFilter().getDescription() == "所有文件")) { + File file = rep.getSelectedFile(); // 获得文件名 + // 获得被选中的过滤器 + T1 filter = (T1) rep.getFileFilter(); + // 获得过滤器的扩展名 + String ends = filter.getEnds(); + File newFile = null; + if (file.getAbsolutePath().toUpperCase().endsWith(ends.toUpperCase())) { + // 如果文件是以选定扩展名结束的,则使用原名 + newFile = file; + System.out.println("保存路径:" + newFile.getAbsolutePath()); + f = new File(newFile.getAbsolutePath()); + } else { + // 否则加上选定的扩展名 + newFile = new File(file.getAbsolutePath() + ends); + System.out.println("保存路径:" + newFile.getAbsolutePath()); + f = new File(newFile.getAbsolutePath()); + } + } else { + f = rep.getSelectedFile(); + System.out.println("保存路径:" + f); + } + } + } +} \ No newline at end of file -- Gitee From 8aac8a83f8908fb6052e144201e12c484814b2f1 Mon Sep 17 00:00:00 2001 From: xuwenhan <805208622@qq.com> Date: Wed, 8 Jun 2022 18:35:54 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=A0=8F=E5=92=8C=E6=A0=BC=E5=BC=8F=E5=8A=9F=E8=83=BD=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/java2022spring/Notepad.java | 157 ++++++++++++++++++++++++++++---- 1 file changed, 138 insertions(+), 19 deletions(-) diff --git a/src/java2022spring/Notepad.java b/src/java2022spring/Notepad.java index 5ff860a..c65c0ff 100644 --- a/src/java2022spring/Notepad.java +++ b/src/java2022spring/Notepad.java @@ -7,6 +7,7 @@ import javax.swing.*; import javax.swing.event.CaretEvent; import javax.swing.event.CaretListener; import javax.swing.filechooser.FileFilter; +import javax.swing.undo.UndoManager; public class Notepad implements ActionListener { private JFrame frame = new JFrame("小许的记事本"); @@ -19,7 +20,9 @@ public class Notepad implements ActionListener { private String txt = ""; private File f; private String encoding = "UTF-8"; - private String res = ""; // 命令行界面的输出结果参数 + private String res = ""; // 命令行界面 + private String value; + UndoManager undoManager = new UndoManager(); //菜单栏内容 JMenu file, edit, view, help, out; //“文件”的菜单项 @@ -44,34 +47,107 @@ public class Notepad implements ActionListener { out = new JMenu("格式(O)"); view = new JMenu("查看(V)"); help = new JMenu("帮助(H)"); - frameSetting(); - menuBar.add(file); menuBar.add(edit); menuBar.add(out); menuBar.add(view); menuBar.add(help); - //窗口排布 textArea.requestFocus(); frame.setJMenuBar(menuBar); // 文字编辑界面的设置 textArea.setLineWrap(autoLineFlag); autoLine.setText(autoLineFlag ? "√ 自动换行" : "× 自动换行"); - JScrollPane jsp = new JScrollPane(textArea); + JScrollPane jsp = new JScrollPane(textArea);// 滚动窗口面板 + frame.add(jsp); textArea.setFont(new Font("宋体", Font.PLAIN, fonts)); - //窗口运行设置 frame.setSize(800, 600); frame.setLocationRelativeTo(null); frame.setVisible(true); - frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);// 意思是关闭按钮失效 } @Override public void actionPerformed(ActionEvent e) { - + String commamd = e.getActionCommand(); + System.out.println("执行的命令->" + commamd); + // “新建”功能 + if ("新建".equals(commamd)) { + String tst = new String(textArea.getText()); + if (!flag) { + if (txt.equals(tst)) { + flag = true; + NewFile(); + } else { + int i = JOptionPane.showConfirmDialog(null, "是否保存您所做的更改?点击“否”将直接退出不做更改!", "确认保存", + JOptionPane.YES_NO_CANCEL_OPTION); + if (i == JOptionPane.OK_OPTION) { + write(); + flag = true; + NewFile(); + } else if (i == JOptionPane.NO_OPTION) { + flag = true; + NewFile(); + } + } + } else { + if (txt.equals(tst)) { + flag = true; + NewFile(); + } else { + int i = JOptionPane.showConfirmDialog(null, "是否保存您所做的更改?点击“否”将直接退出不做更改!", "确认保存", + JOptionPane.YES_NO_CANCEL_OPTION); + if (i == JOptionPane.OK_OPTION) { + SaveF rep = new SaveF(); + f = rep.f; + flag = true; + write(); + NewFile(); + } else if (i == JOptionPane.NO_OPTION) { + flag = true; + NewFile(); + } + } + } + // “打开”功能 + } else if ("打开...".equals(commamd)) { + JFileChooser rep = new JFileChooser("%homepath%"); + rep.setDialogType(JFileChooser.OPEN_DIALOG); + int returnVal = rep.showOpenDialog(null); + if (returnVal == JFileChooser.APPROVE_OPTION) { + f = rep.getSelectedFile(); + frame.setTitle(f.getName()); + encoding = "UTF-8"; + try { + res = read("UTF-8"); + } catch (IOException e1) { + e1.printStackTrace(); + } + flag = false; + value = res; + textArea.setText(res); + txt = textArea.getText(); + } + // “保存”功能 + } else if ("保存".equals(commamd)) { + if (flag) { + SaveF rep = new SaveF(); + f = rep.f; + flag = false; + } + write(); + frame.setTitle(f.getName()); + txt = textArea.getText(); + // “另存为”功能 + } else if ("另存为...".equals(commamd)) { + SaveF rep = new SaveF(); + f = rep.f; + flag = false; + write(); + frame.setTitle(f.getName()); + } } private void frameSetting() { @@ -124,7 +200,12 @@ public class Notepad implements ActionListener { }); // 查看菜单 view.setMnemonic('V');// 设置快捷键ALT+V - + showBar = new JMenuItem(bottomFlag ? "√ 统计状态栏" : "× 统计状态栏"); + showBar.addActionListener(e -> { + bottomFlag = !bottomFlag; + bottomBar.setVisible(bottomFlag); + showBar.setText(bottomFlag ? "√ 统计状态栏" : "× 统计状态栏"); + }); // 帮助菜单 help.setMnemonic('H');// 设置快捷键ALT+H About = new JMenuItem("关于"); @@ -153,8 +234,41 @@ public class Notepad implements ActionListener { view.add(showBar); help.add(About); + } + // 读取命令 + public String read() { // ANSI读取 + String temp = ""; + try { + FileInputStream fis = new FileInputStream(f.getAbsolutePath()); + byte[] b = new byte[1024]; + while (true) { + int num = fis.read(b); + if (num == -1) + break; + temp = temp + new String(b, 0, num); + } + fis.close(); + } catch (Exception e1) { + e1.printStackTrace(); + } + return temp; + } + + @SuppressWarnings("resource") + public String read(String encoding) throws IOException { // UTF-8读取 + File file = new File(f.getAbsolutePath()); + String message = "";// 获取文件内容 + if (file.isFile() && file.exists()) { + BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding)); + String buff; + while ((buff = br.readLine()) != null) { + message = message + buff + "\n"; + } + } + return message; + } public void write() { if (f.exists()) { @@ -197,10 +311,23 @@ public class Notepad implements ActionListener { } } + // 新建命令 + public void NewFile() { + frame.dispose(); + Notepad note = new Notepad(); + // 关闭的时候询问是否保存文件 + note.frame.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { + note.Exit(); + } + }); + } + public void Exit() { String tst = new String(textArea.getText()); if (!flag) { if (txt.equals(tst)) { + System.exit(0); } else { int i = JOptionPane.showConfirmDialog(null, "是否保存您所做的更改?点击“否”将直接退出不做更改!", "确认保存", JOptionPane.YES_NO_CANCEL_OPTION); @@ -248,7 +375,6 @@ class T1 extends FileFilter { } @Override - public boolean accept(File file) { if (file.isDirectory()) return true; @@ -259,14 +385,11 @@ class T1 extends FileFilter { } @Override - public String getDescription() { if (this.description == "所有文件") this.description = "文件"; return this.description; } - - public String getEnds() { return this.ends; } @@ -282,21 +405,17 @@ class SaveF { // 保存文件类 rep.addChoosableFileFilter(txtFilter); rep.addChoosableFileFilter(txtFilter1); int returnVal = rep.showDialog(null, "保存"); - if (returnVal == JFileChooser.APPROVE_OPTION) { // 在文件选择后再执行保存命令 + if (returnVal == JFileChooser.APPROVE_OPTION) { if (!(rep.getFileFilter().getDescription() == "所有文件")) { - File file = rep.getSelectedFile(); // 获得文件名 - // 获得被选中的过滤器 + File file = rep.getSelectedFile(); T1 filter = (T1) rep.getFileFilter(); - // 获得过滤器的扩展名 String ends = filter.getEnds(); File newFile = null; if (file.getAbsolutePath().toUpperCase().endsWith(ends.toUpperCase())) { - // 如果文件是以选定扩展名结束的,则使用原名 newFile = file; System.out.println("保存路径:" + newFile.getAbsolutePath()); f = new File(newFile.getAbsolutePath()); } else { - // 否则加上选定的扩展名 newFile = new File(file.getAbsolutePath() + ends); System.out.println("保存路径:" + newFile.getAbsolutePath()); f = new File(newFile.getAbsolutePath()); -- Gitee From a5566be60bcc0f46b77a0226be72ec9a7339306e Mon Sep 17 00:00:00 2001 From: xuwenhan <805208622@qq.com> Date: Wed, 8 Jun 2022 21:54:05 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=A0=8F=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=92=8C=E5=B8=AE=E5=8A=A9=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/java2022spring/Notepad.java | 38 ++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/java2022spring/Notepad.java b/src/java2022spring/Notepad.java index c65c0ff..8d533ed 100644 --- a/src/java2022spring/Notepad.java +++ b/src/java2022spring/Notepad.java @@ -65,7 +65,31 @@ public class Notepad implements ActionListener { frame.setSize(800, 600); frame.setLocationRelativeTo(null); frame.setVisible(true); - frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);// 意思是关闭按钮失效 + frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + + statistic = new JLabel("共 0 行,共 0 列, 字数: 0"); + statistic.setFont(new Font("黑体", 0, 15)); + bottomBar = new JToolBar(); + bottomBar.add(statistic); + bottomBar.setFloatable(false); + frame.getContentPane().add(bottomBar, BorderLayout.SOUTH); + + + textArea.addCaretListener(new CaretListener() { + @Override + public void caretUpdate(CaretEvent e) { + try { + int len = textArea.getDocument().getLength(); + int offset = e.getDot() ; + int row = textArea.getLineOfOffset(offset); + int col = e.getDot() - textArea.getLineStartOffset(row); + statistic.setText(String.format("第 %d 行,第 %d 列, 字数: %d",row+1, col+1, len)); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }); + } @@ -147,6 +171,18 @@ public class Notepad implements ActionListener { flag = false; write(); frame.setTitle(f.getName()); + // “关于”功能 + }else if ("关于".equals(commamd)) { + JDialog dia = new JDialog(frame, "关于Notepad- -"); + dia.setSize(250, 160); + dia.setResizable(false); + JLabel l = new JLabel( + " 记事本
 许文瀚的设计性实验作业
 部分代码参考自网络
  "); + l.setFont(new Font("微软雅黑", Font.BOLD, 15)); + dia.add(l, BorderLayout.CENTER); + dia.setLocationRelativeTo(null); + dia.setVisible(true); + dia.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); } } -- Gitee From a69f4164bf2abb6e0016096bde45d5ca9729df88 Mon Sep 17 00:00:00 2001 From: xuwenhan <805208622@qq.com> Date: Wed, 8 Jun 2022 21:54:27 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=A0=8F=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=92=8C=E5=B8=AE=E5=8A=A9=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 170 ++++++++++++++++++ .../java2022spring/Notepad$1.class | Bin 0 -> 1666 bytes .../java2022spring/Notepad$2.class | Bin 0 -> 731 bytes .../java2022spring/Notepad$3.class | Bin 0 -> 687 bytes .../java2022spring/Notepad.class | Bin 0 -> 12147 bytes .../java2022spring/SaveF.class | Bin 0 -> 2116 bytes .../java2022spring1/java2022spring/T1.class | Bin 0 -> 1068 bytes 7 files changed, 170 insertions(+) create mode 100644 .idea/workspace.xml create mode 100644 out/production/java2022spring1/java2022spring/Notepad$1.class create mode 100644 out/production/java2022spring1/java2022spring/Notepad$2.class create mode 100644 out/production/java2022spring1/java2022spring/Notepad$3.class create mode 100644 out/production/java2022spring1/java2022spring/Notepad.class create mode 100644 out/production/java2022spring1/java2022spring/SaveF.class create mode 100644 out/production/java2022spring1/java2022spring/T1.class diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..3ecc273 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1653567046270 + + + 1653567351085 + + + 1654162147261 + + + 1654433749753 + + + 1654675507306 + + + 1654684554397 + + + 1654696445715 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/out/production/java2022spring1/java2022spring/Notepad$1.class b/out/production/java2022spring1/java2022spring/Notepad$1.class new file mode 100644 index 0000000000000000000000000000000000000000..2fdc6de18746ebab33f185518fbe004362961360 GIT binary patch literal 1666 zcmZ`)+fy4=9R5z&uw>cFr49B1ZK~9AsRXb^Yg!a3ZNUKAP%5pLE}N6E?Xt^k4wOH^ zhrT+U@y#b++8H}jBRbVT!2hG_TOWOM{LXHQ!GX-|+4H-9zuV^be}4H5zgGn- zQS^E`0kfU2J1+snnz*D+(X*bVFYtCAS5#amc*y z(8sxE28<>c<76y5FoeLNl5*Vp^Ug+`6^koimBP))l~+BTy4|Sah%PQ`GZVOe zSR>wfsn)`>iK{lUxMt%pj@Y=4Src>Fn;%|2|CR~@ojP`s-{R^$=_(VqYTW4)+{HD{$NuBdKPGTWi}oo}(W@!R?h5qmZ_GXn=r&o7>&hC( zaFl~McJPqx>BiiW+*VVObl9tGGlE?KC#EXZmC)T>=RgSb4Giw_py(j~N=z@un!W51 z3S{W1D1)k6i$QaudYiTXKYbjyI5eYnXiKidVr8*0g2uq?ARTl!1RSAAy^>{W%2BMF z=L#IzgLbaytV*9SyL8~BpR<9IRb60n%keiEf~BVO*lv#o&6>ubr1XXpVVOM#jAu`xh2!WYMg7p=S^~XsN^a8EJvb!*#SyHkf^Nm=lKPG#FW9$&bMf*xi z)-dkwz%H#A*>vNU?$wMP9IE5B@6k4Yu8z*9F-8{^et=t`QNM)@&l~7OiFq#J4es^@ zEW^bLwQixxHNB79aaPxfSnHi)rBc*hz-iuEXfwqp2ZNR)c$2p@?F{teOk4+lw+=qz noh60=#>^n~H!3Cu4Z0X2BZXm{K|^Z~p!TI$WIK literal 0 HcmV?d00001 diff --git a/out/production/java2022spring1/java2022spring/Notepad$2.class b/out/production/java2022spring1/java2022spring/Notepad$2.class new file mode 100644 index 0000000000000000000000000000000000000000..9700479e93637f500541b3a314406fcb1cd5f5b8 GIT binary patch literal 731 zcmZ`%T~8B16g|_H?y@Yl6a_>Sgf*$fShD&CA)2NpCbcgb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Vnd48Mu`1;(* zKQ5h9F^Ll@UJ+BTs(1|}Oz3E5YfMEgwh8Ja-(p1|ocs{h+-B<;9ML1}^AeGpZ$eq! z--|#BY+DX_Ze+O@jXGs51t$sS&#AJkiN&N2@lnJrf2U1cSV+ix>6kguW@vG9m{6Z( z)+VfAt2vf56MDi5<=~c*8`hFG$yNLq%O;7Di9 zFU=u0LJ8x-I^WLHqv8z*dJ%a0Nl+Nn?zEl2_YS7bc*fFuxvB}PEb~w@si#`CG%I_h zI}aOjkTW|+mM8L9+S0jH^UVxrxXg_c)An*dTbyNG8)Fv>HMXCK5*l*k)s5NGOJxg_ z6}^_ZSSqE91-QgCzZddiS#gfeGShC!h5p$zzouLHWd}U`aWV44caCUs`+M4pL1 zek6Df0(qNJ!0$IG6qo@8W|24G&!2&38U?&59PlfC?+l8j;d8gE{Hn7p4oop(3O*aF zv&-V_lKdq$*6iMJ4mae)##$SGf9ZLA>TcI{WyM!f*xg{Gti?ku1v_k%+gM-e;lW15 z+t{_ErQj1(&Z25y1{?f$*w|Rf#u&8G#wHt^*`ewIM>K;wr?KS&^oS&@;M&_L_5{z6 z|7|W1$U4l%S9rn)TWs9rI&y&nnvb144x)lX`58Pkg|#$|YO)ce&(T5`(N44IrAz3e z%ZSh%M(GO1=_-!X7nr0kafZIaS(?WM`Wo}}4Su0-`A6^_t)U;Nlzya5^b@tv&uC(v zJ)E*poJTV!IuGMGhr2no`8bZV{Exqvi(nFGu!~O%B(=B?_p??ne#Zl7;lzh{R}0Tg i%%f1jZc^}|f;|cz;stOM2azXYE{|G9Kg{Sn?EMSPhA@o) literal 0 HcmV?d00001 diff --git a/out/production/java2022spring1/java2022spring/T1.class b/out/production/java2022spring1/java2022spring/T1.class new file mode 100644 index 0000000000000000000000000000000000000000..06db0a0850a0f38f0ceda5486487450b959d354b GIT binary patch literal 1068 zcmZuvTTc@~6#h`rVpzjT4I_k@s8@YLe)@)a%QR|cec6}`JiER;PRLY+Z+W&G*iN00 zxM0`q;38qLxW9RSrL@4{6HZkSa?^HQ%&x6232)w9s&OSh?O0}Q!SrmIhs9X1VzZQX zg;g1?RD4$oG3LiuOTx4);Rb}Zkll8SDZ3`dON-2NomYfxQ^n2>At~##<|^;C%mt=( zbH;QPnFfQ~mqjqS*I`GowBH9oJvP~F}wL6A?Th2k6 zu~r<%7oM`tG6LZdTK~N|LbNEyud9u49DJR&KWTfy3LNjQYT?OAZ_NQ^0_TeB3U9*n z*<4aSi>r39Lg@U@b(a>=$L}k{k1oO=+vW)AoMQ}p%<}=zBgAL}DSC`7JwZFy`g|i}=iN1BvoyMEKW$rs~m6hKMTaZX}rc88mv%)GwI&C3@)<`swu^358t=1sud7 zCd{&=ZYAL`W2F#D{X&<9BfNDKJ)xq@N+Hm}{Ly^!4N~QNik-{!;?kT%YtAwui}Ya+N<2g%^r^1?KR8Cxj{pDw literal 0 HcmV?d00001 -- Gitee From 911385e2c4e83f83ca867c6d801448ef860baadb Mon Sep 17 00:00:00 2001 From: xuwenhan <805208622@qq.com> Date: Thu, 9 Jun 2022 07:38:07 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 22 +++++++++++-- .../java2022spring/Notepad$1.class | Bin 1666 -> 1248 bytes .../java2022spring/Notepad$2.class | Bin 731 -> 1666 bytes .../java2022spring/Notepad$3.class | Bin 687 -> 731 bytes .../java2022spring/Notepad.class | Bin 12147 -> 13797 bytes .../java2022spring/SaveF.class | Bin 2116 -> 2116 bytes .../java2022spring1/java2022spring/T1.class | Bin 1068 -> 1068 bytes src/java2022spring/Notepad.java | 30 ++++++++++++++++-- 8 files changed, 46 insertions(+), 6 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3ecc273..ade383f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,7 +4,16 @@