diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 1909c947cf..6b280b3982 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -249,6 +249,21 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh return new String[0]; } + /** + * 获取指定图表的标题 + * @param chartID + * @return + */ + public String getTitle4PopupWindow(String chartID, String plotID){ + if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(chartID) && chartTypeInterfaces.get(chartID).containsKey(plotID)){ + HashMap chartUIList = chartTypeInterfaces.get(chartID); + IndependentChartUIProvider provider = chartTypeInterfaces.get(chartID).get(plotID); + return provider.getPlotTypePane().title4PopupWindow(); + + } + return new String(); + } + private String[] getTitle4PopupWindow(){ int size = 0; if (chartTypeInterfaces != null){ diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 0fef00f319..f9c6e572c6 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -158,8 +158,8 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen //获取图表收集器的状态 private void checkoutChange(){ - SwitchState state = editingCollection.calculateMultiChartMode(); - if (state.isDynamicState() && parent != null){ + editingCollection.calculateMultiChartMode(); + if (parent != null){ parent.reactorChartTypePane(editingCollection); } //检查是否可以配置切换 diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java index 84cfbd52ba..01d47d4b7d 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -8,6 +8,7 @@ import com.fr.chart.chartattr.SwitchState; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.beans.FurtherBasicBeanPane; +import com.fr.design.chart.fun.IndependentChartUIProvider; import com.fr.design.dialog.BasicScrollPane; import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.icombobox.UIComboBox; @@ -37,6 +38,8 @@ public class ChartTypePane extends AbstractChartAttrPane{ private ChartTypeButtonPane buttonPane; private ChartEditPane editPane; private ChartCollection editingCollection; + //记录面板所处状态 + private SwitchState paneState = SwitchState.DEFAULT; @Override protected JPanel createContentPane() { @@ -161,11 +164,10 @@ public class ChartTypePane extends AbstractChartAttrPane{ } public void reactor(ChartCollection collection){ - //重构前存储所选择的下拉选项 - Object item = jcb.getSelectedItem(); //重构需要重构下拉框选项和cardNames Chart chart = collection.getSelectedChart(); String chartID = chart.getChartID(); + String plotID = chart.getPlot().getPlotID(); if (collection.getState() == SwitchState.DEFAULT){ chartID = StringUtils.EMPTY; } @@ -179,6 +181,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ fcb.addItem(cardNames[i]); } //重新选择选中的下拉项 + Object item = ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(chartID, plotID); jcb.setSelectedItem(item); fcb.setItemEvenType(ItemEventType.DEFAULT); } @@ -220,7 +223,11 @@ public class ChartTypePane extends AbstractChartAttrPane{ public void reactorChartTypePane(ChartCollection collection){ - chartTypePane.reactor(collection); + if (paneState != collection.getState()) { + chartTypePane.reactor(collection); + //设置面板切换状态 + paneState = collection.getState(); + } } /**