From 309a0c3357ec30096e1b2ee7faafab6660c490eb Mon Sep 17 00:00:00 2001 From: Kalven Date: Sat, 31 Aug 2019 11:56:14 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-1117=20=E6=A0=B9=E6=8D=AE=E8=A6=81?= =?UTF-8?q?=E6=B1=82=E8=BF=9B=E8=A1=8C=E4=BA=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fanruan/api/base/ParameterHelperKit.java | 21 ----------- .../com/fanruan/api/cal/ScriptFactoryKit.java | 20 ---------- .../cal/namespace/ParameterMapNameSpace.java | 14 ------- .../com/fanruan/api/design/DesignKit.java | 10 +++++ .../ui/{list => component}/QuickList.java | 2 +- .../component/textarea/RSyntaxTextArea.java | 7 ---- .../api/design/ui/dialog/BasicDialog.java | 37 ------------------- .../design/ui/layout/FRGUIPaneFactoryKit.java | 31 ---------------- .../ui/mainframe/DesignerContextKit.java | 14 ------- src/main/java/com/fanruan/api/log/LogKit.java | 7 ---- .../java/com/fanruan/api/util/ContextKit.java | 16 -------- .../java/com/fanruan/api/util/GeneralKit.java | 11 ++++++ .../java/com/fanruan/api/util/InterKit.java | 15 -------- .../com/fanruan/api/util/ContextKitTest.java | 20 ---------- .../com/fanruan/api/util/GeneralKitTest.java | 7 ++++ .../com/fanruan/api/util/InterKitTest.java | 13 ------- 16 files changed, 29 insertions(+), 216 deletions(-) delete mode 100644 src/main/java/com/fanruan/api/base/ParameterHelperKit.java delete mode 100644 src/main/java/com/fanruan/api/cal/ScriptFactoryKit.java delete mode 100644 src/main/java/com/fanruan/api/cal/namespace/ParameterMapNameSpace.java rename src/main/java/com/fanruan/api/design/ui/{list => component}/QuickList.java (83%) delete mode 100644 src/main/java/com/fanruan/api/design/ui/component/textarea/RSyntaxTextArea.java delete mode 100644 src/main/java/com/fanruan/api/design/ui/dialog/BasicDialog.java delete mode 100644 src/main/java/com/fanruan/api/design/ui/layout/FRGUIPaneFactoryKit.java delete mode 100644 src/main/java/com/fanruan/api/design/ui/mainframe/DesignerContextKit.java delete mode 100644 src/main/java/com/fanruan/api/util/ContextKit.java delete mode 100644 src/main/java/com/fanruan/api/util/InterKit.java delete mode 100644 src/test/java/com/fanruan/api/util/ContextKitTest.java delete mode 100644 src/test/java/com/fanruan/api/util/InterKitTest.java diff --git a/src/main/java/com/fanruan/api/base/ParameterHelperKit.java b/src/main/java/com/fanruan/api/base/ParameterHelperKit.java deleted file mode 100644 index 3c7c05b..0000000 --- a/src/main/java/com/fanruan/api/base/ParameterHelperKit.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.fanruan.api.base; - -import com.fr.base.Parameter; -import com.fr.base.ParameterHelper; - -/** - * @author Kalven - * @version 10.0 - * Created by Kalven on 2019/8/30 - */ -public class ParameterHelperKit { - /** - * 从字符串中分析中有哪些需要的参数 - * @param text 待分析字符串 - * @param hasColumnRow 是否需要分析格子类型的参数 - * @return 字符串中包含的参数集合 - */ - public static Parameter[] analyze4Parameters(String text, boolean hasColumnRow) { - return ParameterHelper.analyze4Parameters(text, hasColumnRow); - } -} diff --git a/src/main/java/com/fanruan/api/cal/ScriptFactoryKit.java b/src/main/java/com/fanruan/api/cal/ScriptFactoryKit.java deleted file mode 100644 index cb1dc06..0000000 --- a/src/main/java/com/fanruan/api/cal/ScriptFactoryKit.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.fanruan.api.cal; - -import com.fr.script.ScriptFactory; - -import javax.script.ScriptEngine; - -/** - * @author Kalven - * @version 10.0 - * Created by Kalven on 2019/8/30 - */ -public class ScriptFactoryKit { - /** - * 单例模式,获取ScriptEngine对象 - * @return ScriptEngine对象 - */ - public static ScriptEngine newSingletonScriptEngine() { - return ScriptFactory.newSingletonScriptEngine(); - } -} diff --git a/src/main/java/com/fanruan/api/cal/namespace/ParameterMapNameSpace.java b/src/main/java/com/fanruan/api/cal/namespace/ParameterMapNameSpace.java deleted file mode 100644 index 8db7394..0000000 --- a/src/main/java/com/fanruan/api/cal/namespace/ParameterMapNameSpace.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.fanruan.api.cal.namespace; - -import java.util.Map; - -public class ParameterMapNameSpace { - /** - * 根据参数映射创建一个参数命名空间 - * @param map 参数名和参数值的映射 - * @return 参数命名空间 - */ - public static com.fr.base.ParameterMapNameSpace create(Map map) { - return com.fr.base.ParameterMapNameSpace.create(map); - } -} diff --git a/src/main/java/com/fanruan/api/design/DesignKit.java b/src/main/java/com/fanruan/api/design/DesignKit.java index 267c9cb..ce6be5d 100644 --- a/src/main/java/com/fanruan/api/design/DesignKit.java +++ b/src/main/java/com/fanruan/api/design/DesignKit.java @@ -3,6 +3,8 @@ package com.fanruan.api.design; import com.fr.base.TableData; import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.DesignerFrame; public class DesignKit { /** @@ -31,4 +33,12 @@ public class DesignKit { public static String i18nText(String key, Object... args) { return Toolkit.i18nText(key, args); } + + /** + * 单例模式,返回DesignerFrame对象 + * @return DesignerFrame对象 + */ + public static DesignerFrame getDesignerFrame() { + return DesignerContext.getDesignerFrame(); + } } diff --git a/src/main/java/com/fanruan/api/design/ui/list/QuickList.java b/src/main/java/com/fanruan/api/design/ui/component/QuickList.java similarity index 83% rename from src/main/java/com/fanruan/api/design/ui/list/QuickList.java rename to src/main/java/com/fanruan/api/design/ui/component/QuickList.java index aa4571e..9269a1c 100644 --- a/src/main/java/com/fanruan/api/design/ui/list/QuickList.java +++ b/src/main/java/com/fanruan/api/design/ui/component/QuickList.java @@ -1,4 +1,4 @@ -package com.fanruan.api.design.ui.list; +package com.fanruan.api.design.ui.component; import javax.swing.*; diff --git a/src/main/java/com/fanruan/api/design/ui/component/textarea/RSyntaxTextArea.java b/src/main/java/com/fanruan/api/design/ui/component/textarea/RSyntaxTextArea.java deleted file mode 100644 index 0fb41d8..0000000 --- a/src/main/java/com/fanruan/api/design/ui/component/textarea/RSyntaxTextArea.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.fanruan.api.design.ui.component.textarea; - -/** - * 公式输入的文本框 - */ -public class RSyntaxTextArea extends com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea { -} diff --git a/src/main/java/com/fanruan/api/design/ui/dialog/BasicDialog.java b/src/main/java/com/fanruan/api/design/ui/dialog/BasicDialog.java deleted file mode 100644 index c95d0bc..0000000 --- a/src/main/java/com/fanruan/api/design/ui/dialog/BasicDialog.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.fanruan.api.design.ui.dialog; - -import com.fr.design.dialog.BasicPane; - -import java.awt.*; - -/** - * 对话框的抽象类 - * @author Kalven - * @version 10.0 - * Created by Kalven on 2019/8/30 - */ -public abstract class BasicDialog extends com.fr.design.dialog.BasicDialog { - public BasicDialog(Frame frame) { - super(frame); - } - - public BasicDialog(Dialog dialog) { - super(dialog); - } - - public BasicDialog(Frame frame, BasicPane pane) { - super(frame, pane); - } - - public BasicDialog(Dialog dialog, BasicPane pane) { - super(dialog, pane); - } - - public BasicDialog(Frame frame, BasicPane pane, boolean isNeedButtonPane) { - super(frame, pane, isNeedButtonPane); - } - - public BasicDialog(Dialog dialog, BasicPane pane, boolean isNeedButtonPane) { - super(dialog, pane, isNeedButtonPane); - } -} diff --git a/src/main/java/com/fanruan/api/design/ui/layout/FRGUIPaneFactoryKit.java b/src/main/java/com/fanruan/api/design/ui/layout/FRGUIPaneFactoryKit.java deleted file mode 100644 index e04a1d5..0000000 --- a/src/main/java/com/fanruan/api/design/ui/layout/FRGUIPaneFactoryKit.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.fanruan.api.design.ui.layout; - -import javax.swing.*; -import java.awt.*; - - -public class FRGUIPaneFactoryKit { - /** - * 创建边框面板S - * @return JPanel对象 - */ - public static JPanel createBorderLayout_S_Pane() { - return com.fr.design.layout.FRGUIPaneFactory.createBorderLayout_S_Pane(); - } - - /** - * 创建一个靠左流式布局,正常流式内嵌 - * @return JPanel对象 - */ - public static JPanel createNormalFlowInnerContainer_S_Pane() { - return com.fr.design.layout.FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - } - - /** - * 创建一个边框布局 - * @return LayoutManager对象 - */ - public static LayoutManager createBorderLayout() { - return com.fr.design.layout.FRGUIPaneFactory.createBorderLayout(); - } -} diff --git a/src/main/java/com/fanruan/api/design/ui/mainframe/DesignerContextKit.java b/src/main/java/com/fanruan/api/design/ui/mainframe/DesignerContextKit.java deleted file mode 100644 index ee9c21b..0000000 --- a/src/main/java/com/fanruan/api/design/ui/mainframe/DesignerContextKit.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.fanruan.api.design.ui.mainframe; - -import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.DesignerFrame; - -public class DesignerContextKit { - /** - * 单例模式,返回DesignerFrame对象 - * @return DesignerFrame对象 - */ - public static DesignerFrame getDesignerFrame() { - return DesignerContext.getDesignerFrame(); - } -} diff --git a/src/main/java/com/fanruan/api/log/LogKit.java b/src/main/java/com/fanruan/api/log/LogKit.java index b599314..4eeb09f 100644 --- a/src/main/java/com/fanruan/api/log/LogKit.java +++ b/src/main/java/com/fanruan/api/log/LogKit.java @@ -162,11 +162,4 @@ public class LogKit { FineLoggerFactory.getLogger().error(e, format, args); } - /** - * 得到日志对象 - * @return 日志对象 - */ - public static FRLogger getLogger() { - return FRLogger.getLogger(); - } } diff --git a/src/main/java/com/fanruan/api/util/ContextKit.java b/src/main/java/com/fanruan/api/util/ContextKit.java deleted file mode 100644 index 12755df..0000000 --- a/src/main/java/com/fanruan/api/util/ContextKit.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.fanruan.api.util; - -import com.fr.base.FRContext; - -import java.util.Locale; - -public class ContextKit { - /** - * 返回国际化区属 - * @return 国际化后区域属性 - */ - @Deprecated - public static Locale getLocale() { - return FRContext.getLocale(); - } -} diff --git a/src/main/java/com/fanruan/api/util/GeneralKit.java b/src/main/java/com/fanruan/api/util/GeneralKit.java index 30a74bb..14b5fc7 100644 --- a/src/main/java/com/fanruan/api/util/GeneralKit.java +++ b/src/main/java/com/fanruan/api/util/GeneralKit.java @@ -1,5 +1,6 @@ package com.fanruan.api.util; +import com.fr.base.FRContext; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; import com.fr.third.guava.base.Objects; @@ -7,6 +8,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.io.IOException; +import java.util.Locale; import java.util.Map; /** @@ -69,4 +71,13 @@ public class GeneralKit { public static int compare(Object obj1, Object obj2) { return ComparatorUtils.compare(obj1, obj2); } + + /** + * 返回国际化区属 + * @return 国际化后区域属性 + */ + @Deprecated + public static Locale getLocale() { + return FRContext.getLocale(); + } } diff --git a/src/main/java/com/fanruan/api/util/InterKit.java b/src/main/java/com/fanruan/api/util/InterKit.java deleted file mode 100644 index 36ecac2..0000000 --- a/src/main/java/com/fanruan/api/util/InterKit.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.fanruan.api.util; - -import com.fr.general.Inter; - -public class InterKit { - - /** - * 获取国际化文本,已过时 - * @param text - * @return 国际化文本字符串 - */ - public static String getLocText(String text) { - return Inter.getLocText(text); - } -} diff --git a/src/test/java/com/fanruan/api/util/ContextKitTest.java b/src/test/java/com/fanruan/api/util/ContextKitTest.java deleted file mode 100644 index c82a7cd..0000000 --- a/src/test/java/com/fanruan/api/util/ContextKitTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.fanruan.api.util; - -import org.junit.Test; - -import java.util.Locale; - -import static org.junit.Assert.*; - -/** - * @author Kalven - * @version 10.0 - * Created by Kalven on 2019/8/31 - */ -public class ContextKitTest { - - @Test - public void getLocale() { - assertEquals(ContextKit.getLocale(), Locale.CHINA); - } -} \ No newline at end of file diff --git a/src/test/java/com/fanruan/api/util/GeneralKitTest.java b/src/test/java/com/fanruan/api/util/GeneralKitTest.java index 7bbefa6..975ae8d 100644 --- a/src/test/java/com/fanruan/api/util/GeneralKitTest.java +++ b/src/test/java/com/fanruan/api/util/GeneralKitTest.java @@ -5,6 +5,8 @@ import com.fr.general.GeneralUtils; import org.junit.Assert; import org.junit.Test; +import java.util.Locale; + /** * @author richie * @version 10.0 @@ -39,4 +41,9 @@ public class GeneralKitTest extends Prepare { Assert.assertEquals(GeneralKit.compare(s,s3),0); Assert.assertEquals(GeneralKit.compare(s,s2),1); } + + @Test + public void getLocale() { + Assert.assertEquals(GeneralKit.getLocale(), Locale.CHINA); + } } \ No newline at end of file diff --git a/src/test/java/com/fanruan/api/util/InterKitTest.java b/src/test/java/com/fanruan/api/util/InterKitTest.java deleted file mode 100644 index 96f949e..0000000 --- a/src/test/java/com/fanruan/api/util/InterKitTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.fanruan.api.util; - -import org.junit.Test; - -import static org.junit.Assert.*; - -public class InterKitTest { - - @Test - public void getLocText() { - assertEquals(InterKit.getLocText("asdasd"),"asdasd"); - } -} \ No newline at end of file