From 824b8953a4d1fd508c7edde6cbc608955b823b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Thu, 25 Jan 2024 20:04:02 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-111995=20=E5=BC=B9=E5=87=BA=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E9=80=82=E9=85=8DDPI=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/dialog/BasicDialog.java | 22 +++++++++++++++---- .../com/fr/design/formula/FormulaPane.java | 5 ++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/dialog/BasicDialog.java b/designer-base/src/main/java/com/fr/design/dialog/BasicDialog.java index 3b3b1d620f..8eb0594415 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/BasicDialog.java +++ b/designer-base/src/main/java/com/fr/design/dialog/BasicDialog.java @@ -1,8 +1,11 @@ package com.fr.design.dialog; +import com.fine.theme.utils.FineUIScale; import com.fr.common.annotations.Open; -import java.awt.*; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.Frame; @Open public abstract class BasicDialog extends UIDialog { @@ -12,7 +15,7 @@ public abstract class BasicDialog extends UIDialog { public static final Dimension LARGE = new Dimension(900, 600); public static final Dimension CHART = new Dimension(760, 560); public static final Dimension MAP_SIZE = new Dimension(760, 450); - public static final Dimension UPDATE_ONLINE_SIZE = new Dimension(600,300); + public static final Dimension UPDATE_ONLINE_SIZE = new Dimension(600, 300); public static final Dimension TOOLBAR_SIZE = new Dimension(660, 327); public BasicDialog(Frame parent) { @@ -40,12 +43,23 @@ public abstract class BasicDialog extends UIDialog { super(parent, pane, isNeedButtonPane); } + /** + * 设置对话框大小,方法内已进行dpi适配,传参无需考虑dpi适配 + * + * @param d 对话框尺寸 + */ protected void setBasicDialogSize(Dimension d) { - super.setSize(d.width, d.height); + super.setSize(FineUIScale.scale(d.width), FineUIScale.scale(d.height)); } + /** + * 设置对话框大小,方法内已进行dpi适配,传参无需考虑dpi适配 + * + * @param w 宽度 + * @param h 高度 + */ protected void setBasicDialogSize(int w, int h) { - super.setSize(w, h); + setBasicDialogSize(new Dimension(w, h)); } @Override diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 35c5a2c68f..9caae7461a 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -41,7 +41,6 @@ import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; -import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; @@ -749,8 +748,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { } public BasicDialog showLargeWindow(Window window, DialogActionListener l) { - int width = FineUIScale.scale(900); - int height = FineUIScale.scale(600); + int width = 900; + int height = 900; BasicDialog basicDialog = super.showWindowWithCustomSize(window, l, new Dimension(width, height)); basicDialog.setMinimumSize(new Dimension(width, height)); basicDialog.setResizable(true);