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 8ef36de4c..6e8c89871 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -9,8 +9,25 @@ 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.file.HistoryTemplateListPane; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.AbstractChartAttrPane; @@ -60,22 +77,23 @@ 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.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; import com.fr.stable.StringUtils; 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. @@ -100,20 +118,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); + 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; }