From cb55c20c56f00d41f086185adb9b12f2d9d00e85 Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Thu, 15 Dec 2016 13:27:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E6=9E=84=E5=BB=BA=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E6=97=B6=EF=BC=8C=E5=B0=B1=E8=80=83=E8=99=91=E5=88=B0?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=A4=84=E4=BA=8E=E5=88=87=E6=8D=A2=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/ChartTypeButtonPane.java | 2 +- .../mainframe/chart/gui/ChartTypePane.java | 23 +++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) 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 6b6c9a427..91b6bba3c 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 @@ -138,7 +138,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen private void checkoutChange(){ editingCollection.calculateMultiChartMode(); if (parent != null){ - parent.reactorChartTypePane(editingCollection); + parent.relayoutChartTypePane(editingCollection); } //检查是否可以配置切换 configButton.setEnabled(editingCollection.changeEnable()); 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 6c747c9cc..a3a028ef8 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 @@ -68,8 +68,13 @@ public class ChartTypePane extends AbstractChartAttrPane{ buttonPane = new ChartTypeButtonPane(this); content.add(buttonPane, BorderLayout.NORTH); - - chartTypePane = new ComboBoxPane(); + + if (editingCollection != null) { + relayoutChartTypePane(editingCollection); + }else { + chartTypePane = new ComboBoxPane(); + } + BasicScrollPane scrollPane = new BasicScrollPane() { @Override protected JPanel createContentPane() { @@ -192,7 +197,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ }); } - public void reactor(ChartCollection collection){ + public void relayout(ChartCollection collection){ //重构需要重构下拉框选项和cardNames Chart chart = collection.getSelectedChart(); String chartID = chart.getPriority(); @@ -278,9 +283,9 @@ public class ChartTypePane extends AbstractChartAttrPane{ } - public void reactorChartTypePane(ChartCollection collection){ - if (needReactor(collection)) { - chartTypePane.reactor(collection); + public void relayoutChartTypePane(ChartCollection collection){ + if (needRelayout(collection)) { + chartTypePane.relayout(collection); //设置面板切换状态 updatePaneState(collection); } @@ -292,7 +297,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ } // TODO: 2016/11/17 因为现在populate面板时会重新构造面板,所以每次都需要重构 - private boolean needReactor(ChartCollection collection) { + private boolean needRelayout(ChartCollection collection) { /*return paneState.getChartID() != collection.getRepresentChartID() || paneState.getPaneState() != collection.getState();*/ return true; } @@ -301,14 +306,14 @@ public class ChartTypePane extends AbstractChartAttrPane{ * 更新界面属性 用于展示 */ public void populate(ChartCollection collection) { + editingCollection = collection; + Chart chart = collection.getSelectedChart(); this.remove(leftContentPane); initContentPane(); buttonPane.populateBean(collection); chartTypePane.populateBean(chart); - //remove面板之后,就需要重构下拉框 - reactorChartTypePane(collection); this.initAllListeners(); }