Browse Source
Merge in DESIGN/design from ~OBO/design1:feature/x to feature/x * commit '2409d627dc25bb223217b7adc6c0c72a5bda8afc': 抽常量、改命名,补充一个下拉框主题刷新类 1、抽常量 2、删注释 消除警告 REPORT-109672 控件显示增强-字体颜色优化feature/x
Obo-王学仁
1 year ago
22 changed files with 370 additions and 91 deletions
@ -0,0 +1,70 @@
|
||||
package com.fr.widgettheme.theme.panel; |
||||
|
||||
import com.fr.design.gui.ibutton.UIColorButton; |
||||
import com.fr.design.gui.frpane.FontSizeComboPane; |
||||
import com.fr.widgettheme.theme.widget.style.ThemeTextStyle; |
||||
|
||||
import javax.swing.BorderFactory; |
||||
import javax.swing.JPanel; |
||||
import java.awt.Color; |
||||
import java.awt.Dimension; |
||||
import java.awt.FlowLayout; |
||||
import java.util.Vector; |
||||
|
||||
/** |
||||
* 控件文本样式配置面板 |
||||
* 包含文本字体大小和字体颜色 |
||||
* |
||||
* @author oBo |
||||
* @since 11.0 |
||||
* Created on 2023/12/13 |
||||
*/ |
||||
public class WidgetTextStylePane extends JPanel { |
||||
|
||||
private final FontSizeComboPane fontSizePane; |
||||
|
||||
private final UIColorButton fontColorButton; |
||||
|
||||
public WidgetTextStylePane(int preferredWidth) { |
||||
this(null, preferredWidth); |
||||
} |
||||
|
||||
public WidgetTextStylePane(Vector<Integer> fontSizes, int preferredWidth) { |
||||
this.setLayout(new FlowLayout(FlowLayout.LEFT)); |
||||
this.setBorder(BorderFactory.createEmptyBorder()); |
||||
fontSizePane = new FontSizeComboPane(fontSizes); |
||||
fontColorButton = new UIColorButton(); |
||||
fontSizePane.setPreferredSize(new Dimension(preferredWidth, fontSizePane.getPreferredSize().height)); |
||||
this.add(fontSizePane); |
||||
this.add(fontColorButton); |
||||
} |
||||
|
||||
public void setTextStyle(ThemeTextStyle themeTextStyle) { |
||||
this.fontSizePane.setValue(themeTextStyle.getFontSize()); |
||||
this.fontColorButton.setColor(themeTextStyle.getFontColor()); |
||||
} |
||||
|
||||
public ThemeTextStyle getTextStyle() { |
||||
ThemeTextStyle themeTextStyle = new ThemeTextStyle(); |
||||
themeTextStyle.setFontSize(this.fontSizePane.getValue()); |
||||
themeTextStyle.setFontColor(this.fontColorButton.getColor()); |
||||
return themeTextStyle; |
||||
} |
||||
|
||||
public void setFontSizeValue(int fontSize) { |
||||
this.fontSizePane.setValue(fontSize); |
||||
} |
||||
|
||||
public void setFontColorValue(Color fontColor) { |
||||
this.fontColorButton.setColor(fontColor); |
||||
} |
||||
|
||||
public int getFontSizeValue() { |
||||
return this.fontSizePane.getValue(); |
||||
} |
||||
|
||||
public Color getFontColorValue() { |
||||
return this.fontColorButton.getColor(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,50 @@
|
||||
package com.fr.design.widgettheme; |
||||
|
||||
import com.fr.form.ui.Widget; |
||||
import com.fr.widgettheme.theme.widget.theme.ParaEditorTheme; |
||||
import com.fr.widgettheme.theme.widget.theme.ParaSelectEditorTheme; |
||||
import com.fr.widgettheme.theme.widget.theme.cell.EditorTheme; |
||||
|
||||
import java.util.Arrays; |
||||
|
||||
/** |
||||
* 参数面板下拉框编辑控件配置面板 |
||||
* 继承自编辑控件配置面板,添加一个下拉框背景色 |
||||
* |
||||
* @author obo |
||||
* @since 11.0 |
||||
* Created on 2023/12/13 |
||||
*/ |
||||
public class ParaSelectEditorSettingPane<T extends Widget> extends ParaEditorSettingPane<T> { |
||||
public ParaSelectEditorSettingPane() { |
||||
super(Arrays.asList( |
||||
StyleSetting.THEME_COLOR, |
||||
StyleSetting.SELECT_COLOR, |
||||
StyleSetting.STYLE_TYPE, |
||||
StyleSetting.LINE_TYPE, |
||||
StyleSetting.BORDER_RADIUS, |
||||
StyleSetting.TEXT_STYLE |
||||
)); |
||||
} |
||||
|
||||
@Override |
||||
protected void populateEditorBean(EditorTheme editorTheme) { |
||||
ParaSelectEditorTheme paraSelectEditorTheme= new ParaSelectEditorTheme(editorTheme); |
||||
if (!editorTheme.isFollowTheme()) { |
||||
selectBgColorBox.setSelectObject(paraSelectEditorTheme.getSelectBoxBgColor()); |
||||
} |
||||
super.populateEditorBean(editorTheme); |
||||
} |
||||
|
||||
@Override |
||||
protected void updateEditorStyleBean(EditorTheme editorTheme) { |
||||
ParaSelectEditorTheme paraSelectEditorTheme= new ParaSelectEditorTheme(editorTheme); |
||||
paraSelectEditorTheme.setSelectBoxBgColor(selectBgColorBox.getSelectObject()); |
||||
super.updateEditorStyleBean(editorTheme); |
||||
} |
||||
|
||||
@Override |
||||
protected EditorTheme getEditorTheme() { |
||||
return new ParaSelectEditorTheme(); |
||||
} |
||||
} |
@ -0,0 +1,56 @@
|
||||
package com.fr.design.widgettheme.common; |
||||
|
||||
import com.fr.design.widgettheme.StyleSetting; |
||||
import com.fr.form.ui.Widget; |
||||
import com.fr.widgettheme.theme.widget.theme.cell.EditorTheme; |
||||
import com.fr.widgettheme.theme.widget.theme.cell.SelectEditTheme; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 单元格下拉框编辑控件配置面板 |
||||
* 继承自编辑控件配置面板,添加一个下拉框背景色 |
||||
* |
||||
* @author obo |
||||
* @since 11.0 |
||||
* Created on 2023/12/13 |
||||
*/ |
||||
public class SelectEditorSettingPane <T extends Widget> extends EditorSettingPane<T> { |
||||
|
||||
public SelectEditorSettingPane() { |
||||
super(Arrays.asList( |
||||
StyleSetting.THEME_COLOR, |
||||
StyleSetting.SELECT_COLOR, |
||||
StyleSetting.STYLE_TYPE, |
||||
StyleSetting.LINE_TYPE, |
||||
StyleSetting.BORDER_RADIUS |
||||
)); |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "selectEditorSetting"; |
||||
} |
||||
|
||||
@Override |
||||
protected EditorTheme getEditorTheme() { |
||||
return new SelectEditTheme(); |
||||
} |
||||
|
||||
@Override |
||||
protected void populateEditorBean(EditorTheme editorTheme) { |
||||
SelectEditTheme selectEditTheme = new SelectEditTheme(editorTheme); |
||||
if (!selectEditTheme.isFollowTheme()) { |
||||
selectBgColorBox.setSelectObject(selectEditTheme.getSelectBoxBgColor()); |
||||
} |
||||
super.populateEditorBean(selectEditTheme); |
||||
} |
||||
|
||||
@Override |
||||
protected void updateEditorStyleBean(EditorTheme editorTheme) { |
||||
SelectEditTheme selectEditTheme = new SelectEditTheme(editorTheme); |
||||
selectEditTheme.setSelectBoxBgColor(selectBgColorBox.getSelectObject()); |
||||
super.updateEditorStyleBean(selectEditTheme); |
||||
} |
||||
} |
Loading…
Reference in new issue