From b141d258f61e12dc131966920cf1952ffac53a82 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 5 Jan 2021 19:58:01 +0800 Subject: [PATCH 1/8] =?UTF-8?q?REPORT-44410=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=E6=8D=AE=E9=9B=86=E7=82=B9=E5=87=BB=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E5=8D=A1=E9=A1=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignModelAdapter.java | 86 ++++++++++++++++++- .../data/datapane/TableDataTreePane.java | 4 +- .../fr/design/mainframe/FormModelAdapter.java | 23 ++++- .../mainframe/WorkBookModelAdapter.java | 35 +++++++- 4 files changed, 143 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java b/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java index 24dd314844..02396cd5c3 100644 --- a/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java +++ b/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java @@ -1,8 +1,11 @@ package com.fr.design; import com.fr.base.Parameter; +import com.fr.base.ParameterConfig; +import com.fr.base.TableData; import com.fr.base.io.BaseBook; import com.fr.data.TableDataSource; +import com.fr.data.operator.DataOperator; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.JTemplate; @@ -11,9 +14,14 @@ import com.fr.form.ui.DataControl; import com.fr.form.ui.MultiFileEditor; import com.fr.form.ui.Widget; import com.fr.general.ComparatorUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.Filter; +import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import com.fr.stable.js.WidgetName; +import com.fr.util.ParameterApplyHelper; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -40,7 +48,7 @@ public abstract class DesignModelAdapter tableDataParametersMap = new HashMap<>(); + + public DesignModelAdapter(S jTemplate) { this.jTemplate = jTemplate; @@ -241,6 +255,71 @@ public abstract class DesignModelAdapter map, Filter filter) { + Iterator it = this.getBook().getTableDataNameIterator(); + try { + // 清空下缓存 + tableDataParametersMap.clear(); + while (it.hasNext()) { + String name = it.next(); + TableData tableData = this.getBook().getTableData(name); + ParameterProvider[] parameterProviders = DataOperator.getInstance().getTableDataParameters(tableData); + if (filter != null) { + ParameterApplyHelper.addPara2Map(map, parameterProviders, filter); + } else { + ParameterApplyHelper.addPara2Map(map, parameterProviders); + } + tableDataParametersMap.put(name, parameterProviders); + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + protected void updateTableDataParameters(String oldName, + String tdName, + TableData tableData, + Map map, + Filter filter) { + // 更新下缓存名称 替换下数据集名称 + ParameterProvider[] providers = tableDataParametersMap.remove(oldName); + if (providers != null) { + tableDataParametersMap.put(tdName, providers); + } + + try { + for (Map.Entry entry : tableDataParametersMap.entrySet()) { + ParameterProvider[] parameterProviders; + if (ComparatorUtils.equals(entry.getKey(), tdName)) { + parameterProviders = DataOperator.getInstance().getTableDataParameters(tableData); + // 用来更新缓存 + providers = parameterProviders; + } else { + parameterProviders = entry.getValue(); + } + + if (filter != null) { + ParameterApplyHelper.addPara2Map(map, parameterProviders, filter); + } else { + ParameterApplyHelper.addPara2Map(map, parameterProviders); + } + + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + + // 更新缓存 + tableDataParametersMap.put(tdName, providers); + } + + protected void addGlobalParameters(Map map) { + // 添加全局参数 + Parameter[] glbParas = ParameterConfig.getInstance().getGlobalParameters(); + ParameterApplyHelper.addPara2Map(map, glbParas); + + } + /** * 环境改变. */ @@ -251,6 +330,11 @@ public abstract class DesignModelAdapter> { @@ -42,6 +46,16 @@ public class FormModelAdapter extends DesignModelAdapter> jTemplate.populateParameter(); } + @Override + public void tableDataParametersChanged(String oldName, String tdName, TableData tableData) { + Map map = new HashMap<>(); + addGlobalParameters(map); + updateTableDataParameters(oldName, tdName, tableData, map, parameterProvider -> !EmbParaFilter.isFRLayerTypePara(parameterProvider)); + ParameterApplyHelper.addPara2Map(map, this.getBook().getTemplateParameters()); + parameters = map.values().toArray(new Parameter[0]); + jTemplate.populateParameter(); + } + /** * 控件配置改变. */ @@ -135,6 +149,13 @@ public class FormModelAdapter extends DesignModelAdapter> @Override protected Parameter[] getLatestParameters() { - return this.getBook().getParameters(); + Map map = new HashMap<>(); + addGlobalParameters(map); + + addTableDataParameters(map, parameterProvider -> !EmbParaFilter.isFRLayerTypePara(parameterProvider)); + + ParameterApplyHelper.addPara2Map(map, this.getBook().getTemplateParameters()); + + return map.values().toArray(new Parameter[0]); } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java b/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java index 1a4f20c3dd..87391a5a05 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java @@ -18,9 +18,12 @@ import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.js.WidgetName; +import com.fr.util.ParameterApplyHelper; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; /** * @author zhou @@ -72,6 +75,18 @@ public class WorkBookModelAdapter extends DesignModelAdapter map = new HashMap<>(); + addGlobalParameters(map); + updateTableDataParameters(oldName, tdName, tableData, map, null); + addReportParameters(map); + parameters = map.values().toArray(new Parameter[0]); + jTemplate.updateReportParameterAttr(); + jTemplate.populateReportParameterAttr(); + + } + /** * 控件改变. */ @@ -107,9 +122,27 @@ public class WorkBookModelAdapter extends DesignModelAdapter map = new HashMap<>(); + addGlobalParameters(map); + + addTableDataParameters(map, null); + + addReportParameters(map); + + return map.values().toArray(new Parameter[0]); + } + + private void addReportParameters(Map map) { + // 添加模板参数 + ReportParameterAttr parameterAttr = this.getBook().getReportParameterAttr(); + if (parameterAttr != null) { + ParameterApplyHelper.addPara2Map(map, parameterAttr.getParameters()); + } } + + + /** * 返回控件的名字 * From 9f45188d6e89e48748e5686ec5d06bcc468de462 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 6 Jan 2021 09:24:34 +0800 Subject: [PATCH 2/8] =?UTF-8?q?REPORT-44410=20=E5=8A=A0=E4=B8=AA=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignModelAdapter.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java b/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java index 02396cd5c3..e5930ee91f 100644 --- a/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java +++ b/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java @@ -281,12 +281,18 @@ public abstract class DesignModelAdapter map, Filter filter) { - // 更新下缓存名称 替换下数据集名称 - ParameterProvider[] providers = tableDataParametersMap.remove(oldName); - if (providers != null) { - tableDataParametersMap.put(tdName, providers); + + ParameterProvider[] providers = null; + + if (!ComparatorUtils.equals(oldName, tdName)) { + // 更新下缓存名称 替换下数据集名称 + providers = tableDataParametersMap.remove(oldName); + if (providers != null) { + tableDataParametersMap.put(tdName, providers); + } } + try { for (Map.Entry entry : tableDataParametersMap.entrySet()) { ParameterProvider[] parameterProviders; @@ -309,8 +315,10 @@ public abstract class DesignModelAdapter map) { From 04007d7e046678c58bbfd9d5286f19d7788f260c Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 6 Jan 2021 11:33:39 +0800 Subject: [PATCH 3/8] =?UTF-8?q?REPORT-32210=20Tab=E5=9D=97=E6=8B=96?= =?UTF-8?q?=E5=8A=A8=E6=B7=BB=E5=8A=A0=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/beans/LayoutAdapter.java | 14 ++++++++++++- .../layout/AbstractLayoutAdapter.java | 21 +++++++++++++++++-- .../layout/FRTabFitLayoutAdapter.java | 6 +++--- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/LayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/LayoutAdapter.java index c087d78fef..b961aaee07 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/LayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/LayoutAdapter.java @@ -42,6 +42,18 @@ public interface LayoutAdapter { */ boolean addBean(XCreator creator, int x, int y); + /** + * 组件的ComponentAdapter在添加组件时,如果发现布局管理器不为空,会继而调用该布局管理器的 + * addComp方法来完成组件的具体添加。在该方法内,布局管理器可以提供额外的功能。 + * + * @param creator 被添加的新组件 + * @param x 添加的位置x,该位置是相对于container的 + * @param y 添加的位置y,该位置是相对于container的 + * @param accept 是否添加新组件 + * @return 是否添加成功,成功返回true,否则false + */ + boolean addBean(XCreator creator, int x, int y, boolean accept); + /** * 返回该布局管理适配器的Painter,为容器提供放置位置的标识。 */ @@ -91,4 +103,4 @@ public interface LayoutAdapter { * @param initHeight 组件之前高度 */ void removeBean(XCreator creator, int initWidth, int initHeight); -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/AbstractLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/AbstractLayoutAdapter.java index 493dd02aa2..e9851a7e87 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/AbstractLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/AbstractLayoutAdapter.java @@ -78,7 +78,23 @@ public abstract class AbstractLayoutAdapter implements LayoutAdapter { */ @Override public boolean addBean(XCreator creator, int x, int y) { - if (!accept(creator, x, y)) { + boolean accept = accept(creator, x, y); + return addBean(creator, x, y, accept); + } + + /** + * 组件的ComponentAdapter在添加组件时,如果发现布局管理器不为空,会继而调用该布局管理器的 + * addComp方法来完成组件的具体添加。在该方法内,布局管理器可以提供额外的功能。 + * + * @param creator 被添加的新组件 + * @param x 添加的位置x,该位置是相对于container的 + * @param y 添加的位置y,该位置是相对于container的 + * @param accept 是否添加新组件 + * @return 是否添加成功,成功返回true,否则false + */ + @Override + public boolean addBean(XCreator creator, int x, int y, boolean accept) { + if (!accept) { return false; } addComp(creator, x, y); @@ -86,6 +102,7 @@ public abstract class AbstractLayoutAdapter implements LayoutAdapter { return true; } + /** * 删除组件 * @@ -186,4 +203,4 @@ public abstract class AbstractLayoutAdapter implements LayoutAdapter { public XLayoutContainer getContainer() { return this.container; } -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java index d5a680b611..2b33159e8b 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java @@ -18,7 +18,8 @@ import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.general.ComparatorUtils; import com.fr.general.act.BorderPacker; -import java.awt.*; +import java.awt.Rectangle; + /** * tab布局tabFit适配器 @@ -73,8 +74,7 @@ public class FRTabFitLayoutAdapter extends FRFitLayoutAdapter { y = adjustY(y, tabLayout); } //这时候应该要用计算后的父fit布局添加 - this.container.getLayoutAdapter().addBean(creator, x, y); - ((XWidgetCreator) creator).recalculateChildrenSize(); + this.container.getLayoutAdapter().addBean(creator, x, y, true); return true; } // 如果不在边缘,容器为本自适应布局,增加组件的位置就是相对于容器的位置 From 7617e9263fa5685fe61b193c0fa424d584284c88 Mon Sep 17 00:00:00 2001 From: vito Date: Fri, 8 Jan 2021 17:42:19 +0800 Subject: [PATCH 4/8] =?UTF-8?q?REPORT-46779REPORT-46779=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E4=B8=BA=E8=B4=9F=E5=AF=BC=E8=87=B4=E5=89=8D=E7=AB=AF=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/icontainer/UIModeControlContainer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java index a589b0c878..73bfa0ef79 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java @@ -166,6 +166,9 @@ public class UIModeControlContainer extends JLayeredPane { } // 拖动的距离,为正值表示往下拖动,为负值表示往上拖动 int deltaY = e.getY(); + if (toolPaneY < 0) { + toolPaneY = 0; + } toolPaneY += deltaY; onResize(toolPaneY); refreshContainer(); From 98b7590a589432807c0cc426b0eb1d51afeef7ea Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 11 Jan 2021 17:20:23 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=9A=84=E6=96=B9=E6=B3=95=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/beans/LayoutAdapter.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/LayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/LayoutAdapter.java index fded86cbe5..e2aa7f1527 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/LayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/LayoutAdapter.java @@ -43,18 +43,6 @@ public interface LayoutAdapter { boolean addBean(XCreator creator, int x, int y); - /** - * 组件的ComponentAdapter在添加组件时,如果发现布局管理器不为空,会继而调用该布局管理器的 - * addComp方法来完成组件的具体添加。在该方法内,布局管理器可以提供额外的功能。 - * - * @param creator 被添加的新组件 - * @param x 添加的位置x,该位置是相对于container的 - * @param y 添加的位置y,该位置是相对于container的 - * @param accept 是否添加新组件 - * @return 是否添加成功,成功返回true,否则false - */ - boolean addBean(XCreator creator, int x, int y, boolean accept); - /** * 组件的ComponentAdapter在添加组件时,如果发现布局管理器不为空,会继而调用该布局管理器的 * addComp方法来完成组件的具体添加。在该方法内,布局管理器可以提供额外的功能。 From ebe3a7fa59e833ff2c7881c76ea4ac2b208f763a Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 29 Jan 2021 13:41:39 +0800 Subject: [PATCH 6/8] =?UTF-8?q?REPORT-47101=20=E6=B5=B7=E5=A4=96=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E9=80=9A=E8=A1=8C=E8=AF=81=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/extra/LoginWebBridge.java | 10 ++++- .../com/fr/design/extra/PluginWebBridge.java | 15 +++++-- .../design/locale/impl/BbsRegisterMark.java | 38 ++++++++++++++++++ .../fr/design/locale/impl/BbsResetMark.java | 38 ++++++++++++++++++ .../fr/design/locale/impl/BbsSpaceMark.java | 39 +++++++++++++++++++ .../java/com/fr/design/upm/UpmBridge.java | 15 +++++-- .../design/mainframe/bbs/BBSLoginDialog.java | 12 ++++-- .../design/mainframe/bbs/UserInfoLabel.java | 7 +++- 8 files changed, 159 insertions(+), 15 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/BbsRegisterMark.java create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/BbsResetMark.java create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/BbsSpaceMark.java diff --git a/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java b/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java index 0862c74472..81e34335a2 100644 --- a/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java +++ b/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java @@ -6,8 +6,12 @@ import com.fr.config.MarketConfig; import com.fr.design.dialog.UIDialog; import com.fr.design.extra.exe.PluginLoginExecutor; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.locale.impl.BbsRegisterMark; +import com.fr.design.locale.impl.BbsResetMark; import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import javafx.concurrent.Task; @@ -118,7 +122,8 @@ public class LoginWebBridge { */ public void registerHref() { try { - Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.register"))); + LocaleMark registerMark = LocaleCenter.getMark(BbsRegisterMark.class); + Desktop.getDesktop().browse(new URI(registerMark.getValue())); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } @@ -129,7 +134,8 @@ public class LoginWebBridge { */ public void forgetHref() { try { - Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.reset"))); + LocaleMark resetMark = LocaleCenter.getMark(BbsResetMark.class); + Desktop.getDesktop().browse(new URI(resetMark.getValue())); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java b/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java index 159e6d6d9c..d709013506 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java @@ -13,8 +13,13 @@ import com.fr.design.extra.exe.PluginLoginExecutor; import com.fr.design.extra.exe.ReadUpdateOnlineExecutor; import com.fr.design.extra.exe.SearchOnlineExecutor; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.locale.impl.BbsRegisterMark; +import com.fr.design.locale.impl.BbsResetMark; +import com.fr.design.locale.impl.BbsSpaceMark; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.general.CloudCenter; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; @@ -434,8 +439,8 @@ public class PluginWebBridge { */ public void getPriviteMessage() { try { - String loginUrl = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); - Desktop.getDesktop().browse(new URI(loginUrl)); + LocaleMark spaceMark = LocaleCenter.getMark(BbsSpaceMark.class); + Desktop.getDesktop().browse(new URI(spaceMark.getValue())); } catch (Exception exp) { FineLoggerFactory.getLogger().info(exp.getMessage()); } @@ -497,7 +502,8 @@ public class PluginWebBridge { */ public void registerHref() { try { - Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.register"))); + LocaleMark registerMark = LocaleCenter.getMark(BbsRegisterMark.class); + Desktop.getDesktop().browse(new URI(registerMark.getValue())); } catch (Exception e) { FineLoggerFactory.getLogger().info(e.getMessage()); } @@ -511,7 +517,8 @@ public class PluginWebBridge { */ public void forgetHref() { try { - Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.reset"))); + LocaleMark resetMark = LocaleCenter.getMark(BbsResetMark.class); + Desktop.getDesktop().browse(new URI(resetMark.getValue())); } catch (Exception e) { FineLoggerFactory.getLogger().info(e.getMessage()); } diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/BbsRegisterMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/BbsRegisterMark.java new file mode 100644 index 0000000000..d5afe26db6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/BbsRegisterMark.java @@ -0,0 +1,38 @@ +package com.fr.design.locale.impl; + +import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleMark; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/1/29 + */ +public class BbsRegisterMark implements LocaleMark { + + private final Map map = new HashMap<>(); + private static final String BBS_REGISTER_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.register"); + private static final String BBS_REGISTER_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.register"); + private static final String BBS_REGISTER_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US"); + private static final String BBS_REGISTER_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US"); + private static final String BBS_REGISTER_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US"); + + public BbsRegisterMark() { + map.put(Locale.CHINA, BBS_REGISTER_CN); + map.put(Locale.KOREA, BBS_REGISTER_KR); + map.put(Locale.JAPAN, BBS_REGISTER_JP); + map.put(Locale.US, BBS_REGISTER_EN); + map.put(Locale.TAIWAN, BBS_REGISTER_TW); + } + + @Override + public String getValue() { + String result = map.get(GeneralContext.getLocale()); + return result == null ? BBS_REGISTER_EN : result; + } +} diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/BbsResetMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/BbsResetMark.java new file mode 100644 index 0000000000..4573aac3a6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/BbsResetMark.java @@ -0,0 +1,38 @@ +package com.fr.design.locale.impl; + +import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleMark; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/1/29 + */ +public class BbsResetMark implements LocaleMark { + + private final Map map = new HashMap<>(); + private static final String BBS_RESET_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.reset"); + private static final String BBS_RESET_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.reset"); + private static final String BBS_RESET_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US"); + private static final String BBS_RESET_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US"); + private static final String BBS_RESET_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US"); + + public BbsResetMark() { + map.put(Locale.CHINA, BBS_RESET_CN); + map.put(Locale.KOREA, BBS_RESET_KR); + map.put(Locale.JAPAN, BBS_RESET_JP); + map.put(Locale.US, BBS_RESET_EN); + map.put(Locale.TAIWAN, BBS_RESET_TW); + } + + @Override + public String getValue() { + String result = map.get(GeneralContext.getLocale()); + return result == null ? BBS_RESET_EN : result; + } +} diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/BbsSpaceMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/BbsSpaceMark.java new file mode 100644 index 0000000000..2303dc2509 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/BbsSpaceMark.java @@ -0,0 +1,39 @@ +package com.fr.design.locale.impl; + +import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleMark; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/1/29 + */ +public class BbsSpaceMark implements LocaleMark { + + private final Map map = new HashMap<>(); + private static final String BBS_SPACE_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); + private static final String BBS_SPACE_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); + private static final String BBS_SPACE_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US"); + private static final String BBS_SPACE_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US"); + private static final String BBS_SPACE_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US"); + + public BbsSpaceMark() { + map.put(Locale.CHINA, BBS_SPACE_CN); + map.put(Locale.KOREA, BBS_SPACE_KR); + map.put(Locale.JAPAN, BBS_SPACE_JP); + map.put(Locale.US, BBS_SPACE_EN); + map.put(Locale.TAIWAN, BBS_SPACE_TW); + } + + @Override + public String getValue() { + String result = map.get(GeneralContext.getLocale()); + return result == null ? BBS_SPACE_EN : result; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java b/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java index 46bb11b3ce..0c25281d50 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java @@ -16,6 +16,9 @@ import com.fr.design.extra.exe.PluginLoginExecutor; import com.fr.design.extra.exe.ReadUpdateOnlineExecutor; import com.fr.design.extra.exe.SearchOnlineExecutor; import com.fr.design.i18n.Toolkit; +import com.fr.design.locale.impl.BbsRegisterMark; +import com.fr.design.locale.impl.BbsResetMark; +import com.fr.design.locale.impl.BbsSpaceMark; import com.fr.design.upm.event.CertificateEvent; import com.fr.design.upm.event.DownloadEvent; import com.fr.design.upm.exec.UpmBrowserExecutor; @@ -23,6 +26,8 @@ import com.fr.design.upm.task.UpmTaskWorker; import com.fr.event.EventDispatcher; import com.fr.general.CloudCenter; import com.fr.general.GeneralUtils; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; @@ -424,8 +429,8 @@ public class UpmBridge { @JSBridge public void getPriviteMessage() { try { - String loginUrl = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); - Desktop.getDesktop().browse(new URI(loginUrl)); + LocaleMark spaceMark = LocaleCenter.getMark(BbsSpaceMark.class); + Desktop.getDesktop().browse(new URI(spaceMark.getValue())); } catch (Exception exp) { FineLoggerFactory.getLogger().info(exp.getMessage()); } @@ -437,7 +442,8 @@ public class UpmBridge { @JSBridge public void forgetHref() { try { - Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.reset"))); + LocaleMark resetMark = LocaleCenter.getMark(BbsResetMark.class); + Desktop.getDesktop().browse(new URI(resetMark.getValue())); } catch (Exception e) { FineLoggerFactory.getLogger().info(e.getMessage()); } @@ -449,7 +455,8 @@ public class UpmBridge { @JSBridge public void registerHref() { try { - Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.register"))); + LocaleMark registerMark = LocaleCenter.getMark(BbsRegisterMark.class); + Desktop.getDesktop().browse(new URI(registerMark.getValue())); } catch (Exception e) { FineLoggerFactory.getLogger().info(e.getMessage()); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java index b37c048e92..114d2e8a6e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSLoginDialog.java @@ -8,11 +8,15 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.locale.impl.BbsRegisterMark; +import com.fr.design.locale.impl.BbsResetMark; import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.http.HttpClient; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.log.FineLoggerFactory; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; @@ -65,6 +69,8 @@ public class BBSLoginDialog extends UIDialog { private UILabel tipLabel; private BoxCenterAligmentPane passwordReset; private BoxCenterAligmentPane registerLabel; + private LocaleMark resetMark = LocaleCenter.getMark(BbsResetMark.class); + private LocaleMark registerMark = LocaleCenter.getMark(BbsRegisterMark.class); private KeyListener keyListener = new KeyAdapter() { public void keyPressed(KeyEvent e) { @@ -113,8 +119,8 @@ public class BBSLoginDialog extends UIDialog { nameField = new UITextField(); passField = new UIPassWordField(); loginButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Login")); - passwordReset = getURLActionLabel(CloudCenter.getInstance().acquireUrlByKind("bbs.reset")); - registerLabel = getURLActionLabel(CloudCenter.getInstance().acquireUrlByKind("bbs.register")); + passwordReset = getURLActionLabel(resetMark.getValue()); + registerLabel = getURLActionLabel(registerMark.getValue()); loginButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { @@ -311,7 +317,7 @@ public class BBSLoginDialog extends UIDialog { private BoxCenterAligmentPane getURLActionLabel(final String url) { ActionLabel actionLabel = new ActionLabel(url); - if (ComparatorUtils.equals(url, CloudCenter.getInstance().acquireUrlByKind("bbs.reset"))) { + if (ComparatorUtils.equals(url, resetMark.getValue())) { actionLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Forgot-Password")); } else { actionLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Register_Account")); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java index 4d168557f6..92a2882545 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -15,6 +15,7 @@ import com.fr.design.extra.WebViewDlgHelper; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; +import com.fr.design.locale.impl.BbsSpaceMark; import com.fr.design.mainframe.DesignerContext; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.upm.event.CertificateEvent; @@ -27,6 +28,8 @@ import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.DateUtils; import com.fr.general.http.HttpClient; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.log.FineLoggerFactory; import com.fr.stable.EncodeConstants; import com.fr.stable.StableUtils; @@ -96,8 +99,8 @@ public class UserInfoLabel extends UILabel { public void mousePressed(MouseEvent e) { if (StringUtils.isNotEmpty(userName)) { try { - String loginUrl = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); - Desktop.getDesktop().browse(new URI(loginUrl)); + LocaleMark spaceMark = LocaleCenter.getMark(BbsSpaceMark.class); + Desktop.getDesktop().browse(new URI(spaceMark.getValue())); } catch (Exception exp) { FineLoggerFactory.getLogger().info(exp.getMessage()); } From fe408bb274a6442539f2990548419994d0076507 Mon Sep 17 00:00:00 2001 From: vito Date: Mon, 1 Feb 2021 14:12:17 +0800 Subject: [PATCH 7/8] =?UTF-8?q?REPORT-46779=20=E6=8A=A5=E8=A1=A8=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E7=AC=AC=E4=B8=80=E8=A1=8C=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/icontainer/UIModeControlContainer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java index 73bfa0ef79..1837711cd1 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java @@ -166,10 +166,10 @@ public class UIModeControlContainer extends JLayeredPane { } // 拖动的距离,为正值表示往下拖动,为负值表示往上拖动 int deltaY = e.getY(); + toolPaneY += deltaY; if (toolPaneY < 0) { toolPaneY = 0; } - toolPaneY += deltaY; onResize(toolPaneY); refreshContainer(); } @@ -244,7 +244,7 @@ public class UIModeControlContainer extends JLayeredPane { }; protected void onModeChanged() { - //do nothing here + //do nothing here } /** @@ -315,7 +315,7 @@ public class UIModeControlContainer extends JLayeredPane { addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { - // do nothing + // do nothing } }); } @@ -340,7 +340,7 @@ public class UIModeControlContainer extends JLayeredPane { @Override public void layoutContainer(Container parent) { - // do nothing + // do nothing } @Override From ac860281bf4fa7521cf258f1f2265d64cdcf5a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 1 Feb 2021 14:33:33 +0800 Subject: [PATCH 8/8] =?UTF-8?q?CHART-18176=20=20=E9=92=BB=E5=8F=96?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E6=A0=87=E8=AE=B0=E7=82=B9=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../map/designer/style/series/VanChartMapAnchorMarkerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java index d34a89b5de..e5040c9df4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java @@ -21,7 +21,7 @@ public class VanChartMapAnchorMarkerPane extends BasicBeanPane