From 68a4c2402ac2e51e5f1906f1ca01598e1fc45706 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Fri, 8 Mar 2024 15:07:36 +0800 Subject: [PATCH 1/5] =?UTF-8?q?REPORT-115048=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E9=87=8C=E6=8E=A7=E4=BB=B6=E8=83=8C=E6=99=AF=E6=A0=8F=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=9A=84=E5=B8=83=E5=B1=80=E5=AE=9E=E7=8E=B0=E5=90=8E=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=9C=89=E7=82=B9=E9=97=AE=E9=A2=98=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=96=B0=E5=B8=83=E5=B1=80=E9=87=8D=E5=86=99UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 1 + .../widget/DesktopWidgetStyleEditPane.java | 15 +++++-- .../edit/widget/WidgetStyleEditPane.java | 13 +++++- .../widgettheme/BaseStyleSettingPane.java | 40 ++++++++++++------- 4 files changed, 50 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index 052b2e40cc..f824ef2e37 100644 --- a/build.gradle +++ b/build.gradle @@ -87,6 +87,7 @@ allprojects { implementation 'com.fr.report:engine-chart:' + frDevVersion implementation 'com.fr.report:engine-i18n:' + frDevVersion implementation 'com.fr.design:design-i18n:' + frDevVersion + implementation 'com.fine.swing.ui:layout:1.0-SNAPSHOT' testImplementation 'org.easymock:easymock:3.5.1' testImplementation 'org.powermock:powermock-module-junit4:1.7.1' testImplementation 'org.powermock:powermock-api-easymock:1.7.1' diff --git a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java index 8bae70e837..69cedccd49 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java @@ -1,9 +1,12 @@ package com.fr.widgettheme.theme.edit.widget; +import com.fine.swing.ui.layout.Column; import com.fr.base.background.ColorBackground; import com.fr.base.theme.TemplateTheme; import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.style.color.NewColorSelectBox; import com.fr.design.utils.DesignUtils; import com.fr.locale.InterProviderFactory; @@ -13,8 +16,6 @@ import com.fr.widgettheme.theme.widget.style.BorderStyle; import com.fr.widgettheme.theme.widget.style.ButtonBackgroundStyle; import com.fr.widgettheme.theme.widget.style.ThemeTextStyle; import com.fr.widgettheme.theme.widget.style.ThemedWidgetStyle; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.i18n.Toolkit; import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants; import com.fr.widgettheme.util.WidgetStyleComponentCombiner; import com.fr.widgettheme.util.WidgetThemeDesignerUtils; @@ -22,6 +23,9 @@ import com.fr.widgettheme.util.WidgetThemeDesignerUtils; import java.awt.Color; import java.awt.Component; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; + /** * 桌面端主题面板 @@ -51,8 +55,7 @@ public class DesktopWidgetStyleEditPane extends WidgetS initSelectBackgroundColorBox(); initFontNameSelectBox(); return new Component[][]{ - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Color")), colorSelectBox}, - new Component[]{WidgetThemeDesignerUtils.createTopAlignmentLabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Widget_Background")), WidgetStyleComponentCombiner.combineWidgetBackgroundComponent(widgetBgColorSelectBox, widgetBgAlphaDragPane, colorSelectBox.getPreferredSize().width)}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Color")), colorSelectBox}, new Component[]{WidgetThemeDesignerUtils.createTopAlignmentLabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Widget_Background")), initBackGroundComponent()}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Line")), lineComboBox}, new Component[]{null, lineComboColorSelectBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Radius")), borderRadiusSpinner}, @@ -63,6 +66,10 @@ public class DesktopWidgetStyleEditPane extends WidgetS }; } + private Column initBackGroundComponent() { + return column(10, cell(widgetBgColorSelectBox), cell(widgetBgAlphaDragPane)).getComponent(); + } + private void initSelectBackgroundColorBox() { selectBackgroundColorBox = new NewColorSelectBox(140, true); selectBackgroundColorBox.setSelectObject(WidgetThemeDisplayConstants.DEFAULT_THEME_COLOR); diff --git a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java index 21a64ad229..39389469a6 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java @@ -1,5 +1,6 @@ package com.fr.widgettheme.theme.edit.widget; +import com.fine.swing.ui.layout.Column; import com.fr.base.theme.TemplateTheme; import com.fr.design.beans.BasicBeanPane; import com.fr.design.designer.IntervalConstants; @@ -29,6 +30,9 @@ import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; + /** * 组件样式编辑基础类 @@ -104,7 +108,7 @@ public class WidgetStyleEditPane extends BasicBeanPane< public Component[][] generateComponent() { return new Component[][]{ new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Color")), colorSelectBox}, - new Component[]{WidgetThemeDesignerUtils.createTopAlignmentLabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Widget_Background")), WidgetStyleComponentCombiner.combineWidgetBackgroundComponent(widgetBgColorSelectBox, widgetBgAlphaDragPane, colorSelectBox.getPreferredSize().width)}, + new Component[]{WidgetThemeDesignerUtils.createTopAlignmentLabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Widget_Background")), initBackGroundComponent()}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Line")), lineComboBox}, new Component[]{null, lineComboColorSelectBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Radius")), borderRadiusSpinner}, @@ -113,6 +117,13 @@ public class WidgetStyleEditPane extends BasicBeanPane< }; } + private Column initBackGroundComponent() { + return column(10, + cell(widgetBgColorSelectBox), + cell(widgetBgAlphaDragPane) + ).getComponent(); + } + private void initCommonStyleEditor() { colorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true); colorSelectBox.setSelectObject(WidgetThemeDisplayConstants.DEFAULT_THEME_COLOR); diff --git a/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java b/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java index ef93914823..7460ee65c8 100644 --- a/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java @@ -1,25 +1,18 @@ package com.fr.design.widgettheme; +import com.fine.swing.ui.layout.Column; import com.fr.base.background.ColorBackground; import com.fr.base.theme.TemplateTheme; -import com.fr.design.gui.frpane.FontSizeComboPane; -import com.fr.design.gui.frpane.UIPercentDragPane; -import com.fr.design.gui.ibutton.UIColorButton; -import com.fr.design.gui.ibutton.UIToggleButton; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.utils.DesignUtils; -import com.fr.general.IOUtils; -import com.fr.util.ColorUtils; -import com.fr.widgettheme.theme.widget.style.BorderStyle; -import com.fr.widgettheme.theme.widget.style.ButtonBackgroundStyle; -import com.fr.widgettheme.theme.widget.style.ThemeTextStyle; -import com.fr.widgettheme.theme.widget.style.ThemedWidgetStyle; -import com.fr.widgettheme.theme.bean.ButtonBackground; import com.fr.design.beans.BasicBeanPane; import com.fr.design.designer.IntervalConstants; import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.gui.frpane.FontSizeComboPane; +import com.fr.design.gui.frpane.UIPercentDragPane; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ibutton.UIColorButton; +import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.LineComboBox; +import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.style.FRFontPane; import com.fr.design.i18n.Toolkit; @@ -28,10 +21,18 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.JTemplate; import com.fr.design.style.color.NewColorSelectBox; +import com.fr.design.utils.DesignUtils; import com.fr.design.widget.ui.designer.component.UIBoundSpinner; import com.fr.form.ui.Widget; import com.fr.general.FRFont; +import com.fr.general.IOUtils; +import com.fr.util.ColorUtils; +import com.fr.widgettheme.theme.bean.ButtonBackground; import com.fr.widgettheme.theme.panel.ButtonStyleDefinedPane; +import com.fr.widgettheme.theme.widget.style.BorderStyle; +import com.fr.widgettheme.theme.widget.style.ButtonBackgroundStyle; +import com.fr.widgettheme.theme.widget.style.ThemeTextStyle; +import com.fr.widgettheme.theme.widget.style.ThemedWidgetStyle; import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants; import com.fr.widgettheme.util.WidgetStyleComponentCombiner; import com.fr.widgettheme.util.WidgetThemeDesignerUtils; @@ -45,6 +46,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; + /** * 样式设置pane抽象类 * @@ -152,10 +156,18 @@ public abstract class BaseStyleSettingPane extends BasicBeanPa paneMap.put(StyleSetting.FONT, frFontPane); paneMap.put(StyleSetting.BTN_BACKGROUND, buttonStyleDefinedPane); paneMap.put(StyleSetting.SELECT_COLOR, selectBgColorBox); - paneMap.put(StyleSetting.WIDGET_BACKGROUND, WidgetStyleComponentCombiner.combineWidgetBackgroundComponent(widgetBgColorSelectBox, widgetBgAlphaDragPane, WidgetThemeDisplayConstants.THEME_PC_WIDGET_BACKGROUND_WIDTH)); + paneMap.put(StyleSetting.WIDGET_BACKGROUND, initBackGroundComponent()); paneMap.put(StyleSetting.ICON_COLOR, iconColorSelectBox); } + private Column initBackGroundComponent() { + return column( + 10, + cell(widgetBgColorSelectBox), + cell(widgetBgAlphaDragPane) + ).getComponent(); + } + protected JPanel createHeadPane() { UILabel headLabel = new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Style_Setting")); String[] titles = new String[]{Toolkit.i18nText("Fine-Design_Widget_Follow_Theme"), Toolkit.i18nText("Fine-Design_Widget_Theme_Custom")}; From b1e17a1e83a6f4cd3f70af80ffa3f096de50cd32 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 20 Mar 2024 17:07:46 +0800 Subject: [PATCH 2/5] =?UTF-8?q?REPORT-115816=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/DesignerEnvManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index c95f1e5cab..10e515f9c7 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -1906,6 +1906,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter, AsyncXmlReada .init("jdkHome", (e) -> this.jdkHome = e.getElementValue()) .init("lastBBSTime", DesignerEnvManager.this::readLastBBSTime) .init("lastBBSNewsTime", DesignerEnvManager.this::readLastBBSNewsTime) + .init("uuid", DesignerEnvManager.this::readUUID) .init("ActivationKey", DesignerEnvManager.this::readActiveKey) .init("status", DesignerEnvManager.this::readActiveStatus) .init(CAS_PARAS, DesignerEnvManager.this::readHttpsParas) From 729f17b3b3023d1dd0e84dabe9504575b5853aa2 Mon Sep 17 00:00:00 2001 From: obo Date: Mon, 25 Mar 2024 16:44:05 +0800 Subject: [PATCH 3/5] =?UTF-8?q?REPORT-116843=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/login/message/DesignerMessageHelper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java b/designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java index f3768629b4..b929335962 100644 --- a/designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java +++ b/designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java @@ -77,6 +77,7 @@ public class DesignerMessageHelper { String url = CloudCenter.getInstance().acquireUrlByKind("designer.message.push", "https://market.fanruan.com/api/v1/message/designer"); Map params = new HashMap<>(); params.put("designerId", DesignerEnvManager.getEnvManager().getUUID()); + params.put("lang", DesignerEnvManager.getEnvManager().getLanguage()); String result = HttpToolbox.post(url, params); JSONObject response = JSONFactory.createJSON(JSON.OBJECT, result); String status = response.optString(STATUS); From ea09be62bc2916ad34fc1dc4cd86f021d53373b4 Mon Sep 17 00:00:00 2001 From: obo Date: Mon, 25 Mar 2024 16:48:11 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E7=94=A8toString?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/login/message/DesignerMessageHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java b/designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java index b929335962..58960d170c 100644 --- a/designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java +++ b/designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java @@ -77,7 +77,7 @@ public class DesignerMessageHelper { String url = CloudCenter.getInstance().acquireUrlByKind("designer.message.push", "https://market.fanruan.com/api/v1/message/designer"); Map params = new HashMap<>(); params.put("designerId", DesignerEnvManager.getEnvManager().getUUID()); - params.put("lang", DesignerEnvManager.getEnvManager().getLanguage()); + params.put("lang", DesignerEnvManager.getEnvManager().getLanguage().toString()); String result = HttpToolbox.post(url, params); JSONObject response = JSONFactory.createJSON(JSON.OBJECT, result); String status = response.optString(STATUS); From af88e1248921983c81c443f41843baf067294a59 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Tue, 26 Mar 2024 11:48:01 +0800 Subject: [PATCH 5/5] =?UTF-8?q?REPORT-116550=20=E6=8E=A7=E4=BB=B6=E5=A2=9E?= =?UTF-8?q?=E5=BC=BA=E6=98=BE=E7=A4=BA=EF=BC=8C=E8=AE=BE=E7=BD=AE=E5=9C=86?= =?UTF-8?q?=E8=A7=92=E5=B1=9E=E6=80=A7=E5=90=8E=E6=97=A0=E6=95=88,?= =?UTF-8?q?=E5=9C=86=E8=A7=92=E8=AE=BE=E7=BD=AE=E6=A1=86=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=95=B0=E5=AD=97=E5=90=8E=EF=BC=8C=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=8C=89=E5=9B=9E=E8=BD=A6=E6=89=8D=E8=83=BD=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E3=80=91=E4=BA=A4=E4=BA=92=E9=97=AE=E9=A2=98=E3=80=82=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E4=BD=BF=E7=94=A8=E7=9A=84UIBoundSpinner=EF=BC=8C?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E9=9D=A2=E6=9D=BF=E5=A4=B1=E7=84=A6=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E8=A7=A6=E5=8F=91=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E7=A1=AE=E8=AE=A4=E4=BF=AE=E6=94=B9=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E3=80=82=E6=94=B9=E4=B8=BAUISpinner=E7=BB=84=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E5=A4=B1=E7=84=A6=E6=97=B6=E8=A7=A6=E5=8F=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widgettheme/BaseStyleSettingPane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java b/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java index 7460ee65c8..a06a872bf1 100644 --- a/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java @@ -14,6 +14,7 @@ import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.style.FRFontPane; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; @@ -22,7 +23,6 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.JTemplate; import com.fr.design.style.color.NewColorSelectBox; import com.fr.design.utils.DesignUtils; -import com.fr.design.widget.ui.designer.component.UIBoundSpinner; import com.fr.form.ui.Widget; import com.fr.general.FRFont; import com.fr.general.IOUtils; @@ -72,7 +72,7 @@ public abstract class BaseStyleSettingPane extends BasicBeanPa */ protected NewColorSelectBox borderColorSelectBox; // 圆角边框 - protected UIBoundSpinner borderRadiusSpinner; + protected UISpinner borderRadiusSpinner; // 字体详细设置 protected FRFontPane frFontPane; // 按钮背景设置 @@ -358,7 +358,7 @@ public abstract class BaseStyleSettingPane extends BasicBeanPa private void initBorderPane() { lineComboBox = new LineComboBox(WidgetThemeDisplayConstants.BORDER_LINE_STYLE_ARRAY); borderColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true); - borderRadiusSpinner = new UIBoundSpinner(0, Integer.MAX_VALUE, 1); + borderRadiusSpinner = new UISpinner(0, Integer.MAX_VALUE, 1); lineComboBox.addItemListener(e -> borderColorSelectBox.setVisible(!Integer.valueOf(0).equals(e.getItem()))); } }