From 798a5af865db0f8546e24b092bcd97185d846f37 Mon Sep 17 00:00:00 2001 From: Starryi Date: Wed, 25 Aug 2021 18:39:51 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-58034=20=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E3=80=91=E6=A8=A1=E6=9D=BF=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E4=B8=8D=E5=BA=94=E8=AF=A5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E2=98=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 使用构造函数参数控制列表中的主题块是否展示当前 适用于新建模版的主题的标记 【改动思路】 同上 --- .../com/fr/design/mainframe/theme/TemplateThemeBlock.java | 5 ++++- .../fr/design/mainframe/theme/TemplateThemeListPane.java | 6 ++++-- .../fr/design/mainframe/theme/TemplateThemeManagePane.java | 2 +- .../mainframe/theme/dialog/TemplateThemeUsingDialog.java | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java index afb267110..933ce2ad3 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java @@ -49,6 +49,7 @@ public class TemplateThemeBlock extends JPanel { private final Icon theme4currentTemplateMarkIcon = IOUtils.readIcon("/com/fr/design/form/images/theme4currentTemplate.png"); private final Icon theme4NewTemplateMarkIcon= IOUtils.readIcon("/com/fr/design/form/images/theme4newTemplate.png"); private final Icon profileIcon = IOUtils.readIcon("/com/fr/design/icon/icon_edit.png"); + private final boolean displayTheme4NewTemplateMarker; private UILabel thumbnailLabel; // UIButton会影响Block的手势监听,这里使用UILabel代替,点击事件也有Block代为处理 @@ -59,9 +60,11 @@ public class TemplateThemeBlock extends JPanel { private MouseAdapter clickListener; public TemplateThemeBlock(String name, + boolean displayTheme4NewTemplateMarker, TemplateThemeConfig config, TemplateThemeProfilePane profilePane) { this.name = name; + this.displayTheme4NewTemplateMarker = displayTheme4NewTemplateMarker; this.config = config; this.profilePane = profilePane; @@ -192,7 +195,7 @@ public class TemplateThemeBlock extends JPanel { } } - if (StringUtils.equals(config.getThemeName4NewTemplate(), name)) { + if (displayTheme4NewTemplateMarker && StringUtils.equals(config.getThemeName4NewTemplate(), name)) { theme4NewTemplateMarkIcon.paintIcon(this, g, 0, 0); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeListPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeListPane.java index 1b6eab40a..524c272ac 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeListPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeListPane.java @@ -34,6 +34,7 @@ public class TemplateThemeListPane extends BasicPane { private final AsyncThemeFetcher asyncThemeFetcher; + private final boolean displayTheme4NewTemplateMarker; protected final TemplateThemeConfig config; private final TemplateThemeProfilePane profilePane; private final JPanel contentListPane; @@ -47,7 +48,8 @@ public class TemplateThemeListPane extends BasicPane { private ChangeListener changeListener; - public TemplateThemeListPane(TemplateThemeConfig config, TemplateThemeProfilePane profilePane) { + public TemplateThemeListPane(boolean displayTheme4NewTemplateMarker, TemplateThemeConfig config, TemplateThemeProfilePane profilePane) { + this.displayTheme4NewTemplateMarker = displayTheme4NewTemplateMarker; this.config = config; this.profilePane = profilePane; this.contentListPane = new JPanel(); @@ -95,7 +97,7 @@ public class TemplateThemeListPane extends BasicPane { } private TemplateThemeBlock createNewTemplateThemeBlock(String name) { - final TemplateThemeBlock block = new TemplateThemeBlock<>(name, config, profilePane); + final TemplateThemeBlock block = new TemplateThemeBlock<>(name, displayTheme4NewTemplateMarker, config, profilePane); block.addClickListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java index 0363bd88d..6af09ccfd 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java @@ -75,7 +75,7 @@ public class TemplateThemeManagePane extends BasicPane public TemplateThemeManagePane(TemplateThemeConfig config, TemplateThemeProfilePane profilePane) { this.config = config; this.profilePane = profilePane; - this.themeListPane = new TemplateThemeListPane<>(config, profilePane); + this.themeListPane = new TemplateThemeListPane<>(true, config, profilePane); this.removeAction = new RemoveThemeAction(false); this.setTheme4NewTemplateButton = new UIButton(Toolkit.i18nText("Fine-Design_Template_Theme_Manager_Pane_Default_Setting")); this.asyncThemeFetcher = new AsyncThemeFetcher<>(1, config); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeUsingDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeUsingDialog.java index 7d1a99825..24406c91f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeUsingDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeUsingDialog.java @@ -37,7 +37,7 @@ public class TemplateThemeUsingDialog extends TemplateT super(parent, Toolkit.i18nText("Fine-Design_Template_Theme_Using_Dialog_Title"), CONTENT_WIDTH, CONTENT_HEIGHT); this.currentTemplate = template; - this.themeListPane = new TemplateThemeListPane<>(config, null); + this.themeListPane = new TemplateThemeListPane<>(false, config, null); JPanel content = createContent(); UIButton openThemeManagerButton = createOpenThemeManagerButton();