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