From 87da9ab669e26241bec957712ef822935a862210 Mon Sep 17 00:00:00 2001 From: fr_shine Date: Tue, 15 Aug 2017 13:47:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E8=8E=B7=E5=8F=96=E5=8F=82?= =?UTF-8?q?=E6=95=B0&phantom=20request=20image=20end=20callback=20repaint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListPane.java | 44 ++++++++++--------- .../fr/design/ChartTypeInterfaceManager.java | 3 ++ .../type/VanChartMapSourceChoosePane.java | 21 +++++---- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java b/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java index c61a39c431..cb0e43712c 100644 --- a/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java @@ -1,31 +1,20 @@ package com.fr.design.file; -import java.awt.*; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.*; -import java.util.List; -import java.util.logging.Level; - -import javax.swing.*; - -import com.fr.design.constants.UIConstants; -import com.fr.design.DesignerEnvManager; -import com.fr.design.data.DesignTableDataManager; -import com.fr.design.gui.ilable.UILabel; - -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - import com.fr.base.FRContext; -import com.fr.design.data.datapane.TableDataTreePane; +import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.dav.LocalEnv; import com.fr.design.DesignModelAdapter; +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.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.UIList; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.module.DesignModuleFactory; +import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; @@ -33,9 +22,19 @@ import com.fr.general.GeneralContext; import com.fr.general.Inter; import com.fr.stable.Constants; import com.fr.stable.project.ProjectConstants; -import com.fr.design.utils.gui.GUIPaintUtils; -public class HistoryTemplateListPane extends JPanel implements FileOperations { +import javax.swing.*; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import java.awt.*; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.logging.Level; + +public class HistoryTemplateListPane extends JPanel implements FileOperations, CallbackEvent{ private static final int LIST_BORDER = 4; private List> historyList; private JTemplate editingTemplate; @@ -228,6 +227,11 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations { return ComparatorUtils.equals(filename, editingFileName); } + @Override + public void callback() { + getCurrentEditingTemplate().repaint(); + } + private class HistoryListCellRender extends DefaultListCellRenderer { diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 6730fd1240..6e8c898717 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -27,6 +27,7 @@ import com.fr.design.chartinterface.RangeIndependentChartInterface; import com.fr.design.chartinterface.StockIndependentChartInterface; import com.fr.design.chartinterface.XYScatterIndependentChartInterface; import com.fr.design.condition.ConditionAttributesPane; +import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.AbstractChartAttrPane; @@ -76,6 +77,7 @@ import com.fr.plugin.chart.structure.VanChartStructurePlot; import com.fr.plugin.chart.structure.desinger.StructureIndependentVanChartInterface; import com.fr.plugin.chart.treemap.TreeMapIndependentVanChartInterface; import com.fr.plugin.chart.treemap.VanChartTreeMapPlot; +import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent; import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; import com.fr.plugin.chart.wordcloud.designer.WordCloudIndependentVanChartInterface; import com.fr.plugin.injectable.PluginSingleInjection; @@ -122,6 +124,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr public void envChanged() { //重新注册designModuleFactory DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption()); + DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance()); } }); } diff --git a/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java index 1279a6c783..0d401855a7 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -1,6 +1,7 @@ package com.fr.plugin.chart.map.designer.type; import com.fr.base.Parameter; +import com.fr.base.ParameterHolder; import com.fr.base.Utils; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; @@ -40,7 +41,12 @@ import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; import java.awt.*; -import java.awt.event.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; import java.util.ArrayList; /** @@ -511,16 +517,9 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { return new String[0]; } String[] params = new String[0]; - //区分是表单还是cpt - //todo@shine9.0 -// if (jTemplate instanceof JWorkBook) { -// ReportParameterAttr rpa = ((JWorkBook)jTemplate).getTarget().getReportParameterAttr(); -// if (rpa != null) { -// params = getParamsName(rpa.getParameters()); -// } -// }else if (jTemplate instanceof JForm){ -// params = getParamsName(((JForm)jTemplate).getTarget().getParameters()); -// } + if(jTemplate.getTarget() instanceof ParameterHolder){ + params = getParamsName(((ParameterHolder)jTemplate.getTarget()).getParameters()); + } return params; }