diff --git a/src/main/java/UnitTest/Swdt/Swdt.html b/src/main/java/UnitTest/Swdt/Swdt.html index ca454c2f..c8a686b5 100644 --- a/src/main/java/UnitTest/Swdt/Swdt.html +++ b/src/main/java/UnitTest/Swdt/Swdt.html @@ -42,6 +42,6 @@ (getOptions || markmap.deriveOptions)(jsonOptions), root2 ); - })(() => window.markmap,null,{"content":"初中物理八年级上(人教版)","children":[{"content":"
第一章  机械运动99+
","children":[{"content":"
第1节 长度和时间的测量
","children":[{"content":"
第2节 运动的描述
","children":[{"content":"
第3节 运动的快慢99+
","children":[],"payload":{"lines":"4,5"}}],"payload":{"lines":"3,4"}}],"payload":{"lines":"2,3"}},{"content":"
第4节 测量平均速度99+
","children":[{"content":"
本章复习99+
","children":[],"payload":{"lines":"6,7"}}],"payload":{"lines":"5,6"}}],"payload":{"lines":"1,2"}},{"content":"
第二章  声现象99+
","children":[{"content":"
第1节 声音的产生与传播99+
","children":[{"content":"
第2节 声音的特性
","children":[{"content":"
第3节 声的利用99+
","children":[],"payload":{"lines":"11,12"}}],"payload":{"lines":"10,11"}}],"payload":{"lines":"9,10"}},{"content":"
第4节 噪音的危害和控制
","children":[{"content":"
本章复习
","children":[],"payload":{"lines":"13,14"}}],"payload":{"lines":"12,13"}}],"payload":{"lines":"8,9"}},{"content":"
第三章  物态变化99+
","children":[{"content":"
第1节 温度99+
","children":[{"content":"
第2节 熔化和凝固99+
","children":[{"content":"
第3节 汽化和液化99+
","children":[],"payload":{"lines":"18,19"}}],"payload":{"lines":"17,18"}}],"payload":{"lines":"16,17"}},{"content":"
第4节 升华和凝华99+
","children":[{"content":"
本章复习99+
","children":[],"payload":{"lines":"20,21"}}],"payload":{"lines":"19,20"}}],"payload":{"lines":"15,16"}},{"content":"
第四章  光现象99+
","children":[{"content":"
第1节 光的直线传播99+
","children":[{"content":"
第2节 光的反射99+
","children":[{"content":"
第3节 平面镜成像99+
","children":[],"payload":{"lines":"25,26"}}],"payload":{"lines":"24,25"}}],"payload":{"lines":"23,24"}},{"content":"
第4节 光的折射
","children":[{"content":"
第5节 光的色散99+
","children":[{"content":"
本章复习99+
","children":[],"payload":{"lines":"28,29"}}],"payload":{"lines":"27,28"}}],"payload":{"lines":"26,27"}}],"payload":{"lines":"22,23"}},{"content":"
第五章  透镜及其应用99+
","children":[{"content":"
第1节 透镜99+
","children":[{"content":"
第2节 生活中的透镜99+
","children":[{"content":"
第3节 凸透镜成像的规律99+
","children":[],"payload":{"lines":"33,34"}}],"payload":{"lines":"32,33"}}],"payload":{"lines":"31,32"}},{"content":"
第4节 眼睛和眼镜99+
","children":[{"content":"
第5节 显微镜和望远镜
","children":[{"content":"
本章复习99+
","children":[],"payload":{"lines":"36,37"}}],"payload":{"lines":"35,36"}}],"payload":{"lines":"34,35"}}],"payload":{"lines":"30,31"}},{"content":"
第六章  质量与密度99+
","children":[{"content":"
第1节 质量99+
","children":[{"content":"
第2节 密度99+
","children":[{"content":"
第3节 测量物质的密度99+
","children":[],"payload":{"lines":"41,42"}}],"payload":{"lines":"40,41"}}],"payload":{"lines":"39,40"}},{"content":"
第4节 密度与社会生活99+
","children":[{"content":"
本章复习99+
","children":[],"payload":{"lines":"43,44"}}],"payload":{"lines":"42,43"}}],"payload":{"lines":"38,39"}},{"content":"
期中复习99+
","children":[],"payload":{"lines":"45,46"}},{"content":"
期末复习99+
","children":[],"payload":{"lines":"47,48"}},{"content":"
本册复习99+
","children":[],"payload":{"lines":"49,50"}}],"payload":{"lines":"0,1"}},null) + })(() => window.markmap,null,{"content":"初中物理八年级上(人教版)","children":[{"content":"
第一章  机械运动99+
","children":[{"content":"
第1节 长度和时间的测量77+
","children":[{"content":"
第2节 运动的描述38+
","children":[{"content":"
第3节 运动的快慢83+
","children":[],"payload":{"lines":"4,5"}}],"payload":{"lines":"3,4"}}],"payload":{"lines":"2,3"}},{"content":"
第4节 测量平均速度61+
","children":[{"content":"
本章复习45+
","children":[],"payload":{"lines":"6,7"}}],"payload":{"lines":"5,6"}}],"payload":{"lines":"1,2"}},{"content":"
第二章  声现象99+
","children":[{"content":"
第1节 声音的产生与传播49+
","children":[{"content":"
第2节 声音的特性93+
","children":[{"content":"
第3节 声的利用95+
","children":[],"payload":{"lines":"11,12"}}],"payload":{"lines":"10,11"}}],"payload":{"lines":"9,10"}},{"content":"
第4节 噪音的危害和控制89+
","children":[{"content":"
本章复习89+
","children":[],"payload":{"lines":"13,14"}}],"payload":{"lines":"12,13"}}],"payload":{"lines":"8,9"}},{"content":"
第三章  物态变化99+
","children":[{"content":"
第1节 温度85+
","children":[{"content":"
第2节 熔化和凝固36+
","children":[{"content":"
第3节 汽化和液化74+
","children":[],"payload":{"lines":"18,19"}}],"payload":{"lines":"17,18"}}],"payload":{"lines":"16,17"}},{"content":"
第4节 升华和凝华55+
","children":[{"content":"
本章复习91+
","children":[],"payload":{"lines":"20,21"}}],"payload":{"lines":"19,20"}}],"payload":{"lines":"15,16"}},{"content":"
第四章  光现象99+
","children":[{"content":"
第1节 光的直线传播56+
","children":[{"content":"
第2节 光的反射75+
","children":[{"content":"
第3节 平面镜成像79+
","children":[],"payload":{"lines":"25,26"}}],"payload":{"lines":"24,25"}}],"payload":{"lines":"23,24"}},{"content":"
第4节 光的折射91+
","children":[{"content":"
第5节 光的色散25+
","children":[{"content":"
本章复习70+
","children":[],"payload":{"lines":"28,29"}}],"payload":{"lines":"27,28"}}],"payload":{"lines":"26,27"}}],"payload":{"lines":"22,23"}},{"content":"
第五章  透镜及其应用99+
","children":[{"content":"
第1节 透镜62+
","children":[{"content":"
第2节 生活中的透镜
","children":[{"content":"
第3节 凸透镜成像的规律72+
","children":[],"payload":{"lines":"33,34"}}],"payload":{"lines":"32,33"}}],"payload":{"lines":"31,32"}},{"content":"
第4节 眼睛和眼镜94+
","children":[{"content":"
第5节 显微镜和望远镜
","children":[{"content":"
本章复习
","children":[],"payload":{"lines":"36,37"}}],"payload":{"lines":"35,36"}}],"payload":{"lines":"34,35"}}],"payload":{"lines":"30,31"}},{"content":"
第六章  质量与密度99+
","children":[{"content":"
第1节 质量
","children":[{"content":"
第2节 密度33+
","children":[{"content":"
第3节 测量物质的密度69+
","children":[],"payload":{"lines":"41,42"}}],"payload":{"lines":"40,41"}}],"payload":{"lines":"39,40"}},{"content":"
第4节 密度与社会生活88+
","children":[{"content":"
本章复习91+
","children":[],"payload":{"lines":"43,44"}}],"payload":{"lines":"42,43"}}],"payload":{"lines":"38,39"}},{"content":"
期中复习99+
","children":[],"payload":{"lines":"45,46"}},{"content":"
期末复习99+
","children":[],"payload":{"lines":"47,48"}},{"content":"
本册复习99+
","children":[],"payload":{"lines":"49,50"}}],"payload":{"lines":"0,1"}},null) diff --git a/src/main/java/UnitTest/Swdt/Swdt.java b/src/main/java/UnitTest/Swdt/Swdt.java index 235ad0ae..665a71b2 100644 --- a/src/main/java/UnitTest/Swdt/Swdt.java +++ b/src/main/java/UnitTest/Swdt/Swdt.java @@ -20,22 +20,6 @@ public class Swdt { public static String YELLOW = "#ffb800"; public static String GREEN = "#07C491"; - /** - * 功能:生成一个随机的颜色+数字 - * - * @param txt - * @param num - * @return - */ - public static String getRandomColorTxt(String txt, int num) { - Random random = new Random(); - int number = random.nextInt(4); - if (number == 0) return getColorTxt(txt, num, RED); - if (number == 1) return getColorTxt(txt, num, YELLOW); - if (number == 2) return getColorTxt(txt, num, GREEN); - return getGrayTxt(txt, num); - } - /** * 功能:生成一个指定颜色+数字 * @@ -43,7 +27,12 @@ public class Swdt { * @param num * @return */ - public static String getColorTxt(String txt, int num, String color) { + public static String getColorTxt(String txt, int num) { + if (num <= 20) return getGrayTxt(txt, num); + String color; + if (num <= 50) color = RED; + else if (num <= 75) color = YELLOW; + else color = GREEN; String content = FileUtil.readUtf8String(workingPath + "Swdt_Color.txt"); content = content.replace("{{color}}", color); content = content.replace("{{txt}}", txt); @@ -79,14 +68,17 @@ public class Swdt { String res = "# " + km + "\n"; for (int i = 0; i < jTree.size(); i++) { String title = jTree.getJSONObject(i).getString("title"); - res += "## " + getColorTxt(title, 99, GREEN) + "\n"; + res += "## " + getColorTxt(title, 99) + "\n"; JSONArray jChildren = jTree.getJSONObject(i).getJSONArray("children"); if (jChildren != null) { for (int j = 0; j < jChildren.size(); j++) { for (int k = 0; k <= j % rowCount; k++) res += "#"; res += "## "; JSONObject jo = jChildren.getJSONObject(j); - res += getRandomColorTxt(jo.getString("title"), 99) + "\n"; + //生成一个随机数 + Random random = new Random(); + int number = random.nextInt(100); + res += getColorTxt(jo.getString("title"), number) + "\n"; } } res += "\n"; diff --git a/src/main/java/UnitTest/Swdt/Swdt.md b/src/main/java/UnitTest/Swdt/Swdt.md index 1a6adf2c..8ef0628f 100644 --- a/src/main/java/UnitTest/Swdt/Swdt.md +++ b/src/main/java/UnitTest/Swdt/Swdt.md @@ -1,51 +1,51 @@ # 初中物理八年级上(人教版) -##
第一章  机械运动99+
-###
第1节 长度和时间的测量
-####
第2节 运动的描述
-#####
第3节 运动的快慢99+
-###
第4节 测量平均速度99+
-####
本章复习99+
- -##
第二章  声现象99+
-###
第1节 声音的产生与传播99+
-####
第2节 声音的特性
-#####
第3节 声的利用99+
-###
第4节 噪音的危害和控制
-####
本章复习
- -##
第三章  物态变化99+
-###
第1节 温度99+
-####
第2节 熔化和凝固99+
-#####
第3节 汽化和液化99+
-###
第4节 升华和凝华99+
-####
本章复习99+
- -##
第四章  光现象99+
-###
第1节 光的直线传播99+
-####
第2节 光的反射99+
-#####
第3节 平面镜成像99+
-###
第4节 光的折射
-####
第5节 光的色散99+
-#####
本章复习99+
- -##
第五章  透镜及其应用99+
-###
第1节 透镜99+
-####
第2节 生活中的透镜99+
-#####
第3节 凸透镜成像的规律99+
-###
第4节 眼睛和眼镜99+
+##
第一章  机械运动99+
+###
第1节 长度和时间的测量77+
+####
第2节 运动的描述38+
+#####
第3节 运动的快慢83+
+###
第4节 测量平均速度61+
+####
本章复习45+
+ +##
第二章  声现象99+
+###
第1节 声音的产生与传播49+
+####
第2节 声音的特性93+
+#####
第3节 声的利用95+
+###
第4节 噪音的危害和控制89+
+####
本章复习89+
+ +##
第三章  物态变化99+
+###
第1节 温度85+
+####
第2节 熔化和凝固36+
+#####
第3节 汽化和液化74+
+###
第4节 升华和凝华55+
+####
本章复习91+
+ +##
第四章  光现象99+
+###
第1节 光的直线传播56+
+####
第2节 光的反射75+
+#####
第3节 平面镜成像79+
+###
第4节 光的折射91+
+####
第5节 光的色散25+
+#####
本章复习70+
+ +##
第五章  透镜及其应用99+
+###
第1节 透镜62+
+####
第2节 生活中的透镜
+#####
第3节 凸透镜成像的规律72+
+###
第4节 眼睛和眼镜94+
####
第5节 显微镜和望远镜
-#####
本章复习99+
+#####
本章复习
-##
第六章  质量与密度99+
-###
第1节 质量99+
-####
第2节 密度99+
-#####
第3节 测量物质的密度99+
-###
第4节 密度与社会生活99+
-####
本章复习99+
+##
第六章  质量与密度99+
+###
第1节 质量
+####
第2节 密度33+
+#####
第3节 测量物质的密度69+
+###
第4节 密度与社会生活88+
+####
本章复习91+
-##
期中复习99+
+##
期中复习99+
-##
期末复习99+
+##
期末复习99+
-##
本册复习99+
+##
本册复习99+
diff --git a/src/main/java/UnitTest/Swdt/Swdt_Color.txt b/src/main/java/UnitTest/Swdt/Swdt_Color.txt index 7385b171..bdf516af 100644 --- a/src/main/java/UnitTest/Swdt/Swdt_Color.txt +++ b/src/main/java/UnitTest/Swdt/Swdt_Color.txt @@ -1 +1 @@ -
{{txt}}{{num}}+
\ No newline at end of file +
{{txt}}{{num}}+
\ No newline at end of file