From 14087993a65df08c345086e9bfe8d05f44724f28 Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 30 Aug 2019 10:56:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=91=E4=B8=AD=E5=BF=83=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/component/code/UISyntaxTextArea.java | 19 +++++----- .../api/design/ui/layout/TableLayoutKit.java | 23 ++++++------ .../java/com/fanruan/api/net/CloudKit.java | 36 +++++++++++++++++++ 3 files changed, 59 insertions(+), 19 deletions(-) create mode 100644 src/main/java/com/fanruan/api/net/CloudKit.java diff --git a/src/main/java/com/fanruan/api/design/ui/component/code/UISyntaxTextArea.java b/src/main/java/com/fanruan/api/design/ui/component/code/UISyntaxTextArea.java index bd1ea0f..478168a 100644 --- a/src/main/java/com/fanruan/api/design/ui/component/code/UISyntaxTextArea.java +++ b/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 * 代码编辑器,支持javascript、sql、java、公式和普通文本 * @see com.fanruan.api.design.ui.component.code.SyntaxConstants - *

- * UISyntaxTextArea contentTextArea = new UISyntaxTextArea(); - * contentTextArea.setCloseCurlyBraces(true); - * contentTextArea.setLineWrap(true); - * contentTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT); - * contentTextArea.setCodeFoldingEnabled(true); - * contentTextArea.setAntiAliasingEnabled(true); - *

+ *
 {@code
+ *
+ *   UISyntaxTextArea contentTextArea = new UISyntaxTextArea();
+ *   contentTextArea.setCloseCurlyBraces(true);
+ *   contentTextArea.setLineWrap(true);
+ *
+ *   contentTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
+ *   contentTextArea.setCodeFoldingEnabled(true);
+ *   contentTextArea.setAntiAliasingEnabled(true);
+ * }
+ * 
*/ public class UISyntaxTextArea extends RSyntaxTextArea { diff --git a/src/main/java/com/fanruan/api/design/ui/layout/TableLayoutKit.java b/src/main/java/com/fanruan/api/design/ui/layout/TableLayoutKit.java index 6aaf056..fa2b661 100644 --- a/src/main/java/com/fanruan/api/design/ui/layout/TableLayoutKit.java +++ b/src/main/java/com/fanruan/api/design/ui/layout/TableLayoutKit.java @@ -11,18 +11,19 @@ import java.awt.*; * @version 10.0 * Created by richie on 2019-08-28 * 表格布局 - * - * double p = TableLayoutKit.PREFERRED; - * double f = TableLayoutKit.FILL; - * double[] rowSize = new double[]{p, p, p, f}; - * double[] columnSize = new double[]{p, f}; - * JComponent[][] comps = new JComponent[][]{ - * {new JLabel(), new JButton()}, - * {new JLabel(), new JButton()}, - * {new JLabel(), new JButton()} + *
 {@code
+ *   double p = TableLayoutKit.PREFERRED;
+ *   double f = TableLayoutKit.FILL;
+ *   double[] rowSize = new double[]{p, p, p, f};
+ *   double[] columnSize = new double[]{p, f};
+ *   JComponent[][] comps = new JComponent[][]{
+ *        {new JLabel(), new JButton()},
+ *        {new JLabel(), new JButton()},
+ *        {new JLabel(), new JButton()}
+ *   };
+ *   JPanel = TableLayoutKit.createTableLayoutPane(comps, rowSize, columnSize);
  * }
- * JPanel = TableLayoutKit.createTableLayoutPane(comps, rowSize, columnSize);
- * 
+ * 
*/ public class TableLayoutKit { diff --git a/src/main/java/com/fanruan/api/net/CloudKit.java b/src/main/java/com/fanruan/api/net/CloudKit.java new file mode 100644 index 0000000..775ea6e --- /dev/null +++ b/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); + } +}