You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.2 KiB
63 lines
2.2 KiB
package com.fr.design.widgettheme; |
|
|
|
import com.fr.design.widgettheme.common.EditorSettingPane; |
|
import com.fr.form.ui.Widget; |
|
import com.fr.widgettheme.theme.widget.style.ThemeTextStyle; |
|
import com.fr.widgettheme.theme.widget.theme.ParaEditorTheme; |
|
import com.fr.widgettheme.theme.widget.theme.cell.EditorTheme; |
|
|
|
import java.util.Arrays; |
|
import java.util.List; |
|
|
|
/** |
|
* 设计器控件属性的“高级”设置增加主题样式设置项,包括: |
|
* 文本控件/数字控件/密码控件/文本域控件/下拉框控件/下拉复选框控件/下拉树控件/日期控件 |
|
* |
|
* @author Bruce.Deng |
|
* @since 11.0 |
|
* Created on 2023/2/2 |
|
*/ |
|
public class ParaEditorSettingPane<T extends Widget> extends EditorSettingPane<T> { |
|
|
|
public ParaEditorSettingPane() { |
|
super(Arrays.asList( |
|
StyleSetting.THEME_COLOR, |
|
StyleSetting.WIDGET_BACKGROUND, |
|
StyleSetting.LINE_TYPE, |
|
StyleSetting.LINE_COLOR, |
|
StyleSetting.BORDER_RADIUS, |
|
StyleSetting.TEXT_STYLE |
|
)); |
|
} |
|
|
|
public ParaEditorSettingPane(List<StyleSetting> styleSettingList) { |
|
super(styleSettingList); |
|
} |
|
|
|
@Override |
|
protected void assignFontSizePane(EditorTheme widgetTheme) { |
|
ThemeTextStyle textStyle = ((ParaEditorTheme) widgetTheme).getTextStyle(); |
|
fontSizePane.setValue(textStyle.getFontSize()); |
|
fontColorButton.setColor(textStyle.getFontColor()); |
|
bold.setSelected(textStyle.isBold()); |
|
italic.setSelected(textStyle.isItalic()); |
|
fontNameSelectBox.setSelectedItem(textStyle.getName()); |
|
} |
|
|
|
@Override |
|
protected void assignFontSizeStyle(EditorTheme widgetTheme) { |
|
ParaEditorTheme paraEditorTheme= (ParaEditorTheme) widgetTheme; |
|
ThemeTextStyle textStyle = new ThemeTextStyle(); |
|
textStyle.setFontSize(fontSizePane.getValue()); |
|
textStyle.setFontColor(fontColorButton.getColor()); |
|
textStyle.setBold(bold.isSelected()); |
|
textStyle.setItalic(italic.isSelected()); |
|
textStyle.setName((String) fontNameSelectBox.getSelectedItem()); |
|
paraEditorTheme.setTextStyle(textStyle); |
|
} |
|
|
|
@Override |
|
protected EditorTheme getEditorTheme() { |
|
return new ParaEditorTheme(); |
|
} |
|
}
|
|
|