diff --git a/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java b/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java index 8565135629..5ce350450b 100644 --- a/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java +++ b/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java @@ -315,7 +315,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene //不直接画chartGlyph而画image的原因是表单的柱形图会溢出表单 //其他图都ok,其实感觉应该是柱形图画的不对,应该也可以改那边 //处理画图事件 - Image chartImage = chartGlyph.toImage(chartWidth,chartHeight,ScreenResolution.getScreenResolution(), this); + Image chartImage = chartGlyph.toImage(chartWidth,chartHeight,ScreenResolution.getScreenResolution(), this, null); g2d.drawImage(chartImage, 0, 0, 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 1c2bd85ed9..8ee4e4667f 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 @@ -19,6 +19,7 @@ import com.fr.design.mainframe.chart.gui.ChartTypePane.ComboBoxPane; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; import com.fr.general.Inter; +import com.fr.stable.StringUtils; import javax.swing.*; import java.awt.*; @@ -502,9 +503,17 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen if (isEnabled()) { noSelected(); + //记录改变前的plotID + String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChart().getPlot().getPlotID(); changeCollectionSelected(getButtonName()); setSelectedWithFireListener(true); fireSelectedChanged(); + + //需要先更新,最后重构面板 + //重构面板 + if (parent != null ){ + parent.reLayoutEditPane(lastPlotID, 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 bd63724e1b..eab0010eae 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,7 +8,6 @@ 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; @@ -127,7 +126,13 @@ public class ChartTypePane extends AbstractChartAttrPane{ protected String title4PopupWindow() { return null; } - + + /** + * 不同图表切换分同一个selected的不同图表切换和不同selected的不同图表切换 + * 如果是切换图表的某个图表发生变化,则collection的选择下标不会变 + * 如果是切换图表的不同图表之间切换,则collection的选择下标会改变 + * @param chart + */ public void updateBean(Chart chart) { Plot oldPlot = chart.getPlot(); @@ -258,6 +263,21 @@ public class ChartTypePane extends AbstractChartAttrPane{ } + /** + * 面板重构 + * @param lastPlotID + * @param collection + */ + public void reLayoutEditPane(String lastPlotID, ChartCollection collection){ + Chart chart = collection.getSelectedChart(); + String plotID = chart.getPlot().getPlotID(); + boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID); + if (editPane != null && editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, plotID))){ + editPane.reLayout(chart); + } + } + + public void reactorChartTypePane(ChartCollection collection){ if (needReactor(collection)) { chartTypePane.reactor(collection); @@ -291,7 +311,6 @@ public class ChartTypePane extends AbstractChartAttrPane{ editingCollection = collection; buttonPane.update(collection);// 内部操作时 已经做过处理. Chart chart = collection.getSelectedChart(); - chartTypePane.updateBean(chart); }