From 035883fd5706786f94579d039a60fa339efbc8a4 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 1 Feb 2021 16:42:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-47797=20=E6=9C=AC=E5=9C=B0=E5=92=8C?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E5=B7=A5=E7=A8=8B=E5=88=87=E6=8D=A2=EF=BC=8C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=9C=89=E4=B8=A4=E4=B8=AA=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E6=8A=A5=E9=94=99=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91=E6=9C=89=E4=BA=9B=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=8F=AA=E7=94=A8=E4=BA=86=5Fnormal=E5=92=8C=5Fselected?= =?UTF-8?q?=E4=B8=A4=E7=A7=8D=E5=9B=BE=E6=A0=87=EF=BC=8C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=5Fdisabled=E5=9B=BE=E6=A0=87=EF=BC=8C?= =?UTF-8?q?=E4=BD=86=E6=98=AF=E4=B9=8B=E5=89=8D=E7=9A=84=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=AF=B9=E8=B5=84=E6=BA=90=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E8=BF=9B=E8=A1=8C=E5=88=A4=E6=96=AD=EF=BC=8C?= =?UTF-8?q?=E4=BC=9A=E5=AF=BC=E8=87=B4IOUtils=E4=B8=AD=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E6=B7=BB=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E6=96=AD=EF=BC=9B=E6=8A=8A=E9=80=82=E9=85=8D=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91=E6=8A=BD=E5=8F=96=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/base/svg/IconUtils.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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 图片路径 From 9f56de62b6d9842a02b4488f1f2f35a138aa03f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 2 Feb 2021 10:26:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?CHART-18182=20=E6=A8=A1=E7=B3=8A=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E6=96=B9=E6=B3=95=E7=A7=BB=E5=8A=A8=E5=88=B0=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=20&=20CHART-18190=20=E7=82=B9=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E9=80=8F=E6=98=8E=E5=BA=A6=E6=8E=A7=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/chartx/component/MapAreaMatchPane.java | 4 ++-- .../java/com/fr/design/chartx/component/MatchAreaTable.java | 4 ++-- .../main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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); }