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.
40 lines
1.2 KiB
40 lines
1.2 KiB
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; |
|
|
|
/** |
|
* 样式设置pane抽象类 |
|
* |
|
* @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); |
|
} |
|
}
|
|
|