From 0d866f10c479b07d4e5387778db50abf0e83f079 Mon Sep 17 00:00:00 2001 From: "Levy.Xie" Date: Sun, 23 Apr 2023 16:44:24 +0800 Subject: [PATCH 1/3] =?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/3] =?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/3] =?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);