From e1f7289cb633615c2f05e95fb2caa69f3e14f6e7 Mon Sep 17 00:00:00 2001 From: fr_shine Date: Wed, 23 Aug 2017 16:22:17 +0800 Subject: [PATCH] update --- .../fr/design/file/HistoryTemplateListPane.java | 9 --------- .../com/fr/design/ChartTypeInterfaceManager.java | 2 ++ .../com/fr/design/chart/gui/ChartComponent.java | 6 ------ .../plugin}/chart/DownloadOnlineSourcesHelper.java | 13 ++++++++++--- .../src/com/fr/plugin}/chart/background.png | Bin 5 files changed, 12 insertions(+), 18 deletions(-) rename {designer_base/src/com/fr/design/gui => designer_chart/src/com/fr/plugin}/chart/DownloadOnlineSourcesHelper.java (95%) rename {designer_base/src/com/fr/design/gui => designer_chart/src/com/fr/plugin}/chart/background.png (100%) diff --git a/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java b/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java index 8ee8c0532b..87d5693241 100644 --- a/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java @@ -8,7 +8,6 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataTreePane; -import com.fr.design.gui.chart.DownloadOnlineSourcesHelper; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.UIList; @@ -233,14 +232,6 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C getCurrentEditingTemplate().repaint(); } - @Override - public void downloadSources() { - DownloadOnlineSourcesHelper pane = new DownloadOnlineSourcesHelper(); - pane.addMapJSONSiteInfo(); - pane.addPhantomSiteInfo(); - pane.installOnline(); - } - private class HistoryListCellRender extends DefaultListCellRenderer { @Override diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 6e8c898717..df150a3f11 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -42,6 +42,7 @@ import com.fr.form.ui.ChartEditor; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.Inter; +import com.fr.plugin.chart.DownloadOnlineSourcesHelper; import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.area.AreaIndependentVanChartInterface; import com.fr.plugin.chart.area.VanChartAreaPlot; @@ -125,6 +126,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr //重新注册designModuleFactory DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption()); DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance()); + DesignImageEvent.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); } }); } diff --git a/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java b/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java index bd71ea77a9..9c48aaa360 100644 --- a/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java +++ b/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java @@ -331,10 +331,4 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene public void callback() { this.repaint(); } - - @Override - public void downloadSources() { - HistoryTemplateListPane.getInstance().downloadSources(); - } - } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/gui/chart/DownloadOnlineSourcesHelper.java b/designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java similarity index 95% rename from designer_base/src/com/fr/design/gui/chart/DownloadOnlineSourcesHelper.java rename to designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java index 71ce354be9..1f8d057378 100644 --- a/designer_base/src/com/fr/design/gui/chart/DownloadOnlineSourcesHelper.java +++ b/designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java @@ -1,4 +1,4 @@ -package com.fr.design.gui.chart; +package com.fr.plugin.chart; import com.fr.base.FRContext; import com.fr.design.RestartHelper; @@ -26,7 +26,7 @@ import java.util.List; /** * Created by shine on 2017/8/21. */ -public class DownloadOnlineSourcesHelper { +public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent{ // 定义加载窗口大小 private static final int LOAD_WIDTH = 455; private static final int INCIDENT_HEIGHT = 15; @@ -151,7 +151,7 @@ public class DownloadOnlineSourcesHelper { private void initDialog() { // 创建标签,并在标签上放置一张图片 - BufferedImage image = IOUtils.readImage("/com/fr/design/gui/chart/background.png"); + BufferedImage image = IOUtils.readImage("/com/fr/plugin/chart/background.png"); ImageIcon imageIcon = new ImageIcon(image); UILabel label = new UILabel(imageIcon); label.setBounds(0, 0, LOAD_WIDTH, LOAD_HEIGHT); @@ -209,6 +209,13 @@ public class DownloadOnlineSourcesHelper { } } + @Override + public void downloadSources() { + this.addMapJSONSiteInfo(); + this.addPhantomSiteInfo(); + this.installOnline(); + } + private class SiteInfo { String siteKind; String localDir; diff --git a/designer_base/src/com/fr/design/gui/chart/background.png b/designer_chart/src/com/fr/plugin/chart/background.png similarity index 100% rename from designer_base/src/com/fr/design/gui/chart/background.png rename to designer_chart/src/com/fr/plugin/chart/background.png