From ab4bc6ad3826c7aa138dd222adb957623fe0b0a9 Mon Sep 17 00:00:00 2001 From: fr_shine Date: Wed, 23 Aug 2017 15:57:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8B=BC=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/file/HistoryTemplateListPane.java | 6 +++--- ...eSourcesHelper.java => DownloadOnlineSourcesHelper.java} | 2 +- .../src/com/fr/design/chart/gui/ChartComponent.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) rename designer_base/src/com/fr/design/gui/chart/{DownLoadOnLineSourcesHelper.java => DownloadOnlineSourcesHelper.java} (99%) diff --git a/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java b/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java index 50eb2a46f3..8ee8c0532b 100644 --- a/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java @@ -8,7 +8,7 @@ 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.chart.DownloadOnlineSourcesHelper; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.UIList; @@ -234,8 +234,8 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C } @Override - public void downLoadSources() { - DownLoadOnLineSourcesHelper pane = new DownLoadOnLineSourcesHelper(); + public void downloadSources() { + DownloadOnlineSourcesHelper pane = new DownloadOnlineSourcesHelper(); pane.addMapJSONSiteInfo(); pane.addPhantomSiteInfo(); pane.installOnline(); diff --git a/designer_base/src/com/fr/design/gui/chart/DownLoadOnLineSourcesHelper.java b/designer_base/src/com/fr/design/gui/chart/DownloadOnlineSourcesHelper.java similarity index 99% rename from designer_base/src/com/fr/design/gui/chart/DownLoadOnLineSourcesHelper.java rename to designer_base/src/com/fr/design/gui/chart/DownloadOnlineSourcesHelper.java index a8baa25939..71ce354be9 100644 --- a/designer_base/src/com/fr/design/gui/chart/DownLoadOnLineSourcesHelper.java +++ b/designer_base/src/com/fr/design/gui/chart/DownloadOnlineSourcesHelper.java @@ -26,7 +26,7 @@ import java.util.List; /** * Created by shine on 2017/8/21. */ -public class DownLoadOnLineSourcesHelper { +public class DownloadOnlineSourcesHelper { // 定义加载窗口大小 private static final int LOAD_WIDTH = 455; private static final int INCIDENT_HEIGHT = 15; 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..bd71ea77a9 100644 --- a/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java +++ b/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java @@ -333,8 +333,8 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene } @Override - public void downLoadSources() { - HistoryTemplateListPane.getInstance().downLoadSources(); + public void downloadSources() { + HistoryTemplateListPane.getInstance().downloadSources(); } } \ No newline at end of file From e1f7289cb633615c2f05e95fb2caa69f3e14f6e7 Mon Sep 17 00:00:00 2001 From: fr_shine Date: Wed, 23 Aug 2017 16:22:17 +0800 Subject: [PATCH 2/2] 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