From 5160ced244fb84d2d512522a23914e6146d05e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 29 Sep 2021 17:53:59 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-60134=20=E8=A1=A8=E5=8D=95=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=B1=9E=E6=80=A7=E5=9B=BD=E9=99=85=E5=8C=96-?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractTranslucentBackgroundSpecialPane.java | 8 ++++---- .../design/gui/style/ComponentIntegralStylePane.java | 6 +++--- .../fr/design/gui/style/ComponentTitleStylePane.java | 10 +++++----- .../com/fr/design/gui/style/FollowingThemePane.java | 9 +++------ .../java/com/fr/design/layout/FRGUIPaneFactory.java | 7 +++++++ 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java b/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java index fe6318ad3f..0b814f284a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java @@ -2,13 +2,13 @@ package com.fr.design.gui.style; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; -import com.fr.design.dialog.BasicScrollPane; import com.fr.design.gui.frpane.UIPercentDragPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.backgroundpane.GradientBackgroundQuickPane; +import com.fr.design.widget.FRWidgetFactory; import com.fr.general.Background; import com.fr.general.act.BackgroundPacker; @@ -51,8 +51,8 @@ public abstract class AbstractTranslucentBackgroundSpecialPane 0 ? this.uiSettingWidth : f}; JPanel content = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{ - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Render_Style")), borderStyleCombo}, + {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Render_Style")), FRGUIPaneFactory.createBorderLayoutNorthPaneWithComponent(borderStyleCombo)}, {this.borderPane, null}, - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")), cornerSpinner}, + {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")), cornerSpinner}, }, rowSize, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); diff --git a/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java b/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java index 8f9a8503da..33af029ad6 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java @@ -9,10 +9,10 @@ import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.widget.FRWidgetFactory; import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.WidgetTitle; import com.fr.general.FRFont; @@ -168,7 +168,7 @@ public class ComponentTitleStylePane extends AbstractBorderPackerPane { visibleCheckbox.setSelected(false); container.add(visibleCheckbox, BorderLayout.WEST); - container.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Visible")), BorderLayout.CENTER); + container.add(FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Visible")), BorderLayout.CENTER); visibleCheckbox.addChangeListener(new ChangeListener() { @Override @@ -192,7 +192,7 @@ public class ComponentTitleStylePane extends AbstractBorderPackerPane { double[] columnSize = {this.uiLabelWidth, this.uiSettingWidth > 0 ? this.uiSettingWidth : f}; return TableLayoutHelper.createCommonTableLayoutPane( - new JComponent[][]{{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Content")), textContentPane}}, + new JComponent[][]{{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Content")), textContentPane}}, rowSize, columnSize, IntervalConstants.INTERVAL_L1); } @@ -203,10 +203,10 @@ public class ComponentTitleStylePane extends AbstractBorderPackerPane { double[] columnSize = {this.uiLabelWidth, this.uiSettingWidth > 0 ? this.uiSettingWidth : f}; JComponent[][] components = new JComponent[][]{ - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Format")), fontFamilyComboBox}, + {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Format")), FRGUIPaneFactory.createBorderLayoutNorthPaneWithComponent(fontFamilyComboBox)}, {null, createTitleFontButtonPane()}, {insetImagePane, null}, - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Text_Align")), alignPane}, + {FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title_Text_Align")), alignPane}, {backgroundPane, null} }; diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java b/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java index 55f4612a2b..f9f556b3d3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java @@ -1,10 +1,7 @@ package com.fr.design.gui.style; -import com.fr.base.theme.FormTheme; import com.fr.base.theme.TemplateTheme; import com.fr.design.dialog.BasicPane; -import com.fr.design.event.GlobalNameListener; -import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.file.HistoryTemplateListCache; @@ -15,12 +12,12 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.JTemplate; +import com.fr.design.widget.FRWidgetFactory; import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; @@ -66,12 +63,12 @@ public class FollowingThemePane extends BasicPane implements UIObserver { } }); - UILabel followingThemeLabel = new UILabel(name); + UILabel followingThemeLabel = FRWidgetFactory.createLineWrapLabel(name); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; JPanel followingThemePane = - TableLayoutHelper.createGapTableLayoutPane( new Component[][]{new Component[] { followingThemeLabel, followingThemeButtonGroup}}, + TableLayoutHelper.createGapTableLayoutPane( new Component[][]{new Component[] { followingThemeLabel, FRGUIPaneFactory.createBorderLayoutNorthPaneWithComponent(followingThemeButtonGroup)}}, new double[] { p }, new double[] { SETTING_LABEL_WIDTH, f }, 10, 0); followingThemePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); followingThemePane.setVisible(false); diff --git a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java index 0077f9b871..071feee6ac 100644 --- a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java @@ -7,6 +7,7 @@ import com.fr.stable.AssistUtils; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.Icon; +import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JRadioButton; import java.awt.BorderLayout; @@ -631,6 +632,12 @@ public class FRGUIPaneFactory { return iconRadioPane; } + public static JPanel createBorderLayoutNorthPaneWithComponent(JComponent content) { + JPanel jPanel = new JPanel(new BorderLayout()); + jPanel.add(content, BorderLayout.NORTH); + return jPanel; + } + /** * 计算宽度 *