|
|
|
@ -5,6 +5,7 @@ package com.fr.design.cell.editor;
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseFormula; |
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
|
import com.fr.base.Utils; |
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
|
import com.fr.design.dialog.DialogActionAdapter; |
|
|
|
@ -61,6 +62,11 @@ public class RichTextToolBar extends BasicPane{
|
|
|
|
|
|
|
|
|
|
private static final Dimension BUTTON_SIZE = new Dimension(24, 20); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 富文本字体下拉框默认首选字体 非设计器UI界面字体 |
|
|
|
|
*/ |
|
|
|
|
private static final FRFont DEFAULT_FONT = FRContext.getDefaultValues().getFRFont().applySize(13); |
|
|
|
|
|
|
|
|
|
private UIComboBox fontNameComboBox; |
|
|
|
|
private UIComboBox fontSizeComboBox; |
|
|
|
|
private UIToggleButton bold; |
|
|
|
@ -153,11 +159,11 @@ public class RichTextToolBar extends BasicPane{
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void bindListener(){ |
|
|
|
|
FRFont defaultFont = (this.textPane != null) ? FRFont.getInstance(this.textPane.getFont()) : RichTextPane.DEFAUL_FONT; |
|
|
|
|
// 这里下拉框默认选中字体 不由UI界面字体决定 两套不同体系
|
|
|
|
|
fontNameComboBox.addItemListener(fontNameItemListener); |
|
|
|
|
fontNameComboBox.setSelectedItem(defaultFont.getFamily()); |
|
|
|
|
fontNameComboBox.setSelectedItem(DEFAULT_FONT.getFamily()); |
|
|
|
|
fontSizeComboBox.addItemListener(fontSizeItemListener); |
|
|
|
|
fontSizeComboBox.setSelectedItem(scaleDown(defaultFont.getSize())); |
|
|
|
|
fontSizeComboBox.setSelectedItem(scaleDown(DEFAULT_FONT.getSize())); |
|
|
|
|
|
|
|
|
|
bold.addActionListener(blodChangeAction); |
|
|
|
|
italic.addActionListener(itaChangeAction); |
|
|
|
|