From cadf2dbefea4f8006520c79350b77f14737112ab Mon Sep 17 00:00:00 2001 From: Hades Date: Wed, 16 Jan 2019 11:30:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=85=B7=E7=B1=BB=E5=8C=85=E8=A3=85?= =?UTF-8?q?=E4=B8=8B=20=E9=81=BF=E5=85=8D=E6=8E=A7=E4=BB=B6=E9=AB=98?= =?UTF-8?q?=E5=BA=A6=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/VerticalChoosePane.java | 2 +- .../java/com/fr/design/widget/FRWidgetFactory.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java index 028f6b3b4e..374efb1121 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java +++ b/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)); 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 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) { Dimension pSize = new Dimension(labelSize, 20); l1.setPreferredSize(pSize); diff --git a/designer-base/src/main/java/com/fr/design/widget/FRWidgetFactory.java b/designer-base/src/main/java/com/fr/design/widget/FRWidgetFactory.java index 5770ed5e8a..6823b7b88f 100644 --- a/designer-base/src/main/java/com/fr/design/widget/FRWidgetFactory.java +++ b/designer-base/src/main/java/com/fr/design/widget/FRWidgetFactory.java @@ -35,4 +35,17 @@ public class FRWidgetFactory { UIComponentUtils.setLineWrap(label, lineWidth); 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; + } }