Browse Source

REPORT-111995 弹出面板适配DPI缩放

newui
Levy.Xie-解安森 10 months ago
parent
commit
824b8953a4
  1. 22
      designer-base/src/main/java/com/fr/design/dialog/BasicDialog.java
  2. 5
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

22
designer-base/src/main/java/com/fr/design/dialog/BasicDialog.java

@ -1,8 +1,11 @@
package com.fr.design.dialog; package com.fr.design.dialog;
import com.fine.theme.utils.FineUIScale;
import com.fr.common.annotations.Open; import com.fr.common.annotations.Open;
import java.awt.*; import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.Frame;
@Open @Open
public abstract class BasicDialog extends UIDialog { 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 LARGE = new Dimension(900, 600);
public static final Dimension CHART = new Dimension(760, 560); public static final Dimension CHART = new Dimension(760, 560);
public static final Dimension MAP_SIZE = new Dimension(760, 450); 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 static final Dimension TOOLBAR_SIZE = new Dimension(660, 327);
public BasicDialog(Frame parent) { public BasicDialog(Frame parent) {
@ -40,12 +43,23 @@ public abstract class BasicDialog extends UIDialog {
super(parent, pane, isNeedButtonPane); super(parent, pane, isNeedButtonPane);
} }
/**
* 设置对话框大小方法内已进行dpi适配传参无需考虑dpi适配
*
* @param d 对话框尺寸
*/
protected void setBasicDialogSize(Dimension 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) { protected void setBasicDialogSize(int w, int h) {
super.setSize(w, h); setBasicDialogSize(new Dimension(w, h));
} }
@Override @Override

5
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.itextfield.UITextField;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; 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.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; 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) { public BasicDialog showLargeWindow(Window window, DialogActionListener l) {
int width = FineUIScale.scale(900); int width = 900;
int height = FineUIScale.scale(600); int height = 900;
BasicDialog basicDialog = super.showWindowWithCustomSize(window, l, new Dimension(width, height)); BasicDialog basicDialog = super.showWindowWithCustomSize(window, l, new Dimension(width, height));
basicDialog.setMinimumSize(new Dimension(width, height)); basicDialog.setMinimumSize(new Dimension(width, height));
basicDialog.setResizable(true); basicDialog.setResizable(true);

Loading…
Cancel
Save