Browse Source
Merge in DESIGN/design from ~OBO/design1:feature/x to feature/x * commit '8fe43ca30b053e3cf48b844095a439c343fd2163': 消除静态引入 优化代码,补充一些代码 REPORT-111619 控件增强-更多的样式配置--报表支撑feature/x
Obo-王学仁
9 months ago
29 changed files with 723 additions and 395 deletions
@ -1,40 +0,0 @@
|
||||
package com.fr.widgettheme.util; |
||||
|
||||
import com.fr.design.gui.frpane.FontSizeComboPane; |
||||
import com.fr.design.gui.ibutton.UIColorButton; |
||||
import com.fr.design.layout.TableLayout; |
||||
import com.fr.design.layout.TableLayoutHelper; |
||||
|
||||
import javax.swing.Box; |
||||
import javax.swing.JPanel; |
||||
import java.awt.Component; |
||||
|
||||
/** |
||||
* 创建主题文本样式的工具类 |
||||
* |
||||
* @author obo |
||||
* @since 11.0 |
||||
* Created on 2023/12/21 |
||||
*/ |
||||
public class ThemeTextStylePaneCreator { |
||||
private ThemeTextStylePaneCreator() {} |
||||
|
||||
/** |
||||
* 创建主题文本样式配置面板 |
||||
* 包含字体大小下拉框和字体颜色按钮 |
||||
* 可以自适应布局 |
||||
* |
||||
* @param fontSizePane 字体大小配置 |
||||
* @param fontColorButton 字体颜色配置 |
||||
* @return 文本样式面板 |
||||
*/ |
||||
public static JPanel create(FontSizeComboPane fontSizePane, UIColorButton fontColorButton) { |
||||
Component[][] components = {{fontSizePane, Box.createHorizontalStrut(5), fontColorButton}}; |
||||
double f = TableLayout.FILL; |
||||
double p = TableLayout.PREFERRED; |
||||
double[] rowSize = {f}; |
||||
double[] columnSize = {f, p, p}; |
||||
int[][] rowCount = {{1, 1, 1}}; |
||||
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 0, 0); |
||||
} |
||||
} |
@ -0,0 +1,147 @@
|
||||
package com.fr.widgettheme.util; |
||||
|
||||
import com.fr.design.designer.IntervalConstants; |
||||
import com.fr.design.gui.frpane.FontSizeComboPane; |
||||
import com.fr.design.gui.frpane.UIPercentDragPane; |
||||
import com.fr.design.gui.ibutton.UIColorButton; |
||||
import com.fr.design.gui.ibutton.UIToggleButton; |
||||
import com.fr.design.gui.icombobox.LineComboBox; |
||||
import com.fr.design.gui.icombobox.UIComboBox; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.layout.TableLayout; |
||||
import com.fr.design.layout.TableLayoutHelper; |
||||
import com.fr.design.mainframe.backgroundpane.BackgroundQuickPane; |
||||
import com.fr.design.style.color.NewColorSelectBox; |
||||
import com.fr.design.widget.FRWidgetFactory; |
||||
import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants; |
||||
import groovy.swing.factory.LayoutFactory; |
||||
|
||||
import javax.swing.BorderFactory; |
||||
import javax.swing.Box; |
||||
import javax.swing.JComponent; |
||||
import javax.swing.JPanel; |
||||
import java.awt.CardLayout; |
||||
import java.awt.Component; |
||||
import java.awt.Dimension; |
||||
import java.awt.FlowLayout; |
||||
import java.awt.LayoutManager; |
||||
import java.awt.event.ComponentAdapter; |
||||
import java.awt.event.ComponentEvent; |
||||
import java.awt.event.ComponentListener; |
||||
import java.awt.event.ItemEvent; |
||||
import java.awt.event.ItemListener; |
||||
|
||||
/** |
||||
* 创建控件样式组合配置面板的工具类 |
||||
* |
||||
* @author obo |
||||
* @since 11.0 |
||||
* Created on 2023/12/21 |
||||
*/ |
||||
public class WidgetStyleComponentCombiner { |
||||
|
||||
private static final double F = TableLayout.FILL; |
||||
private static final double P = TableLayout.PREFERRED; |
||||
|
||||
|
||||
private WidgetStyleComponentCombiner() { |
||||
} |
||||
|
||||
/** |
||||
* 组合主题文本样式配置面板 |
||||
* 包含字体大小下拉框和字体颜色按钮 |
||||
* |
||||
* @param fontSizePane 字体大小配置 |
||||
* @param fontColorButton 字体颜色配置 |
||||
* @param bold 粗体 |
||||
* @param italic 斜体 |
||||
* @return 文本样式面板 |
||||
*/ |
||||
public static JPanel combineTextStyleComponent(FontSizeComboPane fontSizePane, UIColorButton fontColorButton, UIToggleButton bold, UIToggleButton italic) { |
||||
Component[][] components = {{fontSizePane, fontColorButton, bold, italic}}; |
||||
double[] rowSize = {P}; |
||||
double[] columnSize = {F, P, P, P}; |
||||
int[][] rowCount = {{1, 1, 1, 1}}; |
||||
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 5, 5); |
||||
} |
||||
|
||||
/** |
||||
* 组合主题文本样式配置面板 |
||||
* 包含字体大小下拉框和字体颜色按钮 |
||||
* |
||||
* @param fontNameSelectBox 字体名配置 |
||||
* @param fontSizePane 字体大小配置 |
||||
* @param fontColorButton 字体颜色配置 |
||||
* @param bold 粗体 |
||||
* @param italic 斜体 |
||||
* @return 文本样式面板 |
||||
*/ |
||||
public static JPanel combineTextStyleComponent(UIComboBox fontNameSelectBox, FontSizeComboPane fontSizePane, UIColorButton fontColorButton, UIToggleButton bold, UIToggleButton italic) { |
||||
Component[][] components = { |
||||
{fontNameSelectBox, null, null, null}, |
||||
{fontSizePane, fontColorButton, bold, italic} |
||||
}; |
||||
double[] rowSize = {P, P}; |
||||
double[] columnSize = {F, P, P, P}; |
||||
int[][] rowCount = { |
||||
{1, 1, 1, 1}, |
||||
{1, 1, 1, 1} |
||||
}; |
||||
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 5, 5); |
||||
} |
||||
|
||||
/** |
||||
* 组合控件背景配置面板 |
||||
* |
||||
* @param colorSelectBox 颜色下拉框 |
||||
* @param alphaDragPane 透明度 |
||||
* @param columnWidth 列宽 |
||||
* @return 文本样式面板 |
||||
*/ |
||||
public static JPanel combineWidgetBackgroundComponent(NewColorSelectBox colorSelectBox, |
||||
UIPercentDragPane alphaDragPane, |
||||
double columnWidth) { |
||||
Component[][] components = { |
||||
{colorSelectBox}, |
||||
{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))}, |
||||
{alphaDragPane} |
||||
}; |
||||
double[] rowSize = {P, P, P}; |
||||
double[] columnSize = {columnWidth}; |
||||
int[][] rowCount = {{1}, {1}, {1}}; |
||||
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); |
||||
} |
||||
|
||||
/** |
||||
* 组合控件边框配置面板 |
||||
* |
||||
* @param lineComboBox 字体大小配置 |
||||
* @param lineComboColorSelectBox 字体颜色配置 |
||||
* @return 文本样式面板 |
||||
*/ |
||||
public static JPanel combineWidgetBorderComponent(LineComboBox lineComboBox, NewColorSelectBox lineComboColorSelectBox) { |
||||
return combineWidgetBorderComponent(lineComboBox, lineComboColorSelectBox, P); |
||||
} |
||||
|
||||
/** |
||||
* 组合控件边框配置面板 |
||||
* |
||||
* @param lineComboBox 字体大小配置 |
||||
* @param lineComboColorSelectBox 字体颜色配置 |
||||
* @param columnWidth 指定的列宽 |
||||
* @return 文本样式面板 |
||||
*/ |
||||
public static JPanel combineWidgetBorderComponent(LineComboBox lineComboBox, |
||||
NewColorSelectBox lineComboColorSelectBox, |
||||
double columnWidth) { |
||||
Component[][] components = { |
||||
{lineComboBox}, |
||||
{lineComboColorSelectBox} |
||||
}; |
||||
double[] rowSize = {P, P}; |
||||
double[] columnSize = {columnWidth}; |
||||
int[][] rowCount = {{1}, {1}}; |
||||
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); |
||||
} |
||||
} |
@ -0,0 +1,36 @@
|
||||
package com.fr.widgettheme.widget.mobile.pane; |
||||
|
||||
import com.fr.design.mainframe.mobile.ui.MobileStyleCustomDefinePane; |
||||
import com.fr.form.ui.Widget; |
||||
import com.fr.form.ui.mobile.MobileStyle; |
||||
import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants; |
||||
|
||||
/** |
||||
* 带有图标颜色的移动端控件通用配置面板 |
||||
* |
||||
* @author obo |
||||
* @since 11.0 |
||||
* Created on 2024/1/25 |
||||
*/ |
||||
public class IconColorMobileStyleDefinePane extends DisplayEnhanceMobileStyleDefinePane{ |
||||
|
||||
public IconColorMobileStyleDefinePane(Widget widget, Class<? extends MobileStyleCustomDefinePane> customBeanPaneClass, Class<? extends MobileStyle> mobileStyleClazz) { |
||||
super(widget, customBeanPaneClass, mobileStyleClazz); |
||||
} |
||||
|
||||
@Override |
||||
protected void createUniversalPane() { |
||||
// 主题色
|
||||
createThemePane(); |
||||
// 组件背景
|
||||
createBackgroundPane(); |
||||
// 边框线型
|
||||
createBorderLinePane(); |
||||
// 圆角边框
|
||||
createBorderRadiusPane(); |
||||
//图标颜色
|
||||
createIconColorSelectBox(); |
||||
// 字体
|
||||
createFontPane(WidgetThemeDisplayConstants.DEFAULT_FONT_COLOR_BLACK); |
||||
} |
||||
} |
@ -0,0 +1,33 @@
|
||||
package com.fr.widgettheme.widget.mobile.pane; |
||||
|
||||
import com.fr.design.mainframe.mobile.ui.MobileStyleCustomDefinePane; |
||||
import com.fr.form.ui.Widget; |
||||
import com.fr.form.ui.mobile.MobileStyle; |
||||
import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants; |
||||
|
||||
/** |
||||
* 文本域控件移动端配置面板 |
||||
* |
||||
* @author obo |
||||
* @since 11.0 |
||||
* Created on 2024/1/25 |
||||
*/ |
||||
public class TextAreaMobileStyleDefinePane extends DisplayEnhanceMobileStyleDefinePane{ |
||||
public TextAreaMobileStyleDefinePane(Widget widget, Class<? extends MobileStyleCustomDefinePane> customBeanPaneClass, Class<? extends MobileStyle> mobileStyleClazz) { |
||||
super(widget, customBeanPaneClass, mobileStyleClazz); |
||||
} |
||||
|
||||
@Override |
||||
protected void createUniversalPane() { |
||||
// 主题色
|
||||
createThemePane(); |
||||
// 组件背景
|
||||
createBackgroundPane(); |
||||
// 边框线型
|
||||
createBorderLinePane(); |
||||
// 圆角边框
|
||||
createBorderRadiusPane(); |
||||
// 字体
|
||||
createFontPane(WidgetThemeDisplayConstants.DEFAULT_FONT_COLOR_BLACK); |
||||
} |
||||
} |
Loading…
Reference in new issue