From afdf5f7b625e533b2371cddd3949513ab39678ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Thu, 5 Sep 2024 17:06:21 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-133410=20fix:=20=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8=E8=A1=A5=E5=85=85=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/report/RichTextPane.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java b/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java index 94bb7322f0..b11de3b3e0 100644 --- a/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java @@ -1,11 +1,13 @@ package com.fr.design.report; import com.fine.theme.utils.FineUIUtils; -import com.formdev.flatlaf.ui.FlatRoundBorder; import com.fr.base.BaseFormula; import com.fr.base.Style; +import com.fr.design.border.FineBorderFactory; import com.fr.design.cell.editor.RichTextToolBar; import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.DesignUtils; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; @@ -20,6 +22,7 @@ import com.fr.stable.Constants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import javax.swing.ScrollPaneConstants; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.DefaultStyledDocument; @@ -32,8 +35,6 @@ import java.awt.Font; import java.math.BigDecimal; import java.util.Iterator; -import static com.fine.swing.ui.layout.Layouts.cell; -import static com.fine.swing.ui.layout.Layouts.column; public class RichTextPane extends BasicPane { @@ -50,13 +51,16 @@ public class RichTextPane extends BasicPane { } protected void initComponents() { - this.setLayout(new BorderLayout()); + this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10)); textPane = new RichTextEditingPane(); - textPane.setBorder(new FlatRoundBorder()); textPane.setBackground(FineUIUtils.getUIColor("background.normal", "background")); - textPane.setFont(DEFAUL_FONT); - toolBar = new RichTextToolBar(textPane); - this.add(column(10, cell(toolBar), cell(textPane).weight(1)).getComponent()); + textPane.setFont(DEFAUL_FONT); + UIScrollPane scrollPane = new UIScrollPane(textPane, + ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + scrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder()); + toolBar = new RichTextToolBar(textPane); + this.add(toolBar, BorderLayout.NORTH); + this.add(scrollPane, BorderLayout.CENTER); } @Override