From c903dd6523e28d27271b3459474abfcf3f8cb586 Mon Sep 17 00:00:00 2001 From: obo Date: Fri, 19 Jan 2024 13:37:32 +0800 Subject: [PATCH 01/16] =?UTF-8?q?REPORT-112501=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E7=AE=A1=E7=90=86=E8=8B=B1=E6=96=87=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/edit/chart/ChartTitleAndBackgroundStylePane.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java index 5705935866..2dc0659d00 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartTitleAndBackgroundStylePane.java @@ -83,10 +83,13 @@ public class ChartTitleAndBackgroundStylePane extends AbstractChartStylePane { } protected Component[][] getComponent() { + String chartAreaBgLabelName = Toolkit.i18nText("Fine-Design_Chart_Area_Background_Color"); + UILabel chartAreaBgLabel = new UILabel(chartAreaBgLabelName); + chartAreaBgLabel.setToolTipText(chartAreaBgLabelName); return new Component[][]{ new Component[]{chartFontPane, null}, new Component[]{null, null}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Background_Color")), typeComboBox}, + new Component[]{chartAreaBgLabel, typeComboBox}, new Component[]{null, centerPane}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Grid_Line_Color")), mainGridColor} }; From 743d96946e438f0c5beebc8e583a5f6d969b95f2 Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 25 Jan 2024 17:14:21 +0800 Subject: [PATCH 02/16] =?UTF-8?q?REPORT-112769=20JxUIPane=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=89=A7=E8=A1=8Cjs=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/jxbrowser/JxUIPane.java | 21 +++++++-- .../com/fr/design/jxbrowser/JxUIPaneTest.java | 43 +++++++++++++++++-- 2 files changed, 57 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/jxbrowser/JxUIPane.java b/designer-base/src/main/java/com/fr/design/jxbrowser/JxUIPane.java index 97ffeadc75..463cf39b7d 100644 --- a/designer-base/src/main/java/com/fr/design/jxbrowser/JxUIPane.java +++ b/designer-base/src/main/java/com/fr/design/jxbrowser/JxUIPane.java @@ -206,12 +206,11 @@ public class JxUIPane extends ModernUIPane { * 执行一段js * * @param javaScript 待执行的js脚本 + * @see JxUIPane#executeJS(String) */ public void executeJavaScript(String javaScript) { if (browser != null) { - browser.mainFrame().ifPresent(frame -> { - frame.executeJavaScript(javaScript); - }); + browser.mainFrame().ifPresent(frame -> frame.executeJavaScript(javaScript)); } } @@ -227,6 +226,22 @@ public class JxUIPane extends ModernUIPane { return Optional.ofNullable(frame.executeJavaScript(name)); } + /** + * 执行js脚本并返回,使用范围包含{@link JxUIPane#executeJavaScript(String)},可以代替使用 + * + * @param name 变量命名 + * @return js对象 + */ + public

Optional

executeJS(String name) { + if (browser != null) { + Optional frame = browser.mainFrame(); + if (frame.isPresent()) { + return Optional.ofNullable(frame.get().executeJavaScript(name)); + } + } + return Optional.empty(); + } + /** * 由于自定义scheme目前走的是url,因此路径会被自动转化,比如windows路径下对冒号问题 * C:\\abc 变成 /C/abc,这里对冒号进行编码转义 diff --git a/designer-base/src/test/java/com/fr/design/jxbrowser/JxUIPaneTest.java b/designer-base/src/test/java/com/fr/design/jxbrowser/JxUIPaneTest.java index 0b4bea61c5..c3d735de36 100644 --- a/designer-base/src/test/java/com/fr/design/jxbrowser/JxUIPaneTest.java +++ b/designer-base/src/test/java/com/fr/design/jxbrowser/JxUIPaneTest.java @@ -2,6 +2,7 @@ package com.fr.design.jxbrowser; import com.fr.design.DesignerEnvManager; import com.teamdev.jxbrowser.js.JsAccessible; +import com.teamdev.jxbrowser.js.JsObject; import javax.swing.JButton; import javax.swing.JFrame; @@ -10,6 +11,7 @@ import javax.swing.JPanel; import javax.swing.WindowConstants; import java.awt.BorderLayout; import java.awt.FlowLayout; +import java.util.Optional; public class JxUIPaneTest { @@ -30,16 +32,49 @@ public class JxUIPaneTest { JPanel panel = new JPanel(new FlowLayout()); contentPane.add(panel, BorderLayout.SOUTH); + + testJxUIPaneUpdate(panel, pane); + testExecuteJS1(panel, pane); + testExecuteJS2(panel, pane); + + frame.setVisible(true); + frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + } + + private static void testJxUIPaneUpdate(JPanel container, JxUIPane pane) { JButton button = new JButton("点击我可以看到Swing的弹框,输出填写的信息"); - panel.add(button); button.addActionListener(e -> { Model returnValue = pane.update(); if (returnValue != null) { - JOptionPane.showMessageDialog(frame, String.format("姓名为:%s,年龄为:%d", returnValue.getName(), returnValue.getAge())); + JOptionPane.showMessageDialog(container.getRootPane(), String.format("姓名为:%s,年龄为:%d", returnValue.getName(), returnValue.getAge())); } }); - frame.setVisible(true); - frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + container.add(button); + } + + private static void testExecuteJS1(JPanel container, JxUIPane pane) { + JButton button = new JButton("执行回显js对象内容"); + button.addActionListener(e -> { + pane.executeJavaScript("var pagesize={\"page\":1,\"size\":10};"); + Optional value = pane.executeJS("pagesize"); + value.ifPresent(v -> JOptionPane.showMessageDialog(container.getRootPane(), + String.format("page为:%s,年龄为:%s", v.property("page").get(), v.property("size").get()))); + + }); + container.add(button); + + } + + private static void testExecuteJS2(JPanel container, JxUIPane pane) { + JButton button = new JButton("执行回显数字内容"); + button.addActionListener(e -> { + pane.executeJavaScript("var tom = {\"age\":18};"); + Optional value = pane.executeJS("tom.age"); + JOptionPane.showMessageDialog(container.getRootPane(), + String.format("var tom = {\"age\":18}; age:%s", value.get())); + }); + container.add(button); + } @JsAccessible From 8a89fd2fc78364f90e0196bdacade93dcf2fb732 Mon Sep 17 00:00:00 2001 From: obo Date: Wed, 31 Jan 2024 11:02:26 +0800 Subject: [PATCH 03/16] =?UTF-8?q?REPORT-111619=20=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA-=E6=9B=B4=E5=A4=9A=E7=9A=84=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=85=8D=E7=BD=AE--=E6=8A=A5=E8=A1=A8=E6=94=AF?= =?UTF-8?q?=E6=92=91=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=B9=8B=E5=89=8D=E5=9C=A8=E5=88=AB=E7=9A=84?= =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E6=BC=8F=E6=8F=90=E4=BA=86=EF=BC=8C=E8=A1=A5?= =?UTF-8?q?=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/DesktopWidgetStyleEditPane.java | 10 +++++++- .../widget/MobileWidgetStyleEditPane.java | 16 +++++++++++++ .../edit/widget/WidgetStyleEditPane.java | 5 +--- .../DisplayEnhanceMobileStyleDefinePane.java | 24 +++++++++++++------ .../pane/FreeButtonMobileStyleDefinePane.java | 16 +++++++++++-- .../pane/IconColorMobileStyleDefinePane.java | 2 +- .../pane/LabelMobileStyleDefinePane.java | 4 ++-- .../pane/TextAreaMobileStyleDefinePane.java | 2 +- ...dgetThemeMobileStyleDefinePaneCreator.java | 4 ++-- .../widgettheme/BaseStyleSettingPane.java | 2 +- 10 files changed, 64 insertions(+), 21 deletions(-) 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 bc21732be3..8bae70e837 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 @@ -2,6 +2,7 @@ package com.fr.widgettheme.theme.edit.widget; 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.style.color.NewColorSelectBox; import com.fr.design.utils.DesignUtils; @@ -57,7 +58,7 @@ public class DesktopWidgetStyleEditPane extends WidgetS new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Radius")), borderRadiusSpinner}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Icon_Color")), iconColorSelectBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Text_Style")), fontNameSelectBox}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Text_Style")), WidgetStyleComponentCombiner.combineTextStyleComponent(fontSizePane, fontColorButton, bold, italic)}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Text_Style")), WidgetStyleComponentCombiner.combineTextStyleComponent(fontSizePane, fontColorButton, italic, bold)}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Background_Select_Box")), selectBackgroundColorBox} }; } @@ -154,4 +155,11 @@ public class DesktopWidgetStyleEditPane extends WidgetS widgetBgColorSelectBox.setSelectObject(ColorUtils.ignoreColorAlpha(style.getWidgetBackground().getColor())); widgetBgAlphaDragPane.populateBean(ColorUtils.roundColorAlphaDouble(style.getWidgetBackground().getColor())); } + + @Override + public void initLineBox() { + lineComboBox = new LineComboBox(WidgetThemeDisplayConstants.BORDER_LINE_STYLE_ARRAY); + lineComboColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true); + lineComboBox.addItemListener(e -> lineComboColorSelectBox.setVisible(!Integer.valueOf(0).equals(e.getItem()))); + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/MobileWidgetStyleEditPane.java b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/MobileWidgetStyleEditPane.java index ec6ef9aebb..b843dbef3d 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/MobileWidgetStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/MobileWidgetStyleEditPane.java @@ -1,7 +1,10 @@ package com.fr.widgettheme.theme.edit.widget; +import com.fr.base.background.ColorBackground; import com.fr.base.theme.TemplateTheme; import com.fr.design.gui.frpane.FontSizeComboPane; +import com.fr.design.style.color.NewColorSelectBox; +import com.fr.util.ColorUtils; import com.fr.widgettheme.theme.widget.style.BorderStyle; import com.fr.widgettheme.theme.widget.style.MobileThemedWidgetStyle; import com.fr.design.gui.icombobox.LineComboBox; @@ -36,6 +39,8 @@ public class MobileWidgetStyleEditPane extends WidgetSt public void initLineBox() { lineComboBox = new LineComboBox(WidgetThemeDisplayConstants.MOBILE_BORDER_LINE_STYLE_ARRAY); lineComboBox.setSelectedLineStyle(com.fr.stable.Constants.LINE_THIN); + lineComboColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true); + lineComboBox.addItemListener(e -> lineComboColorSelectBox.setVisible(!Integer.valueOf(0).equals(e.getItem()))); } @Override @@ -51,10 +56,16 @@ public class MobileWidgetStyleEditPane extends WidgetSt t.setMobileWidgetStyle(style); } colorSelectBox.setSelectObject(style.getThemeColor()); + widgetBgColorSelectBox.setSelectObject(ColorUtils.ignoreColorAlpha(style.getSelectBackgroundColor())); + widgetBgAlphaDragPane.populateBean(ColorUtils.roundColorAlphaDouble(style.getSelectBackgroundColor())); lineComboBox.setSelectedLineStyle(style.getBorderStyle().getLineType()); + lineComboColorSelectBox.setSelectObject(style.getBorderStyle().getBorderColor()); + iconColorSelectBox.setSelectObject(style.getIconColor()); borderRadiusSpinner.setValue(style.getBorderStyle().getRadius()); fontSizePane.setValue(style.getTextStyle().getFontSize()); fontColorButton.setColor(style.getTextStyle().getFontColor()); + bold.setSelected(style.getTextStyle().isBold()); + italic.setSelected(style.getTextStyle().isItalic()); } @Override @@ -65,13 +76,18 @@ public class MobileWidgetStyleEditPane extends WidgetSt t.setMobileWidgetStyle(style); } style.setThemeColor(colorSelectBox.getSelectObject()); + style.setWidgetBackground(ColorUtils.createColorBackgroundWithAlpha(widgetBgColorSelectBox.getSelectObject(), widgetBgAlphaDragPane.updateBean())); BorderStyle borderStyle = new BorderStyle(); borderStyle.setLineType(lineComboBox.getSelectedLineStyle()); borderStyle.setRadius((int) borderRadiusSpinner.getValue()); + borderStyle.setBorderColor(lineComboColorSelectBox.getSelectObject()); style.setBorderStyle(borderStyle); + style.setIconColor(iconColorSelectBox.getSelectObject()); ThemeTextStyle textStyle = new ThemeTextStyle(); textStyle.setFontSize(fontSizePane.getValue()); textStyle.setFontColor(fontColorButton.getColor()); + textStyle.setBold(bold.isSelected()); + textStyle.setItalic(italic.isSelected()); style.setTextStyle(textStyle); } 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 8a0062d040..21a64ad229 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 @@ -109,7 +109,7 @@ public class WidgetStyleEditPane extends BasicBeanPane< new Component[]{null, lineComboColorSelectBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Radius")), borderRadiusSpinner}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Icon_Color")), iconColorSelectBox}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Text_Style")), WidgetStyleComponentCombiner.combineTextStyleComponent(fontSizePane, fontColorButton, bold, italic)} + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Text_Style")), WidgetStyleComponentCombiner.combineTextStyleComponent(fontSizePane, fontColorButton, italic, bold)} }; } @@ -135,9 +135,6 @@ public class WidgetStyleEditPane extends BasicBeanPane< * 初始化边框线型 */ public void initLineBox() { - lineComboBox = new LineComboBox(WidgetThemeDisplayConstants.BORDER_LINE_STYLE_ARRAY); - lineComboColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true); - lineComboBox.addItemListener(e -> lineComboColorSelectBox.setVisible(!Integer.valueOf(0).equals(e.getItem()))); } diff --git a/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/DisplayEnhanceMobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/DisplayEnhanceMobileStyleDefinePane.java index a17f51874c..035fb32e5b 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/DisplayEnhanceMobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/DisplayEnhanceMobileStyleDefinePane.java @@ -121,6 +121,7 @@ public class DisplayEnhanceMobileStyleDefinePane extends BasicBeanPane extends BasicBeanPa paneMap.put(StyleSetting.THEME_COLOR, colorSelectBox); paneMap.put(StyleSetting.LINE_TYPE, lineComboBox); paneMap.put(StyleSetting.LINE_COLOR, borderColorSelectBox); - paneMap.put(StyleSetting.TEXT_STYLE, WidgetStyleComponentCombiner.combineTextStyleComponent(fontNameSelectBox, fontSizePane, fontColorButton, bold, italic)); + paneMap.put(StyleSetting.TEXT_STYLE, WidgetStyleComponentCombiner.combineTextStyleComponent(fontNameSelectBox, fontSizePane, fontColorButton, italic, bold)); paneMap.put(StyleSetting.BORDER_RADIUS, borderRadiusSpinner); paneMap.put(StyleSetting.FONT, frFontPane); paneMap.put(StyleSetting.BTN_BACKGROUND, buttonStyleDefinedPane); From 8f23325ecd48ea05c6d273896adf9f785da853af Mon Sep 17 00:00:00 2001 From: obo Date: Wed, 31 Jan 2024 17:51:53 +0800 Subject: [PATCH 04/16] =?UTF-8?q?REPORT-111619=20=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA-=E6=9B=B4=E5=A4=9A=E7=9A=84=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=85=8D=E7=BD=AE--=E6=8A=A5=E8=A1=A8=E6=94=AF?= =?UTF-8?q?=E6=92=91=20=E8=87=AA=E6=B5=8B=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/edit/widget/MobileWidgetStyleEditPane.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/MobileWidgetStyleEditPane.java b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/MobileWidgetStyleEditPane.java index b843dbef3d..0e5200418f 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/MobileWidgetStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/MobileWidgetStyleEditPane.java @@ -1,6 +1,5 @@ package com.fr.widgettheme.theme.edit.widget; -import com.fr.base.background.ColorBackground; import com.fr.base.theme.TemplateTheme; import com.fr.design.gui.frpane.FontSizeComboPane; import com.fr.design.style.color.NewColorSelectBox; @@ -56,8 +55,8 @@ public class MobileWidgetStyleEditPane extends WidgetSt t.setMobileWidgetStyle(style); } colorSelectBox.setSelectObject(style.getThemeColor()); - widgetBgColorSelectBox.setSelectObject(ColorUtils.ignoreColorAlpha(style.getSelectBackgroundColor())); - widgetBgAlphaDragPane.populateBean(ColorUtils.roundColorAlphaDouble(style.getSelectBackgroundColor())); + widgetBgColorSelectBox.setSelectObject(ColorUtils.ignoreColorAlpha(style.getWidgetBackground().getColor())); + widgetBgAlphaDragPane.populateBean(ColorUtils.roundColorAlphaDouble(style.getWidgetBackground().getColor())); lineComboBox.setSelectedLineStyle(style.getBorderStyle().getLineType()); lineComboColorSelectBox.setSelectObject(style.getBorderStyle().getBorderColor()); iconColorSelectBox.setSelectObject(style.getIconColor()); From d225c0aba195a61f65a44ab83510d244053f26fa Mon Sep 17 00:00:00 2001 From: obo Date: Thu, 1 Feb 2024 17:00:49 +0800 Subject: [PATCH 05/16] =?UTF-8?q?REPORT-111619=20=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA-=E6=9B=B4=E5=A4=9A=E7=9A=84=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=85=8D=E7=BD=AE--=E6=8A=A5=E8=A1=A8=E6=94=AF?= =?UTF-8?q?=E6=92=91=20=E8=87=AA=E6=B5=8B=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/pane/FileEditorMobileStyleDefinePane.java | 10 ++++++++-- .../WidgetThemeMobileStyleDefinePaneCreator.java | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/FileEditorMobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/FileEditorMobileStyleDefinePane.java index 801585f429..a56e84aaa6 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/FileEditorMobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/FileEditorMobileStyleDefinePane.java @@ -1,6 +1,7 @@ package com.fr.widgettheme.widget.mobile.pane; import com.fr.base.background.ColorBackground; +import com.fr.util.ColorUtils; import com.fr.widgettheme.theme.widget.mobile.style.FileEditorStyle; import com.fr.design.mainframe.mobile.ui.MobileStyleCustomDefinePane; import com.fr.form.ui.Widget; @@ -8,6 +9,8 @@ import com.fr.form.ui.mobile.MobileCommonExtraStyle; import com.fr.form.ui.mobile.MobileStyle; import com.fr.invoke.Reflect; +import java.awt.Color; + /** * 文件属性定义面板 * @@ -28,7 +31,9 @@ public class FileEditorMobileStyleDefinePane extends DisplayEnhanceMobileStyleDe FileEditorStyle style = (FileEditorStyle) extraStyle; customCombo.setSelectedIndex(style.isCustom() ? 1 : 0); if (style.getWidgetBackground() != null) { - widgetBackgroundSelectBox.setSelectObject(((ColorBackground) style.getWidgetBackground()).getColor()); + Color widgetBackgroundColor = ((ColorBackground) style.getWidgetBackground()).getColor(); + widgetBackgroundSelectBox.setSelectObject(ColorUtils.ignoreColorAlpha(widgetBackgroundColor)); + widgetBgAlphaDragPane.populateBean(ColorUtils.roundColorAlphaDouble(widgetBackgroundColor)); } borderType.setSelectedLineStyle(style.getBorderType()); borderRadius.setValue(style.getBorderRadius()); @@ -41,9 +46,10 @@ public class FileEditorMobileStyleDefinePane extends DisplayEnhanceMobileStyleDe mobileStyle = Reflect.on(mobileStyleClazz).create().get(); FileEditorStyle extraStyle = new FileEditorStyle(); extraStyle.setCustom(customCombo.getSelectedIndex() == 1); - extraStyle.setWidgetBackground(ColorBackground.getInstance(widgetBackgroundSelectBox.getSelectObject())); + extraStyle.setWidgetBackground(ColorUtils.createColorBackgroundWithAlpha(widgetBackgroundSelectBox.getSelectObject(), widgetBgAlphaDragPane.updateBean())); extraStyle.setBorderType(borderType.getSelectedLineStyle()); extraStyle.setBorderRadius(borderRadius.getValue()); + extraStyle.setBorderColor(borderColorSelectBox.getSelectObject()); mobileStyle.setMobileCommonExtraStyle(extraStyle); this.widget.setMobileStyle(mobileStyle); this.customBeanPane.updateBean(); diff --git a/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/provider/WidgetThemeMobileStyleDefinePaneCreator.java b/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/provider/WidgetThemeMobileStyleDefinePaneCreator.java index 840d67ba92..a8aca84dcc 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/provider/WidgetThemeMobileStyleDefinePaneCreator.java +++ b/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/provider/WidgetThemeMobileStyleDefinePaneCreator.java @@ -8,6 +8,7 @@ import com.fr.form.ui.Password; import com.fr.form.ui.TextArea; import com.fr.form.ui.TextEditor; import com.fr.form.ui.TreeComboBoxEditor; +import com.fr.form.ui.TreeEditor; import com.fr.widgettheme.util.WidgetThemeDesignerUtils; import com.fr.widgettheme.utils.WidgetThemeServerUtils; import com.fr.widgettheme.widget.mobile.pane.DisplayEnhanceMobileStyleDefinePane; @@ -60,6 +61,7 @@ public class WidgetThemeMobileStyleDefinePaneCreator { ICON_WIDGET_SET.add(ComboBox.class); ICON_WIDGET_SET.add(ComboCheckBox.class); ICON_WIDGET_SET.add(TreeComboBoxEditor.class); + ICON_WIDGET_SET.add(TreeEditor.class); } /** * 创建移动端控件样式属性窗口 From b269562fa7af7d6138d497150df45b2e1e6f82df Mon Sep 17 00:00:00 2001 From: obo Date: Fri, 2 Feb 2024 09:58:48 +0800 Subject: [PATCH 06/16] =?UTF-8?q?REPORT-111619=20=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E9=9D=A2=E6=9D=BF=E7=9A=84=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E5=90=8D=E9=9D=A2=E6=9D=BF=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/widgettheme/BaseStyleSettingPane.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 100098a446..ef93914823 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 @@ -7,6 +7,7 @@ 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; @@ -136,6 +137,7 @@ public abstract class BaseStyleSettingPane extends BasicBeanPa buttonStyleDefinedPane = new ButtonStyleDefinedPane(); selectBgColorBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true); iconColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true); + fontNameSelectBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); fontSizePane = new FontSizeComboPane(); fontColorButton = new UIColorButton(); bold = new UIToggleButton(IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); @@ -268,6 +270,15 @@ public abstract class BaseStyleSettingPane extends BasicBeanPa if (fontColorButton != null) { this.fontColorButton.setColor(textStyle.getFontColor()); } + if (bold != null) { + this.bold.setSelected(textStyle.isBold()); + } + if (italic != null) { + this.italic.setSelected(textStyle.isItalic()); + } + if (fontNameSelectBox != null) { + this.fontNameSelectBox.setSelectedItem(textStyle.getName()); + } } private void setFrFontPane(FRFont font) { From d943917c95c42fd5f28996be395995153fc08d94 Mon Sep 17 00:00:00 2001 From: obo Date: Fri, 2 Feb 2024 16:35:59 +0800 Subject: [PATCH 07/16] =?UTF-8?q?REPORT-111619=20=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA-=E6=9B=B4=E5=A4=9A=E7=9A=84=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=85=8D=E7=BD=AE--=E6=8A=A5=E8=A1=A8=E6=94=AF?= =?UTF-8?q?=E6=92=91=20=E8=87=AA=E6=B5=8B=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/mobile/pane/FileEditorMobileStyleDefinePane.java | 1 + .../widget/mobile/pane/FreeButtonMobileStyleDefinePane.java | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/FileEditorMobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/FileEditorMobileStyleDefinePane.java index a56e84aaa6..58e255b051 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/FileEditorMobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/FileEditorMobileStyleDefinePane.java @@ -37,6 +37,7 @@ public class FileEditorMobileStyleDefinePane extends DisplayEnhanceMobileStyleDe } borderType.setSelectedLineStyle(style.getBorderType()); borderRadius.setValue(style.getBorderRadius()); + borderColorSelectBox.setSelectObject(style.getBorderColor()); } this.customBeanPane.populateBean(ob); } diff --git a/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/FreeButtonMobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/FreeButtonMobileStyleDefinePane.java index e172a56665..7c3af9b127 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/FreeButtonMobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/widget/mobile/pane/FreeButtonMobileStyleDefinePane.java @@ -6,9 +6,6 @@ import com.fr.form.ui.Widget; import com.fr.form.ui.mobile.MobileStyle; import com.fr.util.ColorUtils; import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants; -import com.fr.widgettheme.util.WidgetThemeDesignerUtils; - -import java.awt.Color; /** * 按钮控件通用属性面板 @@ -39,7 +36,7 @@ public class FreeButtonMobileStyleDefinePane extends DisplayEnhanceMobileStyleDe @Override protected void initBackgroundColor() { widgetBackgroundSelectBox.setSelectObject(getCurrentTemplateThemeColor()); - widgetBgAlphaDragPane.populateBean(0); + widgetBgAlphaDragPane.populateBean(1); } @Override From 2ac4d4312e38bfe989ae8c4cc9a15ab01bba27e9 Mon Sep 17 00:00:00 2001 From: lixing Date: Sun, 4 Feb 2024 10:13:01 +0800 Subject: [PATCH 08/16] =?UTF-8?q?REPORT-114164=20=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=89=A9=E5=B1=95=E6=A0=B7=E5=BC=8F-=E5=9B=BE=E6=96=87?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=9B=BE=E6=A0=87=E6=A0=BC=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=87=B312=E4=B8=AA=E4=BB=A5=E4=B8=8A=EF=BC=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ui/radiogroup/ImageCustomDefinePane.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/ImageCustomDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/ImageCustomDefinePane.java index ee990459a8..2a23720de1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/ImageCustomDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/ImageCustomDefinePane.java @@ -9,6 +9,7 @@ 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.gui.ilable.UILabel; +import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; @@ -83,6 +84,14 @@ public class ImageCustomDefinePane extends MobileStyleCustomDefinePane { protected JPanel createContentPane() { return scrollPanel; } + + @Override + protected void setLeftContentPaneBounds(Container parent, UIScrollBar scrollBar, int beginY, int maxheight) { + int width = parent.getWidth(); + int height = parent.getHeight(); + leftcontentPane.setBounds(0, -beginY, width - scrollBar.getWidth() + getOverWidth(), leftcontentPane.getPreferredSize().height); + scrollBar.setBounds(width - scrollBar.getWidth(), 0, scrollBar.getWidth(), height); + } }; this.add(basicScrollPane); } From 268478dc5ab62e6beacf898b630fbd5965a42241 Mon Sep 17 00:00:00 2001 From: lixing Date: Sun, 4 Feb 2024 10:13:49 +0800 Subject: [PATCH 09/16] =?UTF-8?q?REPORT-114305=20=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=89=A9=E5=B1=95=E6=A0=B7=E5=BC=8F=E2=80=94=E7=AD=89=E5=88=86?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E3=80=81=E8=87=AA=E7=84=B6=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E6=95=88=E6=9E=9C=E9=83=BD=E5=8F=8D=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/mobile/ui/radiogroup/ImageCustomDefinePane.java | 3 ++- .../mainframe/mobile/ui/radiogroup/UnitedCustomDefinePane.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/ImageCustomDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/ImageCustomDefinePane.java index 2a23720de1..30fbe2d4a9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/ImageCustomDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/ImageCustomDefinePane.java @@ -166,9 +166,10 @@ public class ImageCustomDefinePane extends MobileStyleCustomDefinePane { private void initButtonAlignPane() { UILabel buttonAlignLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment")); buttonAlignCombo = new UIComboBox(new String[]{ - Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment_Split"), Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment_Nature"), + Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment_Split"), }); + buttonAlignCombo.setSelectedIndex(1); buttonAlignCombo.setPreferredSize(new Dimension(DesignerUtils.LARGE_COMBO_WIDTH, 20)); buttonAlignPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{buttonAlignLabel, buttonAlignCombo}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_SMALL); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/UnitedCustomDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/UnitedCustomDefinePane.java index 7280d1696d..0badf3498d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/UnitedCustomDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/UnitedCustomDefinePane.java @@ -143,9 +143,10 @@ public class UnitedCustomDefinePane extends MobileStyleCustomDefinePane { JPanel hPaddingSpinnerPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{leftSpinnerPanel, rightSpinnerPanel}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, LayoutConstants.VGAP_SMALL); // 按钮排布下拉框 buttonAlignCombo = new UIComboBox(new String[]{ - Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment_Split"), Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment_Nature"), + Toolkit.i18nText("Fine-Plugin-RadioGroup_Alignment_Split") }); + buttonAlignCombo.setSelectedIndex(1); buttonAlignCombo.setPreferredSize(new Dimension(DesignerUtils.NORMAL_COMBO_WIDTH, 20)); double p = TableLayout.PREFERRED; double[] rowSize = {p, p, p}; From d15d7538a1f7bd225e1683f819d54969e4d5c9f9 Mon Sep 17 00:00:00 2001 From: obo Date: Sun, 4 Feb 2024 15:22:06 +0800 Subject: [PATCH 10/16] =?UTF-8?q?REPORT-111619=20=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA-=E6=9B=B4=E5=A4=9A=E7=9A=84=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=85=8D=E7=BD=AE--=E6=8A=A5=E8=A1=A8=E6=94=AF?= =?UTF-8?q?=E6=92=91=20=E4=B8=BB=E9=A2=98=E9=A2=84=E8=A7=88=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=94=AF=E6=8C=81=E6=8E=A7=E4=BB=B6=E5=8F=8A=E6=8F=90?= =?UTF-8?q?=E5=8D=87=E8=B7=9F=E9=9A=8Ftab=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/TemplateThemeEditorPane.java | 17 +++++ .../theme/TemplateThemeProfilePane.java | 30 +++++++-- .../theme/preview/ThemePreviewed.java | 12 ++++ .../fr/widgettheme/ThemePreviewTerminal.java | 62 +++++++++++++++++++ .../widget/WidgetStyleEditContainerPane.java | 5 ++ .../theme/panel/ControlPreviewCell.java | 26 +++++--- .../theme/panel/ControlPreviewPane.java | 8 ++- .../theme/panel/NormalButtonPreviewCell.java | 15 +++-- .../theme/panel/TextPreviewCell.java | 17 +++-- .../WidgetDisplayFormThemePreviewPane.java | 8 ++- .../WidgetDisplayReportThemePreviewPane.java | 8 ++- 11 files changed, 176 insertions(+), 32 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/widgettheme/ThemePreviewTerminal.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java index 963f387f33..5432109dc0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java @@ -5,6 +5,7 @@ import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateThemeConfig; import com.fr.base.theme.settings.ThemedCellStyleList; import com.fr.base.theme.settings.ThemedColorScheme; +import com.fr.widgettheme.ThemePreviewTerminal; import com.fr.widgettheme.util.WidgetThemeDesignerUtils; import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; @@ -340,4 +341,20 @@ public abstract class TemplateThemeEditorPane extends J } } } + + /** + * 开启控件显示增强时,从配置面板处获取主题样式预览的终端类型 + * 默认为PC端,兼容原有场景 + */ + public ThemePreviewTerminal getWidgetStyleEditorTerminal() { + if (!WidgetThemeDesignerUtils.enableWidgetEnhance()) { + return ThemePreviewTerminal.PC; + } + for (BasicBeanPane pane : extraPaneList) { + if (pane instanceof WidgetStyleEditContainerPane) { + return ((WidgetStyleEditContainerPane) pane).getTerminalStyle(); + } + } + return ThemePreviewTerminal.PC; + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java index 92acb5c71e..c79ccd9090 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java @@ -14,12 +14,13 @@ import com.fr.design.mainframe.theme.dialog.TemplateThemeProfileDialog; import com.fr.design.mainframe.theme.edit.ui.LabelUtils; import com.fr.design.mainframe.theme.ui.AutoCheckTextField; import com.fr.design.mainframe.theme.ui.AutoCheckThemeNameTextField; -import com.fr.design.mainframe.theme.ui.BorderUtils; import com.fr.design.mainframe.toast.DesignerToastMsgUtil; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.transaction.CallBackAdaptor; +import com.fr.widgettheme.ThemePreviewTerminal; +import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants; import javax.swing.BorderFactory; import javax.swing.JDialog; @@ -51,7 +52,8 @@ public abstract class TemplateThemeProfilePane extends protected TemplateThemePreviewPane themePreviewPane; protected TemplateThemeEditorPane themeEditorPane; - + protected UILabel leftTitleLabel; + protected UILabel leftTitlePromptLabel; protected boolean isPopulating = false; protected boolean isMutable = false; @@ -83,10 +85,9 @@ public abstract class TemplateThemeProfilePane extends private JPanel createLeftPane() { JPanel titleContainer = FRGUIPaneFactory.createBorderLayout_S_Pane(); titleContainer.setPreferredSize(new Dimension(LEFT_TITLE_PANE_WIDTH, LEFT_TITLE_PANE_HEIGHT)); - titleContainer.setBorder(BorderUtils.createTitleBorder(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Preview_Pane_Title"), TITLE_BORDER_FONT)); - JPanel previewContainer = FRGUIPaneFactory.createBorderLayout_S_Pane(); previewContainer.setBorder(BorderFactory.createEmptyBorder(5, 4, 10, 4)); + titleContainer.add(createTitlePane(), BorderLayout.NORTH); titleContainer.add(previewContainer, BorderLayout.CENTER); themePreviewPane = createThemePreviewPane(); @@ -103,7 +104,10 @@ public abstract class TemplateThemeProfilePane extends if (isPopulating) { return; } - themePreviewPane.refresh(updateBean()); + ThemePreviewTerminal terminal = themeEditorPane.getWidgetStyleEditorTerminal(); + themePreviewPane.refresh(updateBean(), terminal); + String prompt = terminal == ThemePreviewTerminal.PC ? Toolkit.i18nText("Fine-Design_Theme_Control_PC_Prompt") : Toolkit.i18nText("Fine-Design_Theme_Control_Mobile_Prompt"); + leftTitlePromptLabel.setText(prompt); saveButton.setEnabled(themeEditorPane.checkNameValid() && isMutable); } }); @@ -367,4 +371,20 @@ public abstract class TemplateThemeProfilePane extends @Override public void onSaved(TemplateTheme theme) {} } + + /** + * 创建预览界面标题面板 + */ + protected JPanel createTitlePane() { + JPanel titlePane = new JPanel(); + titlePane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); + titlePane.setLayout(new BorderLayout()); + leftTitleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Preview_Pane_Title")); + leftTitlePromptLabel = new UILabel(Toolkit.i18nText("Fine-Design_Theme_Control_PC_Prompt")); + leftTitleLabel.setForeground(WidgetThemeDisplayConstants.THEME_PREVIEW_TITLE_COLOR); + leftTitlePromptLabel.setForeground(WidgetThemeDisplayConstants.COMPATIBLE_STYLE_FONT_COLOR); + titlePane.add(leftTitleLabel, BorderLayout.WEST); + titlePane.add(leftTitlePromptLabel, BorderLayout.EAST); + return titlePane; + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ThemePreviewed.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ThemePreviewed.java index bb2aa05c22..272c7716c8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ThemePreviewed.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ThemePreviewed.java @@ -1,5 +1,7 @@ package com.fr.design.mainframe.theme.preview; +import com.fr.widgettheme.ThemePreviewTerminal; + /** * @author Starryi * @version 1.0 @@ -7,4 +9,14 @@ package com.fr.design.mainframe.theme.preview; */ public interface ThemePreviewed { void refresh(T style); + + /** + * 根据主题预览样式类型进行刷新 + * + * @param style 样式,可以包含多个终端展现效果 + * @param terminal 终端类型 + */ + default void refresh(T style, ThemePreviewTerminal terminal) { + refresh(style); + } } diff --git a/designer-base/src/main/java/com/fr/widgettheme/ThemePreviewTerminal.java b/designer-base/src/main/java/com/fr/widgettheme/ThemePreviewTerminal.java new file mode 100644 index 0000000000..844e642191 --- /dev/null +++ b/designer-base/src/main/java/com/fr/widgettheme/ThemePreviewTerminal.java @@ -0,0 +1,62 @@ +package com.fr.widgettheme; + +import com.fr.base.theme.TemplateTheme; +import com.fr.widgettheme.theme.widget.style.MobileThemedWidgetStyle; +import com.fr.widgettheme.theme.widget.style.ThemedWidgetStyle; + +/** + * 主题样式预览终端类型 + * + * @author obo + * @since 11.0 + * Created on 2024/2/2 + */ +public enum ThemePreviewTerminal { + + /** + * 桌面端,为默认类型 + */ + PC(0) { + @Override + public ThemedWidgetStyle getThemeWidgetStyle(TemplateTheme theme) { + return (ThemedWidgetStyle) theme.getWidgetStyle(); + } + }, + + /** + * 移动端 + */ + MOBILE(1) { + @Override + public ThemedWidgetStyle getThemeWidgetStyle(TemplateTheme theme) { + return (MobileThemedWidgetStyle) theme.getMobileWidgetStyle(); + } + }; + + /** + * 类型码 + */ + final int code; + + ThemePreviewTerminal(int code) { + this.code = code; + } + + public int getCode() { + return code; + } + + public abstract ThemedWidgetStyle getThemeWidgetStyle(TemplateTheme theme); + + /** + * 根据code获取对应的枚举 + */ + public static ThemePreviewTerminal getTypeByCode(int code) { + for (ThemePreviewTerminal type : ThemePreviewTerminal.values()) { + if (type.code == code) { + return type; + } + } + throw new IllegalArgumentException("Invalid ThemePreviewTerminalType code :" + code); + } +} diff --git a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditContainerPane.java b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditContainerPane.java index 789c0f61ac..16e4a4f58c 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditContainerPane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditContainerPane.java @@ -8,6 +8,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.widgettheme.ThemePreviewTerminal; import org.jetbrains.annotations.Nullable; import javax.swing.JPanel; @@ -133,4 +134,8 @@ public class WidgetStyleEditContainerPane extends Basic protected String title4PopupWindow() { return Toolkit.i18nText("Fine-Design_Theme_Widget_Style"); } + + public ThemePreviewTerminal getTerminalStyle() { + return ThemePreviewTerminal.getTypeByCode(terminalStyleGroup.getSelectedIndex()); + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCell.java b/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCell.java index b42c26fcfb..ec36032713 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCell.java +++ b/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewCell.java @@ -3,6 +3,8 @@ package com.fr.widgettheme.theme.panel; import com.fr.base.BaseUtils; import com.fr.base.Style; import com.fr.base.theme.TemplateTheme; +import com.fr.widgettheme.ThemePreviewTerminal; +import com.fr.widgettheme.theme.widget.style.ThemeTextStyle; import com.fr.widgettheme.theme.widget.style.ThemedWidgetStyle; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.FRFont; @@ -14,7 +16,6 @@ import javax.swing.ImageIcon; import javax.swing.JPanel; import java.awt.Color; import java.awt.Dimension; -import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.LayoutManager; @@ -39,6 +40,11 @@ public class ControlPreviewCell extends JPanel { */ protected String value; protected TemplateTheme reportTheme; + + /** + * 主题预览类型,默认为PC端 + */ + protected ThemePreviewTerminal themePreviewTerminal = ThemePreviewTerminal.PC; /** * 字体的颜色 */ @@ -70,9 +76,10 @@ public class ControlPreviewCell extends JPanel { /** * 主题样式变化后监听改变 */ - public void refresh(TemplateTheme reportTheme) { + public void refresh(TemplateTheme reportTheme, ThemePreviewTerminal type) { this.reportTheme = reportTheme; - ThemedWidgetStyle widgetStyle = (ThemedWidgetStyle) this.reportTheme.getWidgetStyle(); + this.themePreviewTerminal = type; + ThemedWidgetStyle widgetStyle = this.themePreviewTerminal.getThemeWidgetStyle(reportTheme); //主题色设置为透明或者插件启动前已有的主题启动插件后主题色为null if (widgetStyle.getThemeColor() == null) { widgetStyle.setThemeColor(DEFAULT_THEME_COLOR); @@ -87,8 +94,7 @@ public class ControlPreviewCell extends JPanel { } public Color getIconColor() { - ThemedWidgetStyle widgetStyle = (ThemedWidgetStyle) reportTheme.getWidgetStyle(); - return widgetStyle.getIconColor(); + return this.themePreviewTerminal.getThemeWidgetStyle(reportTheme).getIconColor(); } protected Icon setStyleTwoIcon(Icon icon, Icon defaultIcon) { @@ -106,13 +112,15 @@ public class ControlPreviewCell extends JPanel { * 填充圆角矩形背景色 */ public void paintBgColor(Graphics g, ThemedWidgetStyle widgetStyle, int alpha) { - Color themeColor = widgetStyle.getWidgetBackground().getColor(); + ThemedWidgetStyle themeWidgetStyle = this.themePreviewTerminal.getThemeWidgetStyle(this.reportTheme); + Color themeColor = themeWidgetStyle.getThemeColor(); themeColor = themeColor == null ? WidgetThemeDisplayConstants.DEFAULT_TRANSPARENT_COLOR : themeColor; g.setColor(new Color(themeColor.getRed(), themeColor.getGreen(), themeColor.getBlue(), alpha)); g.fillRoundRect(0, 0, getSize().width - 1, getSize().height - 1, (int) widgetStyle.getBorderStyle().getRadius(), (int) widgetStyle.getBorderStyle().getRadius()); //需要重新绘制一遍字体,否则会被颜色填充给遮住 Graphics2D g2d = (Graphics2D) g.create(); - FRFont font = FRFont.getInstance(FRFont.DEFAULT_FONTNAME, Font.PLAIN, widgetStyle.getTextStyle().getFontSize(), textColor); + ThemeTextStyle textStyle = themeWidgetStyle.getTextStyle(); + FRFont font = FRFont.getInstance(textStyle.getName(), textStyle.getCompositeFontStyle(), textStyle.getFontSize(), textStyle.getFontColor()); BaseUtils.drawStringStyleInRotation(g2d, getWidth(), getHeight(), this.value, Style.getInstance(font).deriveHorizontalAlignment(Constants.LEFT) .deriveTextStyle(Style.TEXTSTYLE_SINGLELINE), NO_SCALE_RESOLUTION); @@ -125,8 +133,8 @@ public class ControlPreviewCell extends JPanel { return; } Graphics2D g2d = (Graphics2D) g.create(); - ThemedWidgetStyle widgetStyle = (ThemedWidgetStyle) reportTheme.getWidgetStyle(); - FRFont font = FRFont.getInstance(FRFont.DEFAULT_FONTNAME, Font.PLAIN, widgetStyle.getTextStyle().getFontSize(), textColor); + ThemeTextStyle textStyle = this.themePreviewTerminal.getThemeWidgetStyle(reportTheme).getTextStyle(); + FRFont font = FRFont.getInstance(textStyle.getName(), textStyle.getCompositeFontStyle(), textStyle.getFontSize(), textStyle.getFontColor()); //每个预览格子通用的字体绘制 BaseUtils.drawStringStyleInRotation(g2d, getWidth(), getHeight(), this.value, Style.getInstance(font).deriveHorizontalAlignment(Constants.LEFT) diff --git a/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewPane.java b/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewPane.java index 110e6943c4..69a34fd3bc 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewPane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/theme/panel/ControlPreviewPane.java @@ -6,6 +6,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.theme.preview.ThemePreviewed; import com.fr.general.Background; +import com.fr.widgettheme.ThemePreviewTerminal; import javax.swing.JPanel; import java.awt.Color; @@ -42,9 +43,14 @@ public class ControlPreviewPane extends JPanel implements ThemePreviewed Date: Sun, 4 Feb 2024 16:56:57 +0800 Subject: [PATCH 11/16] =?UTF-8?q?fix:=20=E5=9B=9E=E9=80=80=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=20fvs.chart=E5=92=8Cfvs.ec.chart=E9=83=BD=E4=B8=8D?= =?UTF-8?q?=E8=B5=B0refresh=E9=80=BB=E8=BE=91=20=E5=8E=9F=E5=A7=8B?= =?UTF-8?q?=E9=97=AE=E9=A2=98fvs.ec.chart=E7=9A=84=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E4=BD=BF=E7=94=A8chartemailpane=E6=89=8D=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=AD=A3=E6=96=87=E5=8B=BE=E9=80=89=E9=A1=B9=E4=B8=8D=E9=80=9A?= =?UTF-8?q?=E8=BF=87refresh=E5=AE=9E=E7=8E=B0=20=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E6=8F=92=E4=BB=B6DuchampHyperlinkGroup=E9=87=8D=E5=86=99?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E9=82=AE=E4=BB=B6&=E8=81=94=E5=8A=A8fvs?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=20#REPORT-111618?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/custom/component/VanChartHyperLinkPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java index 8dfb3ac484..5b17494da9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java @@ -6,6 +6,7 @@ import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.chart.web.ChartHyperRelateFloatLink; import com.fr.design.ExtraDesignClassManager; +import com.fr.design.base.mode.DesignModeContext; import com.fr.design.beans.BasicBeanPane; import com.fr.design.chart.javascript.ChartEmailPane; import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPoplinkPane; @@ -24,7 +25,6 @@ import com.fr.design.javascript.JavaScriptImplPane; import com.fr.design.javascript.ParameterJavaScriptPane; import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.JTemplate; -import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.module.DesignModuleFactory; import com.fr.general.ComparatorUtils; import com.fr.general.NameObject; @@ -149,7 +149,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { } private void refreshNameableCreator() { - if (ChartEditContext.duchampMode()) { + if (DesignModeContext.isDuchampMode()) { return; } HashMap paneMap = getHyperlinkMap(); From f78fd4fc4df94b9c57a09dd349039c1ebc657bd2 Mon Sep 17 00:00:00 2001 From: lixing Date: Sun, 18 Feb 2024 14:51:05 +0800 Subject: [PATCH 12/16] =?UTF-8?q?REPORT-114164=20=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=89=A9=E5=B1=95=E6=A0=B7=E5=BC=8F-=E5=9B=BE=E6=96=87?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=9B=BE=E6=A0=87=E6=A0=BC=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=87=B312=E4=B8=AA=E4=BB=A5=E4=B8=8A=EF=BC=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/radiogroup/ImageCustomDefinePane.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/ImageCustomDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/ImageCustomDefinePane.java index 30fbe2d4a9..c517e03571 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/ImageCustomDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/radiogroup/ImageCustomDefinePane.java @@ -24,6 +24,7 @@ import com.fr.form.ui.mobile.radiogroup.ImageMobileStyle; import com.fr.general.FRFont; import javax.swing.*; +import javax.swing.border.EmptyBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.*; @@ -281,18 +282,22 @@ public class ImageCustomDefinePane extends MobileStyleCustomDefinePane { UILabel initialLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Icon_Init")); UILabel selectedLabel = DesignerUtils.createConfigLabel(Toolkit.i18nText("Fine-Plugin-RadioGroup_Icon_Select")); + initialLabel.setVerticalAlignment(SwingConstants.TOP); + initialLabel.setBorder(new EmptyBorder(5, 0, 0, 0)); + selectedLabel.setVerticalAlignment(SwingConstants.TOP); + selectedLabel.setBorder(new EmptyBorder(5, 0, 0, 0)); initInitialIconConfigPane(); initSelectedIconConfigPane(); JPanel container = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 5); - JPanel initialPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - initialPane.add(initialLabel); - initialPane.add(initialIconConfigPane); + JPanel initialPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + initialPane.add(initialLabel, BorderLayout.WEST); + initialPane.add(initialIconConfigPane, BorderLayout.CENTER); container.add(initialPane); - JPanel selectedPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - selectedPane.add(selectedLabel); - selectedPane.add(selectedIconConfigPane); + JPanel selectedPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + selectedPane.add(selectedLabel, BorderLayout.WEST); + selectedPane.add(selectedIconConfigPane, BorderLayout.CENTER); container.add(selectedPane); centerPane.add(container); From a411e490e7c3ecad8e567340db5860ae66dba90c Mon Sep 17 00:00:00 2001 From: obo Date: Mon, 19 Feb 2024 14:21:53 +0800 Subject: [PATCH 13/16] =?UTF-8?q?REPORT-114501=20=E3=80=90=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E6=98=BE=E7=A4=BA=E5=A2=9E=E5=BC=BA-=E8=BE=B9?= =?UTF-8?q?=E6=A1=86=E9=A2=9C=E8=89=B2=E3=80=91=E8=BE=B9=E6=A1=86=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E4=BC=A0=E5=88=B0=E5=89=8D=E7=AB=AF=E4=B8=BAnull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widgettheme/common/EditorSettingPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/widgettheme/common/EditorSettingPane.java b/designer-form/src/main/java/com/fr/design/widgettheme/common/EditorSettingPane.java index ea547eb674..17bbbe2c12 100644 --- a/designer-form/src/main/java/com/fr/design/widgettheme/common/EditorSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widgettheme/common/EditorSettingPane.java @@ -78,6 +78,7 @@ public class EditorSettingPane extends BaseStyleSettingPane colorSelectBox.setSelectObject(editorTheme.getThemeColor()); lineComboBox.setSelectedLineStyle(editorTheme.getBorderStyle().getLineType()); borderRadiusSpinner.setValue(editorTheme.getBorderStyle().getRadius()); + borderColorSelectBox.setSelectObject(editorTheme.getBorderStyle().getBorderColor()); widgetBgColorSelectBox.setSelectObject(ColorUtils.ignoreColorAlpha(editorTheme.getWidgetBackground().getColor())); widgetBgAlphaDragPane.populateBean(ColorUtils.roundColorAlphaDouble(editorTheme.getWidgetBackground().getColor())); iconColorSelectBox.setSelectObject(editorTheme.getIconColor()); @@ -110,6 +111,7 @@ public class EditorSettingPane extends BaseStyleSettingPane editorTheme.setSelectBoxBgColor(selectBgColorBox.getSelectObject()); editorTheme.setBorderStyle(new BorderStyle((int) borderRadiusSpinner.getValue(), lineComboBox.getSelectedLineStyle(), borderColorSelectBox.getSelectObject())); editorTheme.setWidgetBackground(ColorUtils.createColorBackgroundWithAlpha(widgetBgColorSelectBox.getSelectObject(), widgetBgAlphaDragPane.updateBean())); + editorTheme.setIconColor(iconColorSelectBox.getSelectObject()); assignFontSizeStyle(editorTheme); switchCard(); } From 1cd29b730b72401aa281963d50bd4d1c3fbb39a6 Mon Sep 17 00:00:00 2001 From: obo Date: Mon, 19 Feb 2024 16:56:11 +0800 Subject: [PATCH 14/16] =?UTF-8?q?REPORT-114524=20=E3=80=90=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E6=98=BE=E7=A4=BA=E5=A2=9E=E5=BC=BA-=E5=A4=8D?= =?UTF-8?q?=E9=80=89=E6=8C=89=E9=92=AE=E7=BB=84=E6=8E=A7=E4=BB=B6=E3=80=91?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=EF=BC=8C=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A7=E4=BB=B6=E8=83=8C=E6=99=AF=E5=90=8E?= =?UTF-8?q?=E4=BC=9A=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widgettheme/common/ButtonSettingPane.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/widgettheme/common/ButtonSettingPane.java b/designer-form/src/main/java/com/fr/design/widgettheme/common/ButtonSettingPane.java index acdebeb964..f6b1403454 100644 --- a/designer-form/src/main/java/com/fr/design/widgettheme/common/ButtonSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widgettheme/common/ButtonSettingPane.java @@ -3,9 +3,11 @@ package com.fr.design.widgettheme.common; import com.fr.design.widgettheme.StyleSetting; import com.fr.design.widgettheme.BaseStyleSettingPane; import com.fr.form.ui.Widget; +import com.fr.util.ColorUtils; import com.fr.widgettheme.theme.widget.theme.cell.ButtonTheme; import org.jetbrains.annotations.Nullable; +import java.awt.Color; import java.util.Arrays; import java.util.List; @@ -64,6 +66,9 @@ public class ButtonSettingPane extends BaseStyleSettingPane } else { styleSettingHead.setSelectedIndex(1); colorSelectBox.setSelectObject(buttonTheme.getThemeColor()); + Color widgetBgColor = buttonTheme.getWidgetBackground().getColor(); + widgetBgColorSelectBox.setSelectObject(ColorUtils.ignoreColorAlpha(widgetBgColor)); + widgetBgAlphaDragPane.populateBean(ColorUtils.roundColorAlphaDouble(widgetBgColor)); assignFontSizePane(buttonTheme); } switchCard(); @@ -83,6 +88,7 @@ public class ButtonSettingPane extends BaseStyleSettingPane protected void updateButtonStyleBean(ButtonTheme buttonTheme) { buttonTheme.setThemeColor(colorSelectBox.getSelectObject()); + buttonTheme.setWidgetBackground(ColorUtils.createColorBackgroundWithAlpha(widgetBgColorSelectBox.getSelectObject(), widgetBgAlphaDragPane.updateBean())); assignFontSizeStyle(buttonTheme); switchCard(); } From 56fd8856300fb7242c80b79d107c72fb4edd6e93 Mon Sep 17 00:00:00 2001 From: obo Date: Mon, 19 Feb 2024 17:19:51 +0800 Subject: [PATCH 15/16] =?UTF-8?q?=E8=A7=86=E5=9B=BE=E6=A0=91=E4=B9=9F?= =?UTF-8?q?=E8=A1=A5=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/widgettheme/common/TreeEditorSettingPane.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/widgettheme/common/TreeEditorSettingPane.java b/designer-form/src/main/java/com/fr/design/widgettheme/common/TreeEditorSettingPane.java index 6f6676071c..a2e570dfed 100644 --- a/designer-form/src/main/java/com/fr/design/widgettheme/common/TreeEditorSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widgettheme/common/TreeEditorSettingPane.java @@ -3,9 +3,11 @@ package com.fr.design.widgettheme.common; import com.fr.design.widgettheme.StyleSetting; import com.fr.design.widgettheme.BaseStyleSettingPane; import com.fr.form.ui.TreeEditor; +import com.fr.util.ColorUtils; import com.fr.widgettheme.theme.widget.theme.cell.TreeTheme; import org.jetbrains.annotations.Nullable; +import java.awt.Color; import java.util.Arrays; import java.util.List; @@ -56,6 +58,9 @@ public class TreeEditorSettingPane extends BaseStyleSettin } else { styleSettingHead.setSelectedIndex(1); colorSelectBox.setSelectObject(treeTheme.getThemeColor()); + Color widgetBgColor = treeTheme.getWidgetBackground().getColor(); + widgetBgColorSelectBox.setSelectObject(ColorUtils.ignoreColorAlpha(widgetBgColor)); + widgetBgAlphaDragPane.populateBean(ColorUtils.roundColorAlphaDouble(widgetBgColor)); assignFontSizePane(treeTheme); } switchCard(); @@ -83,6 +88,7 @@ public class TreeEditorSettingPane extends BaseStyleSettin protected void updateTreeStyleBean(TreeTheme treeTheme) { treeTheme.setThemeColor(colorSelectBox.getSelectObject()); + treeTheme.setWidgetBackground(ColorUtils.createColorBackgroundWithAlpha(widgetBgColorSelectBox.getSelectObject(), widgetBgAlphaDragPane.updateBean())); assignFontSizeStyle(treeTheme); switchCard(); } From bca82d153cafc20d29d765e7d4b41ae476416a99 Mon Sep 17 00:00:00 2001 From: obo Date: Tue, 20 Feb 2024 13:56:49 +0800 Subject: [PATCH 16/16] =?UTF-8?q?REPORT-114548=20=E3=80=90=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E6=98=BE=E7=A4=BA=E5=A2=9E=E5=BC=BA-=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=8E=A7=E4=BB=B6=E8=BE=B9=E6=A1=86=E7=BA=BF=E5=9E=8B?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E3=80=91=E6=8C=89=E9=92=AE=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E8=BE=B9=E6=A1=86=E7=BA=BF=E5=9E=8B=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E4=BF=9D=E5=AD=98=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=86=8D=E6=89=93=E5=BC=80=E9=A2=9C=E8=89=B2=E4=BC=9A=E5=8F=98?= =?UTF-8?q?=E4=B8=BA=E8=B7=9F=E9=9A=8F=E7=9A=84=E4=B8=BB=E9=A2=98=E8=89=B2?= =?UTF-8?q?=E3=80=82=E4=B8=94=E8=BE=B9=E6=A1=86=E7=BA=BF=E5=9E=8B=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E5=B1=95=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/widgettheme/common/NormalButtonSettingPane.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widgettheme/common/NormalButtonSettingPane.java b/designer-form/src/main/java/com/fr/design/widgettheme/common/NormalButtonSettingPane.java index 2cfc721e5c..7fa1efbe80 100644 --- a/designer-form/src/main/java/com/fr/design/widgettheme/common/NormalButtonSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widgettheme/common/NormalButtonSettingPane.java @@ -61,8 +61,10 @@ public class NormalButtonSettingPane extends BaseStyleSettingP styleSettingHead.setSelectedIndex(0); } else { styleSettingHead.setSelectedIndex(1); - lineComboBox.setSelectedLineStyle(widgetTheme.getBorderStyle().getLineType()); - borderRadiusSpinner.setValue(widgetTheme.getBorderStyle().getRadius()); + BorderStyle borderStyle = widgetTheme.getBorderStyle(); + lineComboBox.setSelectedLineStyle(borderStyle.getLineType()); + borderRadiusSpinner.setValue(borderStyle.getRadius()); + borderColorSelectBox.setSelectObject(borderStyle.getBorderColor()); assignFontPane(widgetTheme); buttonStyleDefinedPane.populate(ButtonBackground.create(widgetTheme.getButtonBackgroundStyle())); }