From 05252c0031a890279135f7ba66c3e325608ef21f Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Mon, 5 Sep 2016 16:24:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/extra/PluginHelper.java | 3 +++ .../design/extra/plugindependence/DownLoadDependenceUI.java | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/extra/PluginHelper.java b/designer_base/src/com/fr/design/extra/PluginHelper.java index 631bc984b6..2d32eef023 100644 --- a/designer_base/src/com/fr/design/extra/PluginHelper.java +++ b/designer_base/src/com/fr/design/extra/PluginHelper.java @@ -126,6 +126,9 @@ public class PluginHelper { //将所有未配置好的资源文件依赖准备好 private static void checkDependenceEnv(Plugin plugin) { PluginDependence dependence = plugin.getDependence(); + if (dependence == null){ + return; + } List list = dependence.getDependPlugins(); for (int i = 0;list != null && i < list.size(); i++){ PluginDependenceUnit preDependence = list.get(i); diff --git a/designer_base/src/com/fr/design/extra/plugindependence/DownLoadDependenceUI.java b/designer_base/src/com/fr/design/extra/plugindependence/DownLoadDependenceUI.java index 701bf9bbd4..9cbbefceee 100644 --- a/designer_base/src/com/fr/design/extra/plugindependence/DownLoadDependenceUI.java +++ b/designer_base/src/com/fr/design/extra/plugindependence/DownLoadDependenceUI.java @@ -211,7 +211,7 @@ public class DownLoadDependenceUI implements ActionListener { } public boolean preOnline() { - int choose = JOptionPane.showConfirmDialog(null, "新图表需要" + ID + "支持。是否需要安装" + ID + "(" + totalSize/Math.pow(10, 6) + " m)?", "install tooltip", JOptionPane.YES_NO_OPTION); + int choose = JOptionPane.showConfirmDialog(null, "新图表需要" + ID + "支持。是否需要安装" + ID + "(" + showFileLength() + " m)?", "install tooltip", JOptionPane.YES_NO_OPTION); if (choose == 0){//下载安装 if (!connectToServer()){ JOptionPane.showMessageDialog(null, "无法连接远程服务器!!", "警告", JOptionPane.ERROR_MESSAGE); @@ -229,4 +229,8 @@ public class DownLoadDependenceUI implements ActionListener { return true; } } + + private String showFileLength() { + return totalSize == -1 ? "NAN" : totalSize/Math.pow(10, 6) + ""; + } }