From 0cd9cbb974947e035410cd0a485387c844b9e6fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 14 Apr 2020 14:11:55 +0800 Subject: [PATCH] =?UTF-8?q?CHART-13460=20FR=E5=9C=B0=E5=9B=BE=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E7=BC=BA=E5=A4=B1=E4=B8=8B=E8=BD=BD=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/chart/ChartDesignerActivator.java | 4 +++ .../chart/DownloadOnlineSourcesHelper.java | 28 +++++++++---------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java index c5bfdc8390..f47f421344 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java @@ -1,6 +1,7 @@ package com.fr.design.chart; import com.fr.chart.chartattr.ChartCollection; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.gui.ChartComponent; @@ -17,6 +18,7 @@ import com.fr.module.Activator; import com.fr.module.extension.Prepare; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; +import com.fr.van.chart.DownloadOnlineSourcesHelper; import com.fr.van.chart.map.server.ChartMapEditorAction; /** @@ -47,6 +49,8 @@ public class ChartDesignerActivator extends Activator implements Prepare { DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption()); + GEOJSONHelper.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); + ChartTypeInterfaceManager.addPluginChangedListener(); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java b/designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java index c0fd710680..33dba72f9b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java +++ b/designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java @@ -6,26 +6,32 @@ import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.PluginConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.IOUtils; - import com.fr.general.CloudCenter; +import com.fr.general.IOUtils; import com.fr.general.http.HttpClient; import com.fr.plugin.chart.DownloadSourcesEvent; import com.fr.stable.CommonUtils; import com.fr.stable.StableUtils; import com.fr.workspace.WorkContext; -import javax.swing.*; -import java.awt.*; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.awt.image.BufferedImage; +import javax.swing.ImageIcon; +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JProgressBar; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.net.HttpURLConnection; import java.util.ArrayList; import java.util.List; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Rectangle; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.image.BufferedImage; /** * Created by shine on 2017/8/21. @@ -51,13 +57,6 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent { //总共字节数 private double totalBytes = 0; - - private static final double PHANTOM_MB = 96.1 * 1024 * 1024; - - public void addPhantomSiteInfo() { - this.addSiteInfo("plugin.phantomjs", ChartConstants.PHANTOMJS_URL, PHANTOM_MB); - } - private static final double MAP_JSON_MB = 4.5 * 1024 * 1024; public void addMapJSONSiteInfo() { @@ -219,7 +218,6 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent { @Override public void downloadSources() { this.addMapJSONSiteInfo(); - this.addPhantomSiteInfo(); this.installOnline(); }