Browse Source

下拉框监听器

master
Fangjie Hu 8 years ago
parent
commit
d87a903c81
  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;
}
public UIObserverListener getUiObserverListener(){
return uiObserverListener;
}
/**
* @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.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 更新字

Loading…
Cancel
Save