diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java index 8ad2e6198f..65d6abd640 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java @@ -4,6 +4,7 @@ import com.fr.chart.chartattr.ChartCollection; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.gui.ChartComponent; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.design.module.ChartEmptyDataStyleAction; import com.fr.design.module.ChartHyperlinkGroup; @@ -50,6 +51,7 @@ public class ChartDesignerActivator extends Activator implements Prepare { DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption()); ImagePainter.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); + ImagePainter.registerDefaultCallbackEvent(HistoryTemplateListCache.getInstance()); ChartTypeInterfaceManager.addPluginChangedListener(); } diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java index c8fafe9cdb..aa7f9107b2 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java +++ b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java @@ -31,7 +31,7 @@ import java.awt.event.MouseMotionListener; * 类说明: 事件说明: 工具栏编辑--> 是刷新ChartComponent 然后响应整个设计块的改变事件 右键编辑 ---> 刷新ChartCompment 刷新对应的工具栏(加入事件) 然后响应整个设计块的改变事件 */ -public class ChartComponent extends MiddleChartComponent implements MouseListener, MouseMotionListener{ +public class ChartComponent extends MiddleChartComponent implements MouseListener, MouseMotionListener, CallbackEvent{ private static final long serialVersionUID = 744164838619052097L; private final List listeners = new ArrayList(); private ChartCollection chartCollection4Design; @@ -257,7 +257,12 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene if (resolution == 0){ resolution = ScreenResolution.getScreenResolution(); } - painter.paint(g2d, chartWidth, chartHeight, resolution, null); + painter.paint(g2d, chartWidth, chartHeight, resolution, null,this); } } + + @Override + public void callback() { + this.repaint(); + } } \ No newline at end of file