From d87a903c8116bf14941e8aa26555f57e4d236182 Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Mon, 9 Jan 2017 14:08:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/gui/icombobox/UIComboBox.java | 4 ++++ .../mainframe/chart/gui/style/ChartTextAttrPane.java | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/designer_base/src/com/fr/design/gui/icombobox/UIComboBox.java b/designer_base/src/com/fr/design/gui/icombobox/UIComboBox.java index 4840121b8..350b99ead 100644 --- a/designer_base/src/com/fr/design/gui/icombobox/UIComboBox.java +++ b/designer_base/src/com/fr/design/gui/icombobox/UIComboBox.java @@ -164,6 +164,10 @@ public class UIComboBox extends JComboBox implements UIObserver, GlobalNameObser uiObserverListener = null; } + public UIObserverListener getUiObserverListener(){ + return uiObserverListener; + } + /** * @return */ diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index 1e383dede..5b1ba5aee 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -11,6 +11,7 @@ import com.fr.base.BaseUtils; import com.fr.base.Utils; import com.fr.chart.base.TextAttr; import com.fr.design.constants.LayoutConstants; +import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.UIComboBox; @@ -71,6 +72,7 @@ public class ChartTextAttrPane extends BasicPane { } public void populate(FRFont frFont) { + UIObserverListener listener = fontNameComboBox == null ? null : fontNameComboBox.getUiObserverListener(); removeAllComboBoxListener(); if (frFont == null) { return; @@ -84,6 +86,9 @@ public class ChartTextAttrPane extends BasicPane { if (fontColor != null) { fontColor.setColor(frFont.getForeground()); } + + //更新结束后,注册监听器 + registerAllComboBoxListener(listener); } private void removeAllComboBoxListener() { @@ -91,6 +96,11 @@ public class ChartTextAttrPane extends BasicPane { fontSizeComboBox.removeChangeListener(); } + private void registerAllComboBoxListener(UIObserverListener listener) { + fontNameComboBox.registerChangeListener(listener); + fontSizeComboBox.registerChangeListener(listener); + } + /** * 更新字 * @return 更新字