forked from fanruan/finekit
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.
51 lines
1.7 KiB
51 lines
1.7 KiB
6 years ago
|
package com.fanruan.api.design;
|
||
|
import com.fr.base.TableData;
|
||
|
import com.fr.design.data.datapane.preview.PreviewTablePane;
|
||
|
import com.fr.design.layout.TableLayoutHelper;
|
||
|
import com.fr.design.utils.gui.GUICoreUtils;
|
||
|
import com.fr.design.gui.itextfield.UIIntNumberField;
|
||
|
|
||
|
import javax.swing.*;
|
||
|
import java.awt.*;
|
||
|
import java.awt.event.ActionEvent;
|
||
|
|
||
|
public class DesignKit {
|
||
|
/**
|
||
|
* 直接预览数据集,没有实际值及显示值
|
||
|
* @param tableData 数据集
|
||
|
*/
|
||
|
public static void previewTableData(TableData tableData){
|
||
|
PreviewTablePane.previewTableData(tableData, -1, -1);
|
||
|
}
|
||
|
/**
|
||
|
* 标题布局
|
||
|
* @param components 组件
|
||
|
* @param rowSize 行宽
|
||
|
* @param columnSize 列宽
|
||
|
* @return 布局后的组件
|
||
|
*/
|
||
|
public static JPanel createTableLayoutPane(Component[][] components, double[] rowSize, double[] columnSize) {
|
||
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
|
||
|
}
|
||
|
/**
|
||
|
* 生成一个边界布局
|
||
|
* @param args 布局内部的元素,位置等
|
||
|
* @return 具有边界布局的面板
|
||
|
*/
|
||
|
public static JPanel createBorderLayoutPane(Object... args) {
|
||
|
return GUICoreUtils.createBorderLayoutPane(args);
|
||
|
}
|
||
|
/**
|
||
|
* 产生一个Flow Pane, flowAligment是FlowLayout.LEFT, CENTER, RIGHT.
|
||
|
* @param comps 组件
|
||
|
* @param flowAlignment 对齐方式
|
||
|
* @return 具有边界布局的面板
|
||
|
*/
|
||
|
public static JPanel createFlowPane(Component comps, int flowAlignment) {
|
||
|
return GUICoreUtils.createFlowPane(comps,flowAlignment);
|
||
|
}
|
||
|
public static class UIIntNumberField extends com.fr.design.gui.itextfield.UIIntNumberField{
|
||
|
|
||
|
}
|
||
|
}
|