|
|
@ -1,6 +1,5 @@ |
|
|
|
package com.fr.design.layout; |
|
|
|
package com.fr.design.layout; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.i18n.BidiUtils; |
|
|
|
|
|
|
|
import com.fr.design.border.UITitledBorder; |
|
|
|
import com.fr.design.border.UITitledBorder; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.stable.AssistUtils; |
|
|
|
import com.fr.stable.AssistUtils; |
|
|
@ -18,7 +17,6 @@ import java.awt.Component; |
|
|
|
import java.awt.Container; |
|
|
|
import java.awt.Container; |
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.FlowLayout; |
|
|
|
import java.awt.FlowLayout; |
|
|
|
import java.awt.GridLayout; |
|
|
|
|
|
|
|
import java.awt.LayoutManager; |
|
|
|
import java.awt.LayoutManager; |
|
|
|
|
|
|
|
|
|
|
|
public class FRGUIPaneFactory { |
|
|
|
public class FRGUIPaneFactory { |
|
|
@ -90,12 +88,12 @@ public class FRGUIPaneFactory { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 创建一个靠左的水平和垂直间隙均为5的流式布局 |
|
|
|
* 创建一个靠左的水平和垂直间隙均为5的流式布局,支持RTL |
|
|
|
* |
|
|
|
* |
|
|
|
* @return FlowLayout对象 |
|
|
|
* @return FlowLayout对象 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static LayoutManager createLabelFlowLayout() { // createLabelFlowLayout
|
|
|
|
public static LayoutManager createLabelFlowLayout() { |
|
|
|
return new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT); // 默认 5, 5
|
|
|
|
return new FlowLayout(FlowLayout.LEADING); // 默认 5, 5
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -104,7 +102,7 @@ public class FRGUIPaneFactory { |
|
|
|
* @return FlowLayout对象 |
|
|
|
* @return FlowLayout对象 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static LayoutManager createL_FlowLayout() { |
|
|
|
public static LayoutManager createL_FlowLayout() { |
|
|
|
return new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT, 10, 10); |
|
|
|
return new FlowLayout(FlowLayout.LEFT, 10, 10); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -220,7 +218,7 @@ public class FRGUIPaneFactory { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 创建一个带标题边框面板 |
|
|
|
* 创建一个带标题边框面板,支持rtl |
|
|
|
* |
|
|
|
* |
|
|
|
* @param string 边框标题 |
|
|
|
* @param string 边框标题 |
|
|
|
* @return JPanel对象 |
|
|
|
* @return JPanel对象 |
|
|
@ -229,12 +227,12 @@ public class FRGUIPaneFactory { |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string); |
|
|
|
UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string); |
|
|
|
jp.setBorder(explainBorder); |
|
|
|
jp.setBorder(explainBorder); |
|
|
|
jp.setLayout(new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT)); |
|
|
|
jp.setLayout(new FlowLayout(FlowLayout.LEADING)); |
|
|
|
return jp; |
|
|
|
return jp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 创建一个无间隔带标题边框面板 |
|
|
|
* 创建一个无间隔带标题边框面板,支持rtl |
|
|
|
* |
|
|
|
* |
|
|
|
* @param string 边框标题 |
|
|
|
* @param string 边框标题 |
|
|
|
* @return JPanel对象 |
|
|
|
* @return JPanel对象 |
|
|
@ -243,7 +241,7 @@ public class FRGUIPaneFactory { |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string); |
|
|
|
UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string); |
|
|
|
jp.setBorder(explainBorder); |
|
|
|
jp.setBorder(explainBorder); |
|
|
|
jp.setLayout(new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT, 0, 0)); |
|
|
|
jp.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0)); |
|
|
|
return jp; |
|
|
|
return jp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -354,48 +352,48 @@ public class FRGUIPaneFactory { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 创建一个正常靠左空边框面板 |
|
|
|
* 创建一个正常靠左空边框面板,支持RTL |
|
|
|
* |
|
|
|
* |
|
|
|
* @return JPanel对象 |
|
|
|
* @return JPanel对象 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static JPanel createNormalFlowInnerContainer_M_Pane() { |
|
|
|
public static JPanel createNormalFlowInnerContainer_M_Pane() { |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
jp.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
|
|
|
jp.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
|
|
|
jp.setLayout(new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT)); |
|
|
|
jp.setLayout(new FlowLayout(FlowLayout.LEADING)); |
|
|
|
return jp; |
|
|
|
return jp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 创建一个靠左0间距边框面板 |
|
|
|
* 创建一个靠左0间距边框面板,支持RTL |
|
|
|
* |
|
|
|
* |
|
|
|
* @return JPanel对象 |
|
|
|
* @return JPanel对象 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static JPanel createLeftFlowZeroGapBorderPane() { |
|
|
|
public static JPanel createLeftFlowZeroGapBorderPane() { |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
jp.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
jp.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
jp.setLayout(new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT, 0, 0)); |
|
|
|
jp.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0)); |
|
|
|
return jp; |
|
|
|
return jp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 创建一个流式布局,正常流式内嵌 |
|
|
|
* 创建一个流式布局,正常流式内嵌,支持RTL |
|
|
|
* |
|
|
|
* |
|
|
|
* @return JPanel对象 |
|
|
|
* @return JPanel对象 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static JPanel createNormalFlowInnerContainer_S_Pane() { |
|
|
|
public static JPanel createNormalFlowInnerContainer_S_Pane() { |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
jp.setLayout(new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT)); |
|
|
|
jp.setLayout(new FlowLayout(FlowLayout.LEADING)); |
|
|
|
return jp; |
|
|
|
return jp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 创建一个靠左流式布局,流式内嵌 |
|
|
|
* 创建一个靠左流式布局,流式内嵌,支持RTL |
|
|
|
* |
|
|
|
* |
|
|
|
* @return JPanel对象 |
|
|
|
* @return JPanel对象 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static JPanel createBoxFlowInnerContainer_S_Pane() { |
|
|
|
public static JPanel createBoxFlowInnerContainer_S_Pane() { |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
jp.setLayout(new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT, 2, 2)); |
|
|
|
jp.setLayout(new FlowLayout(FlowLayout.LEADING, 2, 2)); |
|
|
|
return jp; |
|
|
|
return jp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -426,7 +424,7 @@ public class FRGUIPaneFactory { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 创建一个靠左的水平流式布局 |
|
|
|
* 创建一个靠左的水平流式布局,支持RTL |
|
|
|
* @param hgap 水平间距 |
|
|
|
* @param hgap 水平间距 |
|
|
|
* @param vgap 竖直间距 |
|
|
|
* @param vgap 竖直间距 |
|
|
|
* @return JPanel对象 |
|
|
|
* @return JPanel对象 |
|
|
@ -434,7 +432,7 @@ public class FRGUIPaneFactory { |
|
|
|
public static JPanel createBoxFlowInnerContainer_S_Pane(int hgap, int vgap) { |
|
|
|
public static JPanel createBoxFlowInnerContainer_S_Pane(int hgap, int vgap) { |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
jp.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
jp.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
jp.setLayout(new FlowLayout(BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT, hgap, vgap)); |
|
|
|
jp.setLayout(new FlowLayout(FlowLayout.LEADING, hgap, vgap)); |
|
|
|
return jp; |
|
|
|
return jp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|