From 72d06999270da7c1a119a755688637e2496e896f Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 28 Sep 2017 14:18:56 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=B0=86=E4=BF=9D=E5=AD=98=E5=92=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4svg=E5=9C=B0=E5=9B=BE=E7=9A=84action=E6=94=BE?= =?UTF-8?q?=E5=88=B0chart=E4=B8=AD=20=E5=9C=A8=E8=BF=9C=E7=A8=8B=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E5=A2=9E=E5=88=A0=E6=94=B9svg?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E6=97=B6=EF=BC=8C=E6=9B=B4=E6=96=B0mapattr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/env/RemoteEnv.java | 38 +++++++++++++++++-- .../PlotSeries/MapGroupExtensionPane.java | 4 +- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 165ed3468a..96835b5738 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -56,8 +56,7 @@ import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLableReader; import com.fr.web.ResourceConstants; -import javax.swing.JOptionPane; -import javax.swing.UIManager; +import javax.swing.*; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; @@ -65,7 +64,7 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import java.awt.Component; +import java.awt.*; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -1537,7 +1536,7 @@ public class RemoteEnv extends AbstractEnv { testServerConnection(); HashMap para = new HashMap(); - para.put("op", "fr_remote_design"); + para.put("op", "svgrelate"); para.put("cmd", "design_save_svg"); para.put("filePath", svgFile.getFilePath()); para.put("current_uid", this.createUserID()); @@ -1578,6 +1577,37 @@ public class RemoteEnv extends AbstractEnv { return true; } + + /** + * 删除svg文件 + * + * @param filePath svg文件地址 + * @return 删除成功返回true + */ + public boolean deleteSvg(String filePath) { + if (filePath == null) { + return false; + } + try { + HashMap para = new HashMap(); + para.put("op", "svgrelate"); + para.put("cmd", "delete_svg"); + para.put("file_path", filePath); + + HttpClient client = createHttpMethod(para); + InputStream input = execute4InputStream(client); + + if (input == null) { + return false; + } + + return Boolean.valueOf(IOUtils.inputStream2String(input, EncodeConstants.ENCODING_UTF_8)); + } catch (Exception e) { + FRLogger.getLogger().error(e.getMessage()); + } + return false; + } + /** * 写报表运行环境所需的配置文件 * diff --git a/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java b/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java index 7a4732807b..1bcfc29778 100644 --- a/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java +++ b/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java @@ -361,9 +361,9 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver { groupExtensionPane.setValueAtCurrentSelectIndex(newName); fireStateChange(); saveMapInfo(newName); - FRContext.getCurrentEnv().deleteFile( + FRContext.getCurrentEnv().deleteSvg( StableUtils.pathJoin(new String[]{MapSvgXMLHelper.relativeDefaultMapPath(),oldName+SvgProvider.EXTENSION})); - FRContext.getCurrentEnv().deleteFile( + FRContext.getCurrentEnv().deleteSvg( StableUtils.pathJoin(new String[]{MapSvgXMLHelper.relativeCustomMapPath(),oldName+SvgProvider.EXTENSION})); refresh(); }catch (Exception exp){ From 8a09fabc29c5f645f82f1ffc84e1522dd8e83ebf Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 28 Sep 2017 15:07:07 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=8E=BB=E6=8E=89import=E4=B8=AD=E7=9A=84*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/env/RemoteEnv.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 96835b5738..0737e75da5 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -56,7 +56,8 @@ import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLableReader; import com.fr.web.ResourceConstants; -import javax.swing.*; +import javax.swing.JOptionPane; +import javax.swing.UIManager; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; @@ -64,7 +65,7 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import java.awt.*; +import java.awt.Component; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; From 2a9dc8e3ec642466693fc541774330876987e550 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Fri, 29 Sep 2017 09:05:38 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=8E=BB=E6=8E=89deleteSvg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/env/RemoteEnv.java | 46 ++++--------------- .../PlotSeries/MapGroupExtensionPane.java | 4 +- 2 files changed, 12 insertions(+), 38 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 0737e75da5..bcbedfe92a 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -56,8 +56,7 @@ import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLableReader; import com.fr.web.ResourceConstants; -import javax.swing.JOptionPane; -import javax.swing.UIManager; +import javax.swing.*; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; @@ -65,7 +64,7 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import java.awt.Component; +import java.awt.*; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -1014,8 +1013,14 @@ public class RemoteEnv extends AbstractEnv { } try { HashMap para = new HashMap(); - para.put("op", "fr_remote_design"); - para.put("cmd", "delete_file"); + if (filePath.contains(ProjectConstants.ASSETS_NAME)) { + para.put("op", "svgrelate"); + para.put("cmd", "delete_svg"); + } else { + para.put("op", "fr_remote_design"); + para.put("cmd", "delete_file"); + } + para.put("file_path", filePath); HttpClient client = createHttpMethod(para); @@ -1578,37 +1583,6 @@ public class RemoteEnv extends AbstractEnv { return true; } - - /** - * 删除svg文件 - * - * @param filePath svg文件地址 - * @return 删除成功返回true - */ - public boolean deleteSvg(String filePath) { - if (filePath == null) { - return false; - } - try { - HashMap para = new HashMap(); - para.put("op", "svgrelate"); - para.put("cmd", "delete_svg"); - para.put("file_path", filePath); - - HttpClient client = createHttpMethod(para); - InputStream input = execute4InputStream(client); - - if (input == null) { - return false; - } - - return Boolean.valueOf(IOUtils.inputStream2String(input, EncodeConstants.ENCODING_UTF_8)); - } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); - } - return false; - } - /** * 写报表运行环境所需的配置文件 * diff --git a/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java b/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java index 1bcfc29778..7a4732807b 100644 --- a/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java +++ b/designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java @@ -361,9 +361,9 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver { groupExtensionPane.setValueAtCurrentSelectIndex(newName); fireStateChange(); saveMapInfo(newName); - FRContext.getCurrentEnv().deleteSvg( + FRContext.getCurrentEnv().deleteFile( StableUtils.pathJoin(new String[]{MapSvgXMLHelper.relativeDefaultMapPath(),oldName+SvgProvider.EXTENSION})); - FRContext.getCurrentEnv().deleteSvg( + FRContext.getCurrentEnv().deleteFile( StableUtils.pathJoin(new String[]{MapSvgXMLHelper.relativeCustomMapPath(),oldName+SvgProvider.EXTENSION})); refresh(); }catch (Exception exp){ From 37cf02ee8594ae8f1e0194956e4f866dff9ebd3d Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Fri, 29 Sep 2017 09:37:18 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/env/RemoteEnv.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index bcbedfe92a..48614c83ae 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -1013,7 +1013,8 @@ public class RemoteEnv extends AbstractEnv { } try { HashMap para = new HashMap(); - if (filePath.contains(ProjectConstants.ASSETS_NAME)) { + //assets目录下的svg文件 + if (filePath.contains(ProjectConstants.ASSETS_NAME) && filePath.endsWith(".svg")) { para.put("op", "svgrelate"); para.put("cmd", "delete_svg"); } else { From 4c2058a146e90d341d941697b37307be977f22f4 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Fri, 29 Sep 2017 17:20:53 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E5=B1=82=E7=BA=A7=E4=B8=8B=E6=8B=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../type/VanChartMapSourceChoosePane.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java index b89bc667db..8fe71695ee 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -34,6 +34,7 @@ import com.fr.plugin.chart.service.WMSFactory; import com.fr.plugin.chart.type.GISLayerType; import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.ZoomLevel; +import com.fr.stable.ArrayUtils; import javax.swing.*; import javax.swing.event.PopupMenuEvent; @@ -79,6 +80,9 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { ZoomLevel.SEVENTEEN, ZoomLevel.SEVENTEENPOINTFIVE, ZoomLevel.EIGHTEEN }; + //深蓝和高德地图下拉框层级 + private static final ZoomLevel[] BLUE_ZOOM_LEVELS =(ZoomLevel[]) ArrayUtils.subarray(ZOOM_LEVELS, 0, 34); + private static final ZoomLevel[] GAODE_ZOOM_LEVELS =ArrayUtils.addAll(new ZoomLevel[]{ZoomLevel.AUTO}, (ZoomLevel[])ArrayUtils.subarray(ZOOM_LEVELS, 7, 38)); private static final String AUTO_CENTER_STRING = Inter.getLocText("Plugin-ChartF_Automatic"); private static final String CUSTOM_CENTER_STRING = Inter.getLocText("Plugin-ChartF_Custom"); @@ -230,6 +234,13 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { gisLayer = new UIComboBox(layers); + gisLayer.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + refreshZoomLevel(); + } + }); + gisLayer.addPopupMenuListener(new PopupMenuListener() { public void popupMenuCanceled(PopupMenuEvent e) { } @@ -296,6 +307,23 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { return panel; } + private void refreshZoomLevel(){ + //gis图层不同,对应的suo缩放等级不同。 + ZoomLevel[] levels; + if (ComparatorUtils.equals(gisLayer.getSelectedItem(), Inter.getLocText("Plugin-ChartF_Layer_Blue"))) { + levels = BLUE_ZOOM_LEVELS; + } else if (ComparatorUtils.equals(gisLayer.getSelectedItem(), Inter.getLocText("Plugin-ChartF_Layer_GaoDe"))) { + levels = GAODE_ZOOM_LEVELS; + } else { + levels = ZOOM_LEVELS; + } + zoomLevel.removeAllItems(); + for (int i = 0; i < levels.length; i++) { + zoomLevel.addItem(levels[i]); + } + } + + private JPanel createCustomTileLayer() { double p = TableLayout.PREFERRED; double[] rowSize = {p, p}; @@ -620,6 +648,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { customTileLayer.setText(layer.getCustomTileLayer()); attribution.setText(layer.getAttribution()); + refreshZoomLevel(); zoomLevel.setSelectedItem(mapPlot.getZoomLevel()); ViewCenter viewCenter = mapPlot.getViewCenter(); From d7c166e6e7f713f45992709c789d9596b1b5d796 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Fri, 29 Sep 2017 17:27:07 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E5=B1=82=E7=BA=A7=E4=B8=8B=E6=8B=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/env/RemoteEnv.java | 11 ++--------- .../designer/type/VanChartMapSourceChoosePane.java | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 48614c83ae..873f0c1ae4 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -1013,15 +1013,8 @@ public class RemoteEnv extends AbstractEnv { } try { HashMap para = new HashMap(); - //assets目录下的svg文件 - if (filePath.contains(ProjectConstants.ASSETS_NAME) && filePath.endsWith(".svg")) { - para.put("op", "svgrelate"); - para.put("cmd", "delete_svg"); - } else { - para.put("op", "fr_remote_design"); - para.put("cmd", "delete_file"); - } - + para.put("op", "fr_remote_design"); + para.put("cmd", "delete_file"); para.put("file_path", filePath); HttpClient client = createHttpMethod(para); diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java index 8fe71695ee..4408e085b5 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -308,7 +308,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { } private void refreshZoomLevel(){ - //gis图层不同,对应的suo缩放等级不同。 + //gis图层不同,对应的缩放等级不同。 ZoomLevel[] levels; if (ComparatorUtils.equals(gisLayer.getSelectedItem(), Inter.getLocText("Plugin-ChartF_Layer_Blue"))) { levels = BLUE_ZOOM_LEVELS; From 45031cee59a7053491e33a1a34de60f926a9cbd9 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Fri, 29 Sep 2017 17:34:31 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=8E=BB=E6=8E=89import=E4=B8=AD=E7=9A=84*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/env/RemoteEnv.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 873f0c1ae4..28579dcd53 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -56,7 +56,8 @@ import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLableReader; import com.fr.web.ResourceConstants; -import javax.swing.*; +import javax.swing.JOptionPane; +import javax.swing.UIManager; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; @@ -64,7 +65,7 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import java.awt.*; +import java.awt.Component; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream;