diff --git a/designer-base/src/main/java/com/fr/base/svg/IconUtils.java b/designer-base/src/main/java/com/fr/base/svg/IconUtils.java index 45c11c60c0..4b5f1b8817 100644 --- a/designer-base/src/main/java/com/fr/base/svg/IconUtils.java +++ b/designer-base/src/main/java/com/fr/base/svg/IconUtils.java @@ -38,9 +38,8 @@ public class IconUtils { if (IOUtils.readResource(resource) != null) { return SVGIcon.readSVGIcon(resource); } - // 适配某些插件里是_normal.png、_selected.png的情况 - String pngResource = resource.replace(ICON_SUFFIX_SVG, ICON_SUFFIX_PNG); - return IOUtils.readIcon(pngResource); + // 适配插件 + return adjustPluginsPng(resource); } return IOUtils.readIcon(resource); } @@ -48,6 +47,17 @@ public class IconUtils { return readNoSuffixResource(resource, ICON_TYPE_NORMAL); } + /** + * 适配插件中使用_normal.png、_selected.png、_disabled.png的情况 + * @param resource 图片路径 + * @return Icon + */ + private static Icon adjustPluginsPng(String resource) { + String pngResource = resource.replace(ICON_SUFFIX_SVG, ICON_SUFFIX_PNG); + // 考虑到某些插件可能只会使用三种图标中的一部分,这里做个判断,不然就会因为资源不存在而报错 + return IOUtils.readResource(pngResource) == null ? new ImageIcon() : IOUtils.readIcon(pngResource); + } + /** * 尝试读取不带扩展名的图标,svg优先,其次png,最后gif,都没读到就打印错误日志,返回空白Icon * @param resource 图片路径 diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index a3e610460b..df68c4a436 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -6,6 +6,7 @@ import com.fr.data.TableDataSource; import com.fr.data.TableDataSourceTailor; import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.NameTableData; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; import com.fr.design.beans.BasicBeanPane; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataComboBox; @@ -21,7 +22,6 @@ import com.fr.general.GeneralUtils; import com.fr.general.data.DataModel; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.map.data.MapMatchResult; -import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import com.fr.script.Calculator; import com.fr.stable.StringUtils; @@ -246,7 +246,7 @@ public class MapAreaMatchPane extends BasicBeanPane { private void populateMatchData(Object[] columnData) { Set geoAreas = matchAreaTable.getItems(); - Map resultMap = ChartGEOJSONHelper.matchAreaList(columnData, geoAreas, matchResultTable.getCustomResult()); + Map resultMap = GEOJSONHelper.getInstance().matchAreaList(columnData, geoAreas, matchResultTable.getCustomResult()); Object[][] data = new Object[resultMap.size()][2]; diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java index 9dd13e77fb..4e1297dd33 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java @@ -1,8 +1,8 @@ package com.fr.design.chartx.component; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; import com.fr.design.i18n.Toolkit; import com.fr.general.GeneralUtils; -import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import javax.swing.AbstractCellEditor; import javax.swing.JTable; @@ -88,7 +88,7 @@ public class MatchAreaTable extends JTable { return; } int index = areaNameIndex.get(areaName); - String result = ChartGEOJSONHelper.matchArea(GeneralUtils.objectToString(areaName), items); + String result = GEOJSONHelper.getInstance().matchArea(GeneralUtils.objectToString(areaName), items, new HashMap<>()); getColumnModel().getColumn(1).getCellEditor().stopCellEditing(); this.setValueAt(result, index, 1); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java index 2d1cb2304c..a2adff77a7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java @@ -443,7 +443,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { //不透明度 private JPanel createPointAlphaPane() { - pointAlphaPane = new UINumberDragPane(0, 100); + pointAlphaPane = new UINumberDragPaneWithPercent(0, 100); return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Report_Alpha"), pointAlphaPane); }