From 0d866f10c479b07d4e5387778db50abf0e83f079 Mon Sep 17 00:00:00 2001 From: "Levy.Xie" Date: Sun, 23 Apr 2023 16:44:24 +0800 Subject: [PATCH 1/5] =?UTF-8?q?REPORT-94597=20=E5=AE=89=E8=A3=85=E3=80=90?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=86=85=E6=89=93=E5=BC=80=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=A1=B5=E3=80=91=E6=8F=92=E4=BB=B6=EF=BC=8CFR=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E8=B6=85=E9=93=BE=E4=BC=9A=E5=A4=9A=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E4=B8=8B=E6=8B=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartHyperLinkPane.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 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 bdd3608c9e..61d0a53041 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 @@ -47,10 +47,7 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; +import java.util.*; /** * Created by Fangjie on 2016/4/28. @@ -154,24 +151,23 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { } HashMap paneMap = getHyperlinkMap(); - //安装平台内打开插件时,添加相应按钮 - Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); java.util.List list = refreshList(paneMap); + Map creators = new LinkedHashMap<>(); int size = list.size(); - NameObjectCreator[] creators = new NameObjectCreator[size + providers.size()]; for (int i = 0; i < size; i++) { UIMenuNameableCreator uiMenuNameableCreator = list.get(i); - creators[i] = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz()); + NameObjectCreator creator = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz()); + creators.put(uiMenuNameableCreator.getName(), creator); } + //安装平台内打开插件时, 添加/替换 相应按钮 + Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); for (HyperlinkProvider provider : providers) { NameableCreator creator = provider.createHyperlinkCreator(); if (creator != null) { - creators[size] = new NameObjectCreator(creator.menuName(), creator.getHyperlink(), creator.getUpdatePane()); - size++; + creators.put(creator.menuName(), new NameObjectCreator(creator.menuName(), creator.getHyperlink(), creator.getUpdatePane())); } } - - refreshNameableCreator(creators); + refreshNameableCreator(creators.values().toArray(new NameObjectCreator[0])); } public void populate(Plot plot) { From 2a406e071bf8643a026f96b038b984649e23ee5c Mon Sep 17 00:00:00 2001 From: "Levy.Xie" Date: Sun, 23 Apr 2023 16:47:06 +0800 Subject: [PATCH 2/5] =?UTF-8?q?REPORT-94597=20=E5=AE=89=E8=A3=85=E3=80=90?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=86=85=E6=89=93=E5=BC=80=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=A1=B5=E3=80=91=E6=8F=92=E4=BB=B6=EF=BC=8CFR=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E8=B6=85=E9=93=BE=E4=BC=9A=E5=A4=9A=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E4=B8=8B=E6=8B=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/custom/component/VanChartHyperLinkPane.java | 8 ++++++-- 1 file changed, 6 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 61d0a53041..a6377e53f8 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 @@ -47,7 +47,11 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; /** * Created by Fangjie on 2016/4/28. @@ -299,7 +303,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { @Override protected void initCreatorsFilter() { - this.creatorsFilter = nameableCreator -> { + this.creatorsFilter = nameableCreator -> { Class clazz = nameableCreator.getHyperlink(); JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (!JTemplate.isValid(template)) { From 5deb7120453577b00087c82303a4c90030406874 Mon Sep 17 00:00:00 2001 From: "Levy.Xie" Date: Mon, 24 Apr 2023 14:12:59 +0800 Subject: [PATCH 3/5] =?UTF-8?q?REPORT-94597=20=E5=AE=89=E8=A3=85=E3=80=90?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=86=85=E6=89=93=E5=BC=80=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=A1=B5=E3=80=91=E6=8F=92=E4=BB=B6=EF=BC=8CFR=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E8=B6=85=E9=93=BE=E4=BC=9A=E5=A4=9A=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E4=B8=8B=E6=8B=89=E9=A1=B9=20=E6=94=B9?= =?UTF-8?q?=E7=94=A8ListMap=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/custom/component/VanChartHyperLinkPane.java | 3 +-- 1 file changed, 1 insertion(+), 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 a6377e53f8..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 @@ -49,7 +49,6 @@ import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.HashMap; -import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; @@ -156,7 +155,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { HashMap paneMap = getHyperlinkMap(); java.util.List list = refreshList(paneMap); - Map creators = new LinkedHashMap<>(); + Map creators = new ListMap<>(); int size = list.size(); for (int i = 0; i < size; i++) { UIMenuNameableCreator uiMenuNameableCreator = list.get(i); From 458ebdcd46b2c9c326d8dacdf11d9ec3a233dbfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=2EYing-=E5=BA=94=E5=BF=97=E6=B5=A9?= Date: Mon, 24 Apr 2023 17:32:49 +0800 Subject: [PATCH 4/5] =?UTF-8?q?REPORT-94379=20=E6=8E=A7=E4=BB=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=A2=9E=E5=BC=BA=E6=8F=92=E4=BB=B6=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=90=AF=E7=94=A8=E5=90=8E=EF=BC=8C=E9=83=A8=E5=88=86=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E6=A0=B7=E5=BC=8F=E8=AE=BE=E7=BD=AE=E6=9C=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/ui/designer/ButtonDefinePane.java | 7 ++++--- .../ui/designer/FreeButtonDefinePane.java | 19 ++++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java index 3059ddc37d..085d239826 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java @@ -35,6 +35,7 @@ public abstract class ButtonDefinePane extends AbstractDataMod protected UITextField labelNameTextField; private final List> extraPaneList = new ArrayList<>(); private JPanel extraPane; + protected boolean containsExtraPane; public ButtonDefinePane(XCreator creator){ super(creator); @@ -63,7 +64,7 @@ public abstract class ButtonDefinePane extends AbstractDataMod private void refreshAdvancedPane() { extraPaneList.clear(); - boolean containsExtraPane = false; + containsExtraPane = false; Set> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG); for (WidgetAdvancedPaneProvider provider : providers) { if (!provider.accept(creator)) { @@ -78,8 +79,6 @@ public abstract class ButtonDefinePane extends AbstractDataMod private void refreshAdvancedPane(boolean containsExtraPane) { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - Component[] backgroundCompPane = createBackgroundComp(); - Component[] frFont = createFontPane(); double[] rowSize; double[] columnSize; int[][] rowCount; @@ -94,6 +93,8 @@ public abstract class ButtonDefinePane extends AbstractDataMod rowCount = new int[][]{{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; n_components = getExtraAdvancedComponents(panel); } else { + Component[] backgroundCompPane = createBackgroundComp(); + Component[] frFont = createFontPane(); rowSize = new double[]{p, p, p, p, p, p, p, p}; columnSize = new double[]{p, f}; rowCount = new int[][]{{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java index 843f402f01..16a31b85ed 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java @@ -41,10 +41,13 @@ public class FreeButtonDefinePane extends ButtonDefinePane { } public void populateSubButtonPane(FreeButton e) { + if (containsExtraPane) { + return; + } backgroundCompPane.populate(e); frFontPane.setVisible(e.isCustomStyle()); fontLabel.setVisible(e.isCustomStyle()); - if(e.isCustomStyle()){ + if (e.isCustomStyle()) { FRFont frFont = e.getFont(); if (frFont != null) { frFontPane.populateBean(e.getFont()); @@ -54,12 +57,14 @@ public class FreeButtonDefinePane extends ButtonDefinePane { public FreeButton updateSubButtonPane() { FreeButton freeButton = (FreeButton) creator.toData(); - backgroundCompPane.update(freeButton); - frFontPane.setVisible(freeButton.isCustomStyle()); - fontLabel.setVisible(freeButton.isCustomStyle()); - if(freeButton.isCustomStyle()){ - FRFont frFont = freeButton.getFont() == null ? FRFont.getInstance() : freeButton.getFont(); - freeButton.setFont(frFontPane.update(frFont)); + if (!containsExtraPane) { + backgroundCompPane.update(freeButton); + frFontPane.setVisible(freeButton.isCustomStyle()); + fontLabel.setVisible(freeButton.isCustomStyle()); + if (freeButton.isCustomStyle()) { + FRFont frFont = freeButton.getFont() == null ? FRFont.getInstance() : freeButton.getFont(); + freeButton.setFont(frFontPane.update(frFont)); + } } return freeButton; } From 988d95b631f31212f71a59b66056a37763952fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=2EYing-=E5=BA=94=E5=BF=97=E6=B5=A9?= Date: Mon, 24 Apr 2023 17:40:29 +0800 Subject: [PATCH 5/5] =?UTF-8?q?REPORT-94379=20=E6=8E=A7=E4=BB=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=A2=9E=E5=BC=BA=E6=8F=92=E4=BB=B6=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=90=AF=E7=94=A8=E5=90=8E=EF=BC=8C=E9=83=A8=E5=88=86=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E6=A0=B7=E5=BC=8F=E8=AE=BE=E7=BD=AE=E6=9C=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widget/ui/designer/ButtonDefinePane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java index 085d239826..6889ef7b49 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java @@ -79,6 +79,8 @@ public abstract class ButtonDefinePane extends AbstractDataMod private void refreshAdvancedPane(boolean containsExtraPane) { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; + Component[] backgroundCompPane = createBackgroundComp(); + Component[] frFont = createFontPane(); double[] rowSize; double[] columnSize; int[][] rowCount; @@ -93,8 +95,6 @@ public abstract class ButtonDefinePane extends AbstractDataMod rowCount = new int[][]{{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; n_components = getExtraAdvancedComponents(panel); } else { - Component[] backgroundCompPane = createBackgroundComp(); - Component[] frFont = createFontPane(); rowSize = new double[]{p, p, p, p, p, p, p, p}; columnSize = new double[]{p, f}; rowCount = new int[][]{{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};