From c98aad6711a379a4c28e50afafbffb6f61688c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Wed, 25 Sep 2024 20:18:22 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-135889=20fix:NewUI=E8=87=AA=E6=9F=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/formula/JavaEditorPane.java | 7 ++++--- .../icontainer/UIEastResizableContainer.java | 1 + .../theme/edit/ChartStyleEditPane.java | 7 +++++-- .../theme/edit/chart/ChartFontPane.java | 21 +++++++------------ .../chart/gui/style/ChartTextAttrPane.java | 7 ++++++- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java b/designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java index c5902c3cdc..be5f479544 100644 --- a/designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java @@ -1,6 +1,7 @@ package com.fr.design.formula; import com.fr.base.FRContext; +import com.fr.design.border.FineBorderFactory; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ibutton.UIButton; @@ -18,12 +19,10 @@ import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; import javax.swing.AbstractAction; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.SwingWorker; import java.awt.BorderLayout; import java.awt.Dimension; -import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.ByteArrayInputStream; @@ -43,8 +42,9 @@ public class JavaEditorPane extends BasicPane { public JavaEditorPane(String className, String defaultText) { this.className = className; - this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10)); javaText = new RSyntaxTextArea(); + javaText.setBorder(null); configRSyntax(javaText); if (StringUtils.isNotEmpty(className)) { javaText.setText("//Loading source code from server..."); @@ -86,6 +86,7 @@ public class JavaEditorPane extends BasicPane { } UIScrollPane jt = new UIScrollPane(javaText); + jt.setBorder(FineBorderFactory.createWrappedRoundBorder()); JPanel toolbarPane = new JPanel(new BorderLayout()); UIButton saveButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save")); saveButton.setAction(new SaveAction()); diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java index 00c708baec..f4ff190182 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java @@ -86,6 +86,7 @@ public class UIEastResizableContainer extends JPanel { @Override public void mouseReleased(MouseEvent e) { dragging = false; + updateCursor(e); } }; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java index 48ff8b21e1..f6d2d41c77 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java @@ -4,6 +4,7 @@ import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.theme.settings.ThemedChartStyle; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.MultiTabPane; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.theme.edit.chart.ChartAxisStylePane; import com.fr.design.mainframe.theme.edit.chart.ChartDataSheetStylePane; import com.fr.design.mainframe.theme.edit.chart.ChartLabelStylePane; @@ -11,7 +12,7 @@ import com.fr.design.mainframe.theme.edit.chart.ChartLegendStylePane; import com.fr.design.mainframe.theme.edit.chart.ChartSeriesStylePane; import com.fr.design.mainframe.theme.edit.chart.ChartTitleAndBackgroundStylePane; -import javax.swing.BorderFactory; +import java.awt.BorderLayout; import java.util.ArrayList; import java.util.List; @@ -34,7 +35,9 @@ public class ChartStyleEditPane extends MultiTabPane { @Override protected void initLayout() { - super.initLayout(); + this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10)); + this.add(tabPane, BorderLayout.NORTH); + this.add(centerPane, BorderLayout.CENTER); setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java index f6124fd4ba..19a81b866a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java @@ -2,21 +2,16 @@ package com.fr.design.mainframe.theme.edit.chart; import com.fine.theme.icon.LazyIcon; import com.fine.theme.utils.FineLayoutBuilder; -import com.fine.theme.utils.FineUIUtils; import com.fr.base.FRContext; -import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itable.FineUITable; +import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.DesignUtils; -import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.general.GeneralUtils; @@ -24,12 +19,8 @@ import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.FlowLayout; import java.awt.Font; -import static com.fine.swing.ui.layout.Layouts.cell; -import static com.fine.swing.ui.layout.Layouts.row; - /** * @author Bjorn * @version 10.0 @@ -70,11 +61,13 @@ public class ChartFontPane extends BasicPane { } protected void initComponents() { - Component[] components = new Component[]{ - fontSizeComboBox, fontColor, italic, bold - }; + UIToolbar toolbar = new UIToolbar(); + toolbar.add(fontSizeComboBox); + toolbar.add(fontColor); + toolbar.add(italic); + toolbar.add(bold); JPanel buttonPane = new JPanel(new BorderLayout()); - buttonPane.add(row(4, cell(fontSizeComboBox), cell(fontColor), cell(italic), cell(bold)).getComponent()); + buttonPane.add(toolbar); this.setLayout(new BorderLayout()); this.add(getContentPane(buttonPane), BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index a7eba5d7e7..78ab582038 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -10,6 +10,7 @@ import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.mainframe.chart.mode.ChartEditContext; @@ -203,7 +204,11 @@ public class ChartTextAttrPane extends BasicPane { protected void initComponents() { JPanel buttonPane = new JPanel(new BorderLayout(scale(10), 0)); buttonPane.add(fontSizeComboBox, BorderLayout.CENTER); - buttonPane.add(FineLayoutBuilder.createHorizontalLayout(10, fontColor, italic, bold), BorderLayout.EAST); + UIToolbar toolbar = new UIToolbar(); + toolbar.add(fontColor); + toolbar.add(italic); + toolbar.add(bold); + buttonPane.add(toolbar, BorderLayout.EAST); this.setLayout(new BorderLayout()); this.add(getContentPane(buttonPane), BorderLayout.CENTER);