Browse Source

Pull request #6515: REPORT-61610 fix:回退最开始关于 相同的图表类型,不会新建图表配置界面 的逻辑改动

Merge in DESIGN/design from ~ZHENG/c-design:release/10.0 to release/10.0

* commit '62dd39fa1c7eea76a4d7c68b3dd3e1b4d10ab697':
  REPORT-61610 fix:回退最开始关于 相同的图表类型,不会新建图表配置界面 的逻辑改动
zheng-1641779399395
zheng 3 years ago
parent
commit
a6f636a772
  1. 34
      designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java

34
designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java

@ -16,14 +16,6 @@ import com.fr.design.gui.chart.ChartEditPaneProvider;
import com.fr.design.gui.frpane.UITitlePanel; import com.fr.design.gui.frpane.UITitlePanel;
import com.fr.design.mainframe.chart.ChartEditPane; import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.GeneralContext;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginEventType;
import com.fr.stable.AssistUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
@ -43,12 +35,8 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
protected ChartEditPane chartEditPane; protected ChartEditPane chartEditPane;
//ID一样的话 不用新建chartEditPane
private String currentID;
private ChartPropertyPane() { private ChartPropertyPane() {
initComponent(); initComponent();
addListener();
} }
protected void initComponent() { protected void initComponent() {
@ -56,33 +44,11 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
} }
private void addListener() {
GeneralContext.listenPlugin(PluginEventType.AfterRun, new PluginEventListener() {
@Override
public void on(PluginEvent event) {
//禁用启用图表插件 这边id置空。这样展示图表配置属性不管和上一个id是否一样 都新建chartEditPane
currentID = null;
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraChartDesign);
}
});
}
@Override @Override
public void updateChartEditPane(String plotID) { public void updateChartEditPane(String plotID) {
if (!AssistUtils.equals(currentID, plotID)) {
chartEditPane = ChartTypeInterfaceManager.getInstance().getChartEditPane(plotID); chartEditPane = ChartTypeInterfaceManager.getInstance().getChartEditPane(plotID);
chartEditPane.setContainer(container); chartEditPane.setContainer(container);
currentID = plotID;
resetChartEditPane(); resetChartEditPane();
} else {
chartEditPane.resetLastChartCollection();
}
} }
@Override @Override

Loading…
Cancel
Save