From c77b13e11f070a196da183acc2e59feb3b28e244 Mon Sep 17 00:00:00 2001 From: zheng Date: Mon, 16 Sep 2019 15:31:14 +0800 Subject: [PATCH] =?UTF-8?q?CHART-10358=20=E5=85=BC=E5=AE=B9=E4=BD=8D?= =?UTF-8?q?=E5=9B=BE=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/ChartTypeInterfaceManager.java | 6 +++++- .../src/main/java/com/fr/design/chart/ChartTypePane.java | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java index b931aa991..57d977214 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -374,11 +374,15 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr } result[i] = Reflect.on(chart).call("demoImagePath").get(); } + + if (ArrayUtils.isNotEmpty(result)) { + return result; + } } catch (Exception e) { //do nothing } - return new String[0]; + return new String[]{getIconPath(chartID)}; } public String[] getSubName(String chartID) { diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java index eb17cc41f..0eb70fd12 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java @@ -11,6 +11,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.DefaultListCellRenderer; @@ -98,8 +99,8 @@ public class ChartTypePane extends ChartCommonWizardPane { String[] subName = ChartTypeInterfaceManager.getInstance().getSubName(id); ChartTypePane.this.iconListModel.clear(); - for (int i = 0, len = demoImagePath.length; i < len; i++) { - String ImagePath = demoImagePath[i]; + for (int i = 0, len = subName.length; i < len; i++) { + String ImagePath = demoImagePath.length > i ? demoImagePath[i] : StringUtils.EMPTY; String chartName = subName[i]; ChartTypePane.this.iconListModel.addElement(new ChartIcon(ImagePath, chartName)); }