Browse Source

Merge pull request #638 in BA/design from ~XIAOHU/design:master to master

* commit 'd87a903c8116bf14941e8aa26555f57e4d236182':
  下拉框监听器
master
superman 8 years ago
parent
commit
6376514b9b
  1. 4
      designer_base/src/com/fr/design/gui/icombobox/UIComboBox.java
  2. 10
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java

4
designer_base/src/com/fr/design/gui/icombobox/UIComboBox.java

@ -164,6 +164,10 @@ public class UIComboBox extends JComboBox implements UIObserver, GlobalNameObser
uiObserverListener = null; uiObserverListener = null;
} }
public UIObserverListener getUiObserverListener(){
return uiObserverListener;
}
/** /**
* @return * @return
*/ */

10
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.base.Utils;
import com.fr.chart.base.TextAttr; import com.fr.chart.base.TextAttr;
import com.fr.design.constants.LayoutConstants; 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.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
@ -71,6 +72,7 @@ public class ChartTextAttrPane extends BasicPane {
} }
public void populate(FRFont frFont) { public void populate(FRFont frFont) {
UIObserverListener listener = fontNameComboBox == null ? null : fontNameComboBox.getUiObserverListener();
removeAllComboBoxListener(); removeAllComboBoxListener();
if (frFont == null) { if (frFont == null) {
return; return;
@ -84,6 +86,9 @@ public class ChartTextAttrPane extends BasicPane {
if (fontColor != null) { if (fontColor != null) {
fontColor.setColor(frFont.getForeground()); fontColor.setColor(frFont.getForeground());
} }
//更新结束后,注册监听器
registerAllComboBoxListener(listener);
} }
private void removeAllComboBoxListener() { private void removeAllComboBoxListener() {
@ -91,6 +96,11 @@ public class ChartTextAttrPane extends BasicPane {
fontSizeComboBox.removeChangeListener(); fontSizeComboBox.removeChangeListener();
} }
private void registerAllComboBoxListener(UIObserverListener listener) {
fontNameComboBox.registerChangeListener(listener);
fontSizeComboBox.registerChangeListener(listener);
}
/** /**
* 更新字 * 更新字
* @return 更新字 * @return 更新字

Loading…
Cancel
Save