Browse Source

KERNEL-1117 根据要求进行了修改

pull/1/head
Kalven 5 years ago
parent
commit
309a0c3357
  1. 21
      src/main/java/com/fanruan/api/base/ParameterHelperKit.java
  2. 20
      src/main/java/com/fanruan/api/cal/ScriptFactoryKit.java
  3. 14
      src/main/java/com/fanruan/api/cal/namespace/ParameterMapNameSpace.java
  4. 10
      src/main/java/com/fanruan/api/design/DesignKit.java
  5. 2
      src/main/java/com/fanruan/api/design/ui/component/QuickList.java
  6. 7
      src/main/java/com/fanruan/api/design/ui/component/textarea/RSyntaxTextArea.java
  7. 37
      src/main/java/com/fanruan/api/design/ui/dialog/BasicDialog.java
  8. 31
      src/main/java/com/fanruan/api/design/ui/layout/FRGUIPaneFactoryKit.java
  9. 14
      src/main/java/com/fanruan/api/design/ui/mainframe/DesignerContextKit.java
  10. 7
      src/main/java/com/fanruan/api/log/LogKit.java
  11. 16
      src/main/java/com/fanruan/api/util/ContextKit.java
  12. 11
      src/main/java/com/fanruan/api/util/GeneralKit.java
  13. 15
      src/main/java/com/fanruan/api/util/InterKit.java
  14. 20
      src/test/java/com/fanruan/api/util/ContextKitTest.java
  15. 7
      src/test/java/com/fanruan/api/util/GeneralKitTest.java
  16. 13
      src/test/java/com/fanruan/api/util/InterKitTest.java

21
src/main/java/com/fanruan/api/base/ParameterHelperKit.java

@ -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);
}
}

20
src/main/java/com/fanruan/api/cal/ScriptFactoryKit.java

@ -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();
}
}

14
src/main/java/com/fanruan/api/cal/namespace/ParameterMapNameSpace.java

@ -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);
}
}

10
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();
}
}

2
src/main/java/com/fanruan/api/design/ui/list/QuickList.java → 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.*;

7
src/main/java/com/fanruan/api/design/ui/component/textarea/RSyntaxTextArea.java

@ -1,7 +0,0 @@
package com.fanruan.api.design.ui.component.textarea;
/**
* 公式输入的文本框
*/
public class RSyntaxTextArea extends com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea {
}

37
src/main/java/com/fanruan/api/design/ui/dialog/BasicDialog.java

@ -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);
}
}

31
src/main/java/com/fanruan/api/design/ui/layout/FRGUIPaneFactoryKit.java

@ -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();
}
}

14
src/main/java/com/fanruan/api/design/ui/mainframe/DesignerContextKit.java

@ -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();
}
}

7
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();
}
}

16
src/main/java/com/fanruan/api/util/ContextKit.java

@ -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();
}
}

11
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();
}
}

15
src/main/java/com/fanruan/api/util/InterKit.java

@ -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);
}
}

20
src/test/java/com/fanruan/api/util/ContextKitTest.java

@ -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);
}
}

7
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);
}
}

13
src/test/java/com/fanruan/api/util/InterKitTest.java

@ -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");
}
}
Loading…
Cancel
Save