diff --git a/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java b/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java index ab1b30babe..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,13 +232,6 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C getCurrentEditingTemplate().repaint(); } - 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 2caa2a0b95..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 a8baa25939..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