From e24156166b53d1e928f22e281eb46db3b5d2f67e Mon Sep 17 00:00:00 2001 From: fr_shine Date: Mon, 14 Aug 2017 18:01:58 +0800 Subject: [PATCH 1/3] chart demo image --- .../com/fr/design/ChartTypeInterfaceManager.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 8ef36de4c..64a2acb1f 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -70,6 +70,7 @@ import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.solution.closeable.CloseableContainedMap; import com.fr.stable.ArrayUtils; +import com.fr.stable.EnvChangedListener; import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; @@ -100,21 +101,13 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr } static { - - GeneralContext.listenPluginRunningChanged(new PluginEventListener() { - + + GeneralContext.addEnvChangedListener(new EnvChangedListener() { @Override - public void on(PluginEvent event) { + public void envChanged() { //重新注册designModuleFactory DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption()); } - }, new PluginFilter() { - - @Override - public boolean accept(PluginContext context) { - - return context.contain(PluginModule.ExtraChartType); - } }); } From 845f78e8d5752dd238f23ce3fe354cce33470dea Mon Sep 17 00:00:00 2001 From: fr_shine Date: Mon, 14 Aug 2017 19:03:17 +0800 Subject: [PATCH 2/3] update --- .../fr/design/ChartTypeInterfaceManager.java | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 64a2acb1f..6730fd124 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -9,7 +9,23 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.chart.fun.IndependentChartUIProvider; import com.fr.design.chart.gui.ChartWidgetOption; -import com.fr.design.chartinterface.*; +import com.fr.design.chartinterface.AreaIndependentChartInterface; +import com.fr.design.chartinterface.BarIndependentChartInterface; +import com.fr.design.chartinterface.BubbleIndependentChartInterface; +import com.fr.design.chartinterface.ColumnIndependentChartInterface; +import com.fr.design.chartinterface.CustomIndependentChartInterface; +import com.fr.design.chartinterface.DonutIndependentChartInterface; +import com.fr.design.chartinterface.FunnelIndependentChartInterface; +import com.fr.design.chartinterface.GanttIndependentChartInterface; +import com.fr.design.chartinterface.GisMapIndependentChartInterface; +import com.fr.design.chartinterface.LineIndependentChartInterface; +import com.fr.design.chartinterface.MapIndependentChartInterface; +import com.fr.design.chartinterface.MeterIndependentChartInterface; +import com.fr.design.chartinterface.PieIndependentChartInterface; +import com.fr.design.chartinterface.RadarIndependentChartInterface; +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.gui.core.WidgetOption; import com.fr.design.gui.frpane.AttributeChangeListener; @@ -62,12 +78,7 @@ import com.fr.plugin.chart.treemap.TreeMapIndependentVanChartInterface; import com.fr.plugin.chart.treemap.VanChartTreeMapPlot; import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; import com.fr.plugin.chart.wordcloud.designer.WordCloudIndependentVanChartInterface; -import com.fr.plugin.context.PluginContext; -import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.injectable.PluginSingleInjection; -import com.fr.plugin.manage.PluginFilter; -import com.fr.plugin.observer.PluginEvent; -import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.solution.closeable.CloseableContainedMap; import com.fr.stable.ArrayUtils; import com.fr.stable.EnvChangedListener; @@ -76,7 +87,11 @@ import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import javax.swing.*; -import java.util.*; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; /** * Created by eason on 14/12/29. From 87da9ab669e26241bec957712ef822935a862210 Mon Sep 17 00:00:00 2001 From: fr_shine Date: Tue, 15 Aug 2017 13:47:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=8F=82=E6=95=B0&phantom=20request=20image=20end=20callback?= =?UTF-8?q?=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 c61a39c43..cb0e43712 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 6730fd124..6e8c89871 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 1279a6c78..0d401855a 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; }