Browse Source

云中心工具类

master
richie 5 years ago
parent
commit
14087993a6
  1. 19
      src/main/java/com/fanruan/api/design/ui/component/code/UISyntaxTextArea.java
  2. 23
      src/main/java/com/fanruan/api/design/ui/layout/TableLayoutKit.java
  3. 36
      src/main/java/com/fanruan/api/net/CloudKit.java

19
src/main/java/com/fanruan/api/design/ui/component/code/UISyntaxTextArea.java

@ -8,14 +8,17 @@ import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea;
* Created by richie on 2019-08-28 * Created by richie on 2019-08-28
* 代码编辑器支持javascriptsqljava公式和普通文本 * 代码编辑器支持javascriptsqljava公式和普通文本
* @see com.fanruan.api.design.ui.component.code.SyntaxConstants * @see com.fanruan.api.design.ui.component.code.SyntaxConstants
* <p> * <pre> {@code
* UISyntaxTextArea contentTextArea = new UISyntaxTextArea(); *
* contentTextArea.setCloseCurlyBraces(true); * UISyntaxTextArea contentTextArea = new UISyntaxTextArea();
* contentTextArea.setLineWrap(true); * contentTextArea.setCloseCurlyBraces(true);
* contentTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT); * contentTextArea.setLineWrap(true);
* contentTextArea.setCodeFoldingEnabled(true); *
* contentTextArea.setAntiAliasingEnabled(true); * contentTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
* </p> * contentTextArea.setCodeFoldingEnabled(true);
* contentTextArea.setAntiAliasingEnabled(true);
* }
* </pre>
*/ */
public class UISyntaxTextArea extends RSyntaxTextArea { public class UISyntaxTextArea extends RSyntaxTextArea {

23
src/main/java/com/fanruan/api/design/ui/layout/TableLayoutKit.java

@ -11,18 +11,19 @@ import java.awt.*;
* @version 10.0 * @version 10.0
* Created by richie on 2019-08-28 * Created by richie on 2019-08-28
* 表格布局 * 表格布局
* <code> * <pre> {@code
* double p = TableLayoutKit.PREFERRED; * double p = TableLayoutKit.PREFERRED;
* double f = TableLayoutKit.FILL; * double f = TableLayoutKit.FILL;
* double[] rowSize = new double[]{p, p, p, f}; * double[] rowSize = new double[]{p, p, p, f};
* double[] columnSize = new double[]{p, f}; * double[] columnSize = new double[]{p, f};
* JComponent[][] comps = new JComponent[][]{ * JComponent[][] comps = new JComponent[][]{
* {new JLabel(), new JButton()}, * {new JLabel(), new JButton()},
* {new JLabel(), new JButton()}, * {new JLabel(), new JButton()},
* {new JLabel(), new JButton()} * {new JLabel(), new JButton()}
* };
* JPanel = TableLayoutKit.createTableLayoutPane(comps, rowSize, columnSize);
* } * }
* JPanel = TableLayoutKit.createTableLayoutPane(comps, rowSize, columnSize); * </pre>
* </code>
*/ */
public class TableLayoutKit { public class TableLayoutKit {

36
src/main/java/com/fanruan/api/net/CloudKit.java

@ -0,0 +1,36 @@
package com.fanruan.api.net;
import com.fr.general.CloudCenter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-08-30
* 云中心交互工具类
*/
public class CloudKit {
/**
* 从云中心获取值
*
* @param kind
* @param defaultSiteUrl 默认值
* @return 键对应的值如果没有值则返回默认值
*/
public @Nullable String acquireUrlByKind(@NotNull String kind, @NotNull String defaultSiteUrl) {
return CloudCenter.getInstance().acquireUrlByKind(kind, defaultSiteUrl);
}
/**
* 从云中心获取值
*
* @param kind
* @return 键对应的值如果没有值则返回空
*/
public @Nullable String acquireUrlByKind(@NotNull String kind) {
return CloudCenter.getInstance().acquireUrlByKind(kind);
}
}
Loading…
Cancel
Save