Browse Source
* commit 'db9ca2ee21f62fadab9aed9c861e848a9d8847b0': REPORT-2897 9.0设计器修改 修改命名 REPORT-2897 9.0设计器修改 视觉优化 rm button group border hzzzz REPORT-2897 9.0设计器修改 视觉优化 hzzzzzzzzzz REPORT-2897 9.0设计器修改 视觉优化master
superman
7 years ago
24 changed files with 1435 additions and 1351 deletions
@ -1,48 +1,62 @@
|
||||
package com.fr.design.widget.ui; |
||||
|
||||
import com.fr.design.constants.LayoutConstants; |
||||
import com.fr.design.foldablepane.UIExpandablePane; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
|
||||
import javax.swing.*; |
||||
|
||||
import com.fr.design.gui.itextfield.UITextField; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.layout.TableLayout; |
||||
import com.fr.design.layout.TableLayoutHelper; |
||||
import com.fr.form.ui.CheckBox; |
||||
import com.fr.general.Inter; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { |
||||
private UITextField text; |
||||
|
||||
public CheckBoxDefinePane() { |
||||
this.iniComoponents(); |
||||
} |
||||
|
||||
private void iniComoponents() { |
||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); |
||||
JPanel textPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
||||
textPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
||||
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, textPane); |
||||
textPane.add(new UILabel(Inter.getLocText("Text") + ":")); |
||||
text = new UITextField(8); |
||||
textPane.add(text); |
||||
this.add(uiExpandablePane); |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "CheckBox"; |
||||
} |
||||
|
||||
@Override |
||||
public void populateBean(CheckBox check) { |
||||
text.setText(check.getText()); |
||||
} |
||||
|
||||
@Override |
||||
public CheckBox updateBean() { |
||||
CheckBox box = new CheckBox(); |
||||
box.setText(text.getText()); |
||||
return box; |
||||
} |
||||
private UITextField text; |
||||
|
||||
public CheckBoxDefinePane() { |
||||
this.iniComoponents(); |
||||
} |
||||
|
||||
private void iniComoponents() { |
||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
text = new UITextField(8); |
||||
JPanel panel = new JPanel(new BorderLayout()); |
||||
panel.add(text, BorderLayout.CENTER); |
||||
panel.setBorder(BorderFactory.createEmptyBorder(0, 35, 0, 0)); |
||||
|
||||
double f = TableLayout.FILL; |
||||
double p = TableLayout.PREFERRED; |
||||
Component[][] components = new Component[][]{ |
||||
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Text")), panel}, |
||||
}; |
||||
double[] rowSize = {p}; |
||||
double[] columnSize = {p, f}; |
||||
int[][] rowCount = {{1, 1}}; |
||||
JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE); |
||||
|
||||
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 24, pane); |
||||
pane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15)); |
||||
|
||||
this.add(uiExpandablePane); |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "CheckBox"; |
||||
} |
||||
|
||||
@Override |
||||
public void populateBean(CheckBox check) { |
||||
text.setText(check.getText()); |
||||
} |
||||
|
||||
@Override |
||||
public CheckBox updateBean() { |
||||
CheckBox box = new CheckBox(); |
||||
box.setText(text.getText()); |
||||
return box; |
||||
} |
||||
} |
@ -1,92 +1,82 @@
|
||||
package com.fr.design.widget.ui; |
||||
|
||||
import java.awt.*; |
||||
|
||||
import com.fr.design.constants.LayoutConstants; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
|
||||
import javax.swing.*; |
||||
|
||||
import com.fr.design.gui.icheckbox.UICheckBox; |
||||
import com.fr.design.gui.icombobox.DictionaryComboBox; |
||||
import com.fr.design.gui.icombobox.DictionaryConstants; |
||||
import com.fr.design.gui.itextfield.UINumberField; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.gui.ispinner.UISpinner; |
||||
import com.fr.design.layout.TableLayout; |
||||
import com.fr.design.layout.TableLayoutHelper; |
||||
import com.fr.form.ui.MultiFileEditor; |
||||
import com.fr.general.Inter; |
||||
|
||||
public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor> { |
||||
private DictionaryComboBox acceptType; |
||||
private UICheckBox singleFileCheckBox; |
||||
private UINumberField fileSizeField; |
||||
|
||||
public MultiFileEditorPane() { |
||||
this.initComponents(); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "file"; |
||||
} |
||||
|
||||
@Override |
||||
protected JPanel setFirstContentPane() { |
||||
acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays); |
||||
acceptType.setPreferredSize(new Dimension(200, 18)); |
||||
singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD")); |
||||
fileSizeField = new UINumberField(); |
||||
fileSizeField.setPreferredSize(new Dimension(80, 18)); |
||||
|
||||
|
||||
JPanel singleFilePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); |
||||
singleFilePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
||||
singleFilePane.add(singleFileCheckBox); |
||||
|
||||
JPanel allowTypePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); |
||||
allowTypePane.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); |
||||
allowTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
||||
allowTypePane.add(new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":")); |
||||
allowTypePane.add(acceptType); |
||||
|
||||
JPanel fileSizePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); |
||||
fileSizePane.add(new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":")); |
||||
fileSizePane.add(fileSizeField); |
||||
fileSizePane.add(new UILabel(" KB")); |
||||
|
||||
double f = TableLayout.FILL; |
||||
double p = TableLayout.PREFERRED; |
||||
Component[][] components = new Component[][]{ |
||||
new Component[]{singleFileCheckBox, null }, |
||||
new Component[]{new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":"), acceptType}, |
||||
new Component[]{new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":"), fileSizeField}, |
||||
}; |
||||
double[] rowSize = {p, p,p}; |
||||
double[] columnSize = {p,f}; |
||||
int[][] rowCount = {{1, 1},{1, 1},{1, 1}}; |
||||
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5); |
||||
|
||||
|
||||
return panel; |
||||
} |
||||
|
||||
@Override |
||||
protected void populateSubFieldEditorBean(MultiFileEditor e) { |
||||
// 这里存在兼容问题 getAccept可能没在待选项目中
|
||||
acceptType.setSelectedItem(e.getAccept()); |
||||
singleFileCheckBox.setSelected(e.isSingleFile()); |
||||
fileSizeField.setValue(e.getMaxSize()); |
||||
} |
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
@Override |
||||
protected MultiFileEditor updateSubFieldEditorBean() { |
||||
MultiFileEditor ob = new MultiFileEditor(); |
||||
ob.setAccept((String) acceptType.getSelectedItem()); |
||||
ob.setSingleFile(singleFileCheckBox.isSelected()); |
||||
ob.setMaxSize(fileSizeField.getValue()); |
||||
return ob; |
||||
} |
||||
public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor> { |
||||
private DictionaryComboBox acceptType; |
||||
private UICheckBox singleFileCheckBox; |
||||
private UISpinner fileSizeField; |
||||
|
||||
public MultiFileEditorPane() { |
||||
this.initComponents(); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "file"; |
||||
} |
||||
|
||||
@Override |
||||
protected JPanel setFirstContentPane() { |
||||
JPanel contenter = new JPanel(new BorderLayout()); |
||||
|
||||
singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD")); |
||||
acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays); |
||||
// acceptType.setPreferredSize(new Dimension(100, 20));
|
||||
fileSizeField = new UISpinner(0, Integer.MAX_VALUE, 1, -1); |
||||
fileSizeField.setPreferredSize(new Dimension(140, 20)); |
||||
|
||||
JPanel fileSizePane = new JPanel(new BorderLayout()); |
||||
UILabel fileTypeLabel = new UILabel(Inter.getLocText("Utils-File_type")); |
||||
UILabel fileSizeLabel = new UILabel(Inter.getLocText("FR-Designer_Size_Limit")); |
||||
fileSizePane.add(fileSizeField, BorderLayout.CENTER); |
||||
fileSizePane.add(new UILabel(" KB"), BorderLayout.EAST); |
||||
|
||||
double f = TableLayout.FILL; |
||||
double p = TableLayout.PREFERRED; |
||||
Component[][] components = new Component[][]{ |
||||
new Component[]{singleFileCheckBox, null}, |
||||
new Component[]{fileTypeLabel, acceptType}, |
||||
new Component[]{fileSizeLabel, fileSizePane}, |
||||
}; |
||||
double[] rowSize = {p, p, p}; |
||||
double[] columnSize = {p, f}; |
||||
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; |
||||
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 22, 10); |
||||
|
||||
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 00)); |
||||
contenter.add(panel, BorderLayout.CENTER); |
||||
|
||||
return contenter; |
||||
} |
||||
|
||||
@Override |
||||
protected void populateSubFieldEditorBean(MultiFileEditor e) { |
||||
// 这里存在兼容问题 getAccept可能没在待选项目中
|
||||
acceptType.setSelectedItem(e.getAccept()); |
||||
singleFileCheckBox.setSelected(e.isSingleFile()); |
||||
fileSizeField.setValue(e.getMaxSize()); |
||||
} |
||||
|
||||
@Override |
||||
protected MultiFileEditor updateSubFieldEditorBean() { |
||||
MultiFileEditor ob = new MultiFileEditor(); |
||||
ob.setAccept((String) acceptType.getSelectedItem()); |
||||
ob.setSingleFile(singleFileCheckBox.isSelected()); |
||||
ob.setMaxSize(fileSizeField.getValue()); |
||||
return ob; |
||||
} |
||||
|
||||
} |
@ -1,456 +1,510 @@
|
||||
package com.fr.design.layout; |
||||
|
||||
import java.awt.BorderLayout; |
||||
import java.awt.CardLayout; |
||||
import java.awt.Color; |
||||
import java.awt.FlowLayout; |
||||
import java.awt.LayoutManager; |
||||
|
||||
import javax.swing.BorderFactory; |
||||
import javax.swing.BoxLayout; |
||||
import javax.swing.Icon; |
||||
import com.fr.design.border.UITitledBorder; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import javax.swing.JPanel; |
||||
import javax.swing.JRadioButton; |
||||
|
||||
import com.fr.design.border.UITitledBorder; |
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
public class FRGUIPaneFactory { |
||||
private FRGUIPaneFactory() { |
||||
} |
||||
private FRGUIPaneFactory() { |
||||
} |
||||
|
||||
public static final float WIDTH_PARA_F = 80.0f; |
||||
public static final int WIDTH_OFFSET_N = 60; |
||||
public static final int WIDTH_OFFSET_M = 20; |
||||
public static final int WIDTH_PARA_INT = 80; |
||||
public static final float WIDTHABS_PARA_F = 2.0f; |
||||
public static final int HEIGHT_PARA = 25; |
||||
public static final int HEIGHT_OFFSET = 50; |
||||
public static final float WIDTH_PARA_F = 80.0f; |
||||
public static final int WIDTH_OFFSET_N = 60; |
||||
public static final int WIDTH_OFFSET_M = 20; |
||||
public static final int WIDTH_PARA_INT = 80; |
||||
public static final float WIDTHABS_PARA_F = 2.0f; |
||||
public static final int HEIGHT_PARA = 25; |
||||
public static final int HEIGHT_OFFSET = 50; |
||||
|
||||
/** |
||||
* 创建一个靠右靠左的水平间隙为2的流式布局 |
||||
* |
||||
* @return FlowLayout对象 |
||||
*/ |
||||
public static LayoutManager createBoxFlowLayout() { // createBoxFlowLayout 图表用到的比较多
|
||||
return new FlowLayout(FlowLayout.LEFT, 2, 0); |
||||
} |
||||
public static LayoutManager createBoxFlowLayout() { // createBoxFlowLayout 图表用到的比较多
|
||||
return new FlowLayout(FlowLayout.LEFT, 2, 0); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左的布局 |
||||
* @return FlowLayout对象 |
||||
*/ |
||||
public static LayoutManager createLeftZeroLayout() { |
||||
return new FlowLayout(FlowLayout.LEFT, 0, 0); |
||||
} |
||||
/** |
||||
* 创建一个靠左的布局 |
||||
* |
||||
* @return FlowLayout对象 |
||||
*/ |
||||
public static LayoutManager createLeftZeroLayout() { |
||||
return new FlowLayout(FlowLayout.LEFT, 0, 0); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左的水平和垂直间隙均为5的流式布局 |
||||
* |
||||
* @return FlowLayout对象 |
||||
*/ |
||||
public static LayoutManager createLabelFlowLayout() { // createLabelFlowLayout
|
||||
return new FlowLayout(FlowLayout.LEFT); // 默认 5, 5
|
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左流式布局,间距10,10 |
||||
* |
||||
* @return FlowLayout对象 |
||||
*/ |
||||
public static LayoutManager createL_FlowLayout() { |
||||
return new FlowLayout(FlowLayout.LEFT, 10, 10); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个居中流式布局 |
||||
* |
||||
* @return FlowLayout对象 |
||||
*/ |
||||
public static LayoutManager createCenterFlowLayout() { |
||||
return new FlowLayout(FlowLayout.CENTER); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠右流式布局 |
||||
* |
||||
* @return FlowLayout对象 |
||||
*/ |
||||
public static LayoutManager createLabelFlowLayout() { // createLabelFlowLayout
|
||||
return new FlowLayout(FlowLayout.LEFT); // 默认 5, 5
|
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左流式布局,间距10,10 |
||||
* @return FlowLayout对象 |
||||
*/ |
||||
public static LayoutManager createL_FlowLayout() { |
||||
return new FlowLayout(FlowLayout.LEFT, 10, 10); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个居中流式布局 |
||||
* @return FlowLayout对象 |
||||
*/ |
||||
public static LayoutManager createCenterFlowLayout() { |
||||
return new FlowLayout(FlowLayout.CENTER); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠右流式布局 |
||||
* @return FlowLayout对象 |
||||
*/ |
||||
public static LayoutManager createRightFlowLayout() { |
||||
return new FlowLayout(FlowLayout.RIGHT); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个边框布局 |
||||
* @return BorderLayout对象 |
||||
*/ |
||||
public static LayoutManager createBorderLayout() { |
||||
return new BorderLayout(); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个边框布局,间距4,4 |
||||
* @return BorderLayout对象 |
||||
*/ |
||||
public static LayoutManager createM_BorderLayout() { |
||||
return new BorderLayout(4,4); |
||||
} |
||||
|
||||
// TODO 删掉
|
||||
|
||||
/** |
||||
* 创建一个1列的网格布局 |
||||
* @return FRGridLayout对象 |
||||
*/ |
||||
public static LayoutManager create1ColumnGridLayout() { |
||||
return new FRGridLayout(1); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个2列的网格布局 |
||||
* @return FRGridLayout对象 |
||||
*/ |
||||
public static LayoutManager create2ColumnGridLayout() { |
||||
return new FRGridLayout(2); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个n列的网格布局 |
||||
* @param nColumn 列数 |
||||
* @return FRGridLayout对象 |
||||
*/ |
||||
public static LayoutManager createNColumnGridLayout(int nColumn) { |
||||
return new FRGridLayout(nColumn); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个带标题边框面板 |
||||
* @param string 边框标题 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createTitledBorderPane(String string) { |
||||
JPanel jp = new JPanel(); |
||||
UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string); |
||||
jp.setBorder(explainBorder); |
||||
jp.setLayout(new FlowLayout(FlowLayout.LEFT)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个带标题边框面板并且居中显示 |
||||
* @param borderTitle 边框标题 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createTitledBorderPaneCenter(String borderTitle) { |
||||
JPanel jp = new JPanel(); |
||||
UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(borderTitle); |
||||
jp.setBorder(explainBorder); |
||||
jp.setLayout(new FlowLayout(FlowLayout.CENTER)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左空边框布局,间隔大 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createBigHGapFlowInnerContainer_M_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
||||
jp.setLayout(new FRLeftFlowLayout(5, 60, 5)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左空边框面板,间隔中等 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createMediumHGapFlowInnerContainer_M_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
||||
jp.setLayout(new FRLeftFlowLayout(5, 20, 5)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左空边框面板,间隔中等 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createMediumHGapHighTopFlowInnerContainer_M_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(50, 5, 0, 0)); |
||||
jp.setLayout(new FRLeftFlowLayout(5, 20, 5)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个正常靠左空边框面板 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createNormalFlowInnerContainer_M_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
||||
jp.setLayout(new FlowLayout(FlowLayout.LEFT)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左0间距边框面板 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createLeftFlowZeroGapBorderPane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
||||
jp.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左流式布局,正常流式内嵌 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createNormalFlowInnerContainer_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FlowLayout(FlowLayout.LEFT)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左流式布局,流式内嵌 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createBoxFlowInnerContainer_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 2)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠右面板 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createRightFlowInnerContainer_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FlowLayout(FlowLayout.RIGHT)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个居中面板 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createCenterFlowInnerContainer_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FlowLayout(FlowLayout.CENTER)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个居中0间距面板 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createCenterFlowZeroGapBorderPane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0)); |
||||
jp.setBorder(BorderFactory.createEmptyBorder()); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建纵向排列面板 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createY_AXISBoxInnerContainer_L_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建纵向边框面板 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createYBoxEmptyBorderPane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建横向面板 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createX_AXISBoxInnerContainer_L_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.X_AXIS)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建纵向面板M |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createY_AXISBoxInnerContainer_M_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建横向内置boxlayout的面板 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createX_AXISBoxInnerContainer_M_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.X_AXIS)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建纵向内置boxlayout的面板 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createY_AXISBoxInnerContainer_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建横向内置boxlayout的面板 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createX_AXISBoxInnerContainer_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.X_AXIS)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建n列网格面板 |
||||
* @param nColumn 列数 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createNColumnGridInnerContainer_S_Pane(int nColumn) { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FRGridLayout(nColumn)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建n列网格面板 |
||||
* @param nColumn 列数 |
||||
* @param h 水平间距 |
||||
* @param v 垂直间距 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createNColumnGridInnerContainer_Pane(int nColumn, int h, int v) { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FRGridLayout(nColumn, h, v)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建顶格n列网格面板 |
||||
* @param nColumn 列数 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createFillColumnPane(int nColumn) { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FRGridLayout(nColumn, 0, 0)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建边框面板L |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createBorderLayout_L_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
||||
jp.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建边框面板M |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createBorderLayout_M_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
||||
jp.setLayout(FRGUIPaneFactory.createM_BorderLayout()); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建边框面板S |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createBorderLayout_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建卡片式布局 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createCardLayout_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new CardLayout()); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建图标IconRadio面板 |
||||
* @param icon 图标 |
||||
* @param jradiobtn 按钮 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createIconRadio_S_Pane(Icon icon, |
||||
JRadioButton jradiobtn) { |
||||
jradiobtn.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); |
||||
jradiobtn.setBackground(new Color(255, 255, 255)); |
||||
JPanel iconRadioPane = new JPanel(); |
||||
iconRadioPane.setLayout(new BoxLayout(iconRadioPane, BoxLayout.X_AXIS)); |
||||
|
||||
iconRadioPane.add(new UILabel(icon)); |
||||
iconRadioPane.add(jradiobtn); |
||||
|
||||
return iconRadioPane; |
||||
} |
||||
|
||||
/** |
||||
* 计算宽度 |
||||
* @param width 宽度输入值 |
||||
* @return w 宽度输出值 |
||||
*/ |
||||
public static int caculateWidth(int width) { |
||||
int w = 0; |
||||
float m = (width + WIDTH_OFFSET_M) / WIDTH_PARA_F; |
||||
float n = (width + WIDTH_OFFSET_N) / WIDTH_PARA_F; |
||||
float i = Math.abs((((int) m + (int) (m + 1)) / WIDTHABS_PARA_F) - m); |
||||
float j = Math.abs((((int) n + (int) (n + 1)) / WIDTHABS_PARA_F) - n); |
||||
float x = i > j ? i : j; |
||||
if (x == i) { |
||||
w = Math.round(m) * WIDTH_PARA_INT - WIDTH_OFFSET_M; |
||||
} else if (x == j) { |
||||
w = Math.round(n) * WIDTH_PARA_INT - WIDTH_OFFSET_N; |
||||
} |
||||
return w; |
||||
} |
||||
|
||||
/** |
||||
* 计算高度 |
||||
* @param height 高度输入值 |
||||
* @return 高度输出值 |
||||
*/ |
||||
public static int caculateHeight(int height) { |
||||
int h = 0; |
||||
float x = (height + HEIGHT_OFFSET) / HEIGHT_PARA; |
||||
h = ((int) x + 1) * HEIGHT_PARA; |
||||
return h; |
||||
} |
||||
public static LayoutManager createRightFlowLayout() { |
||||
return new FlowLayout(FlowLayout.RIGHT); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个边框布局 |
||||
* |
||||
* @return BorderLayout对象 |
||||
*/ |
||||
public static LayoutManager createBorderLayout() { |
||||
return new BorderLayout(); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个边框布局,间距4,4 |
||||
* |
||||
* @return BorderLayout对象 |
||||
*/ |
||||
public static LayoutManager createM_BorderLayout() { |
||||
return new BorderLayout(4, 4); |
||||
} |
||||
|
||||
// TODO 删掉
|
||||
|
||||
/** |
||||
* 创建一个1列的网格布局 |
||||
* |
||||
* @return FRGridLayout对象 |
||||
*/ |
||||
public static LayoutManager create1ColumnGridLayout() { |
||||
return new FRGridLayout(1); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个2列的网格布局 |
||||
* |
||||
* @return FRGridLayout对象 |
||||
*/ |
||||
public static LayoutManager create2ColumnGridLayout() { |
||||
return new FRGridLayout(2); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个n列的网格布局 |
||||
* |
||||
* @param nColumn 列数 |
||||
* @return FRGridLayout对象 |
||||
*/ |
||||
public static LayoutManager createNColumnGridLayout(int nColumn) { |
||||
return new FRGridLayout(nColumn); |
||||
} |
||||
|
||||
/** |
||||
* 创建一个带标题边框面板 |
||||
* |
||||
* @param string 边框标题 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createTitledBorderPane(String string) { |
||||
JPanel jp = new JPanel(); |
||||
UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string); |
||||
jp.setBorder(explainBorder); |
||||
jp.setLayout(new FlowLayout(FlowLayout.LEFT)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个带标题边框面板并且居中显示 |
||||
* |
||||
* @param borderTitle 边框标题 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createTitledBorderPaneCenter(String borderTitle) { |
||||
JPanel jp = new JPanel(); |
||||
UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(borderTitle); |
||||
jp.setBorder(explainBorder); |
||||
jp.setLayout(new FlowLayout(FlowLayout.CENTER)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左空边框布局,间隔大 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createBigHGapFlowInnerContainer_M_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
||||
jp.setLayout(new FRLeftFlowLayout(5, 60, 5)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左空边框面板,间隔中等 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createMediumHGapFlowInnerContainer_M_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
||||
jp.setLayout(new FRLeftFlowLayout(5, 20, 5)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左空边框面板,间隔中等,firsthgap 为0 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createMediumHGapFlowInnerContainer_M_Pane_First0() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
||||
jp.setLayout(new FRLeftFlowLayout(0, 20, 5)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左空边框面板,间隔中等 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createMediumHGapHighTopFlowInnerContainer_M_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(50, 5, 0, 0)); |
||||
jp.setLayout(new FRLeftFlowLayout(5, 20, 5)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个正常靠左空边框面板 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createNormalFlowInnerContainer_M_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
||||
jp.setLayout(new FlowLayout(FlowLayout.LEFT)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左0间距边框面板 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createLeftFlowZeroGapBorderPane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
||||
jp.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左流式布局,正常流式内嵌 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createNormalFlowInnerContainer_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FlowLayout(FlowLayout.LEFT)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左流式布局,流式内嵌 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createBoxFlowInnerContainer_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 2)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠左流式布局,流式内嵌,首元素距离左边0 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createBoxFlowInnerContainer_S_Pane_First0() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FRLeftFlowLayout(0, 0, 5)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个靠右面板 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createRightFlowInnerContainer_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FlowLayout(FlowLayout.RIGHT)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个居中面板 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createCenterFlowInnerContainer_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FlowLayout(FlowLayout.CENTER)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建一个居中0间距面板 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createCenterFlowZeroGapBorderPane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0)); |
||||
jp.setBorder(BorderFactory.createEmptyBorder()); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建纵向排列面板 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createY_AXISBoxInnerContainer_L_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建纵向边框面板 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createYBoxEmptyBorderPane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建横向面板 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createX_AXISBoxInnerContainer_L_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.X_AXIS)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建纵向面板M |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createY_AXISBoxInnerContainer_M_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建横向内置boxlayout的面板 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createX_AXISBoxInnerContainer_M_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.X_AXIS)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建纵向内置boxlayout的面板 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createY_AXISBoxInnerContainer_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建横向内置boxlayout的面板 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createX_AXISBoxInnerContainer_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new BoxLayout(jp, BoxLayout.X_AXIS)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建n列网格面板 |
||||
* |
||||
* @param nColumn 列数 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createNColumnGridInnerContainer_S_Pane(int nColumn) { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FRGridLayout(nColumn)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建n列网格面板 |
||||
* |
||||
* @param nColumn 列数 |
||||
* @param h 水平间距 |
||||
* @param v 垂直间距 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createNColumnGridInnerContainer_Pane(int nColumn, int h, int v) { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FRGridLayout(nColumn, h, v)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建顶格n列网格面板 |
||||
* |
||||
* @param nColumn 列数 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createFillColumnPane(int nColumn) { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new FRGridLayout(nColumn, 0, 0)); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建边框面板L |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createBorderLayout_L_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
||||
jp.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建边框面板M |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createBorderLayout_M_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
||||
jp.setLayout(FRGUIPaneFactory.createM_BorderLayout()); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建边框面板S |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createBorderLayout_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建卡片式布局 |
||||
* |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createCardLayout_S_Pane() { |
||||
JPanel jp = new JPanel(); |
||||
jp.setLayout(new CardLayout()); |
||||
return jp; |
||||
} |
||||
|
||||
/** |
||||
* 创建图标IconRadio面板 |
||||
* |
||||
* @param icon 图标 |
||||
* @param jradiobtn 按钮 |
||||
* @return JPanel对象 |
||||
*/ |
||||
public static JPanel createIconRadio_S_Pane(Icon icon, |
||||
JRadioButton jradiobtn) { |
||||
jradiobtn.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); |
||||
jradiobtn.setBackground(new Color(255, 255, 255)); |
||||
JPanel iconRadioPane = new JPanel(); |
||||
iconRadioPane.setLayout(new BoxLayout(iconRadioPane, BoxLayout.X_AXIS)); |
||||
|
||||
iconRadioPane.add(new UILabel(icon)); |
||||
iconRadioPane.add(jradiobtn); |
||||
|
||||
return iconRadioPane; |
||||
} |
||||
|
||||
/** |
||||
* 计算宽度 |
||||
* |
||||
* @param width 宽度输入值 |
||||
* @return w 宽度输出值 |
||||
*/ |
||||
public static int caculateWidth(int width) { |
||||
int w = 0; |
||||
float m = (width + WIDTH_OFFSET_M) / WIDTH_PARA_F; |
||||
float n = (width + WIDTH_OFFSET_N) / WIDTH_PARA_F; |
||||
float i = Math.abs((((int) m + (int) (m + 1)) / WIDTHABS_PARA_F) - m); |
||||
float j = Math.abs((((int) n + (int) (n + 1)) / WIDTHABS_PARA_F) - n); |
||||
float x = i > j ? i : j; |
||||
if (x == i) { |
||||
w = Math.round(m) * WIDTH_PARA_INT - WIDTH_OFFSET_M; |
||||
} else if (x == j) { |
||||
w = Math.round(n) * WIDTH_PARA_INT - WIDTH_OFFSET_N; |
||||
} |
||||
return w; |
||||
} |
||||
|
||||
/** |
||||
* 计算高度 |
||||
* |
||||
* @param height 高度输入值 |
||||
* @return 高度输出值 |
||||
*/ |
||||
public static int caculateHeight(int height) { |
||||
int h = 0; |
||||
float x = (height + HEIGHT_OFFSET) / HEIGHT_PARA; |
||||
h = ((int) x + 1) * HEIGHT_PARA; |
||||
return h; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue