From 992ab3cde08934f479e6053a0fd1432a351b9a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Tue, 13 Aug 2024 20:53:26 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-113994=20=E3=80=90NewUI=E3=80=91?= =?UTF-8?q?=E8=A7=86=E8=A7=89&=E6=B5=8B=E8=AF=95=E9=AA=8C=E6=94=B6?= =?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 --- .../design/actions/file/PreferencePane.java | 6 ++-- .../data/datapane/connect/DBCPAttrPane.java | 1 - .../fr/design/editor/editor/NumberEditor.java | 1 - .../gui/icombobox/ExtendedComboBox.java | 28 ------------------- .../mainframe/CenterRegionContainerPane.java | 5 ++++ 5 files changed, 8 insertions(+), 33 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 7e372efc1b..ae2c70c53e 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -4,7 +4,6 @@ import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIUtils; -import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.config.Configuration; import com.fr.config.ServerPreferenceConfig; import com.fr.design.DesignerEnvManager; @@ -431,7 +430,8 @@ public class PreferencePane extends BasicPane { @NotNull private JPanel patchScroll(JPanel generalPane) { - UIScrollPane uiScrollPane = new UIScrollPane(generalPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + UIScrollPane uiScrollPane = new UIScrollPane(FineLayoutBuilder.asBorderLayoutWrapped(generalPane), + ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); return FineLayoutBuilder.asBorderLayoutWrapped(uiScrollPane); } @@ -772,7 +772,7 @@ public class PreferencePane extends BasicPane { cell(logExportDirectoryField), cell(chooseDirBtn), cell(logLevelLabel), - cell(logLevelComboBox) + cell(logLevelComboBox).with(it -> it.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX)) ).getComponent(); return FineUIUtils.wrapComponentWithTitle(logPanel, "Log" + i18nText("Fine-Design_Basic_Export_Setting")); } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java index 67142a34a4..5d54d907ee 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DBCPAttrPane.java @@ -199,7 +199,6 @@ public class DBCPAttrPane extends BasicPane { if (showOtherConfig(databaseName)) { FETCHSIZE.addKeyListener(fetchSizeKeyListener); FETCHSIZE.addInputMethodListener(fetchSizeInputMethodListener); - FETCHSIZE.setHorizontalAlignment(JTextField.RIGHT); southFlowPane = Layouts.column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Other"))).with(FineUIUtils::wrapBoldLabelWithUnderline), diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/NumberEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/NumberEditor.java index 632beff71f..0e20c1e569 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/NumberEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/NumberEditor.java @@ -41,7 +41,6 @@ public abstract class NumberEditor extends Editor { numberField = createNumberField(); this.add(numberField, BorderLayout.CENTER); this.numberField.addKeyListener(textKeyListener); - this.numberField.setHorizontalAlignment(UITextField.RIGHT); this.setValue(value); this.setName(name); } diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/ExtendedComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/ExtendedComboBox.java index dd85ab5a4f..d931538a19 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/ExtendedComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/ExtendedComboBox.java @@ -1,10 +1,8 @@ package com.fr.design.gui.icombobox; -import com.fine.theme.light.ui.FineComboBoxUI; import com.fr.common.inputevent.InputEventBaseOnOS; import java.awt.Component; -import java.awt.Dimension; import java.awt.Point; import java.awt.Rectangle; import java.awt.event.MouseEvent; @@ -12,12 +10,9 @@ import java.util.Vector; import javax.swing.ComboBoxModel; import javax.swing.JComboBox; -import javax.swing.JComponent; import javax.swing.JList; import javax.swing.ListCellRenderer; -import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicComboPopup; -import javax.swing.plaf.basic.ComboPopup; import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; @@ -40,29 +35,6 @@ public class ExtendedComboBox extends UIComboBox { super(items); } - /** - * 更新UI - */ - public void updateUI() { - setUI(new ExtendedComboBoxUI()); - } - - static class ExtendedComboBoxUI extends FineComboBoxUI { - public static ComponentUI createUI(JComponent c) { - return new ExtendedComboBoxUI(); - } - - protected ComboPopup createPopup() { - ExtendedComboPopup popup = new ExtendedComboPopup(comboBox); - popup.getAccessibleContext().setAccessibleParent(comboBox); - return popup; - } - - public ComboPopup getPopup() { - return popup; - } - } - static class ExtendedComboPopup extends BasicComboPopup { public ExtendedComboPopup(JComboBox combo) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java index f7b0dbe028..0a802a5d7f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe; +import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.DesignState; @@ -85,6 +86,10 @@ public class CenterRegionContainerPane extends JPanel { eastPane.add(eastCenterPane, BorderLayout.CENTER); toolbarPane.add(eastPane, BorderLayout.NORTH); + Color tabPaneColor = FineUIUtils.getUIColor("TemplateTabPane.background", "fill.gray"); + toolbarPane.setBackground(tabPaneColor); + eastCenterPane.setBackground(tabPaneColor); + this.setLayout(new BorderLayout()); this.add(centerTemplateCardPane = new DesktopCardPane(), BorderLayout.CENTER); centerTemplateCardPane.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));