Browse Source

工具类包装下 避免控件高度变化

bugfix/10.0
Hades 6 years ago
parent
commit
cadf2dbefe
  1. 2
      designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java
  2. 13
      designer-base/src/main/java/com/fr/design/widget/FRWidgetFactory.java

2
designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java

@ -43,7 +43,7 @@ public class VerticalChoosePane extends ChoosePane implements DesignerBean {
rs.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, -RIGHTBORDER)); rs.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, -RIGHTBORDER));
UILabel l1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database"), UILabel.LEFT); UILabel l1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database"), UILabel.LEFT);
UILabel l2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Model"), UILabel.LEFT); UILabel l2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Model"), UILabel.LEFT);
UILabel l3 = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Select_Table"), MAX_WIDTH); UILabel l3 = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Select_Table"), MAX_WIDTH, UILabel.LEFT);
if (labelSize > 0) { if (labelSize > 0) {
Dimension pSize = new Dimension(labelSize, 20); Dimension pSize = new Dimension(labelSize, 20);
l1.setPreferredSize(pSize); l1.setPreferredSize(pSize);

13
designer-base/src/main/java/com/fr/design/widget/FRWidgetFactory.java

@ -35,4 +35,17 @@ public class FRWidgetFactory {
UIComponentUtils.setLineWrap(label, lineWidth); UIComponentUtils.setLineWrap(label, lineWidth);
return label; return label;
} }
/**
* 创建一个可换行可调整水平对齐的 UILabel
* @param text
* @param lineWidth
* @param horizontalAlignment
* @return com.fr.design.gui.ilable.UILabel
*/
public static UILabel createLineWrapLabel(String text, int lineWidth, int horizontalAlignment) {
UILabel label = new UILabel(text, horizontalAlignment);
UIComponentUtils.setLineWrap(label, lineWidth);
return label;
}
} }

Loading…
Cancel
Save