Browse Source

整理一波assets/map assist/phantomjs

master
zheng 7 years ago
parent
commit
7bce2c1ce3
  1. 7
      designer_chart/src/com/fr/van/chart/DownloadOnlineSourcesHelper.java

7
designer_chart/src/com/fr/van/chart/DownloadOnlineSourcesHelper.java

@ -1,6 +1,7 @@
package com.fr.van.chart; package com.fr.van.chart;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.chart.base.ChartConstants;
import com.fr.design.RestartHelper; import com.fr.design.RestartHelper;
import com.fr.design.extra.PluginConstants; import com.fr.design.extra.PluginConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -59,17 +60,17 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent {
private static final double PHANTOM_MB = 96.1 * 1024 * 1024; private static final double PHANTOM_MB = 96.1 * 1024 * 1024;
public void addPhantomSiteInfo() { public void addPhantomSiteInfo() {
this.addSiteInfo("plugin.phantomjs", "/assist/phantomjs", PHANTOM_MB); this.addSiteInfo("plugin.phantomjs", ChartConstants.PHANTOMJS_URL, PHANTOM_MB);
} }
private static final double MAP_JSON_MB = 3.8 * 1024 * 1024; private static final double MAP_JSON_MB = 3.8 * 1024 * 1024;
public void addMapJSONSiteInfo() { public void addMapJSONSiteInfo() {
this.addSiteInfo("map.json", "/assets/map", MAP_JSON_MB); this.addSiteInfo("map.json", ChartConstants.MAP_JSON_URL, MAP_JSON_MB);
} }
public void addSiteInfo(String siteKind, String localDir, double megaBits) { public void addSiteInfo(String siteKind, String localDir, double megaBits) {
if (new File(FRContext.getCurrentEnv().getPath() + localDir).exists()) { if (new File(StableUtils.pathJoin(FRContext.getCurrentEnv().getPath(), localDir)).exists()) {
//本地有这个资源,不下载 //本地有这个资源,不下载
return; return;
} }

Loading…
Cancel
Save