diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DatacentersJSBridge.java b/designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DatacentersJSBridge.java index 4166e15c89..f8e164dccf 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DatacentersJSBridge.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DatacentersJSBridge.java @@ -10,6 +10,7 @@ import com.fr.design.dialog.UIDialog; import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.UIFormula; import com.fr.design.jxbrowser.JxUIPane; +import com.fr.design.ui.util.UIUtil; import com.fr.json.revise.EmbedJson; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; @@ -178,11 +179,11 @@ public class DatacentersJSBridge { public void okAction() { CompletableFuture .runAsync(() -> relationPanel.updateNamePane()) - .thenRunAsync(() -> { + .thenRun(() -> { Window ancestor = SwingUtilities.getWindowAncestor(relationPanel); if (ancestor instanceof UIDialog) { try { - ((UIDialog) ancestor).doOK(); + SwingUtilities.invokeLater(() -> ((UIDialog) ancestor).doOK()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } @@ -195,9 +196,11 @@ public class DatacentersJSBridge { */ @JSBridge public void cancelAction() { - Window ancestor = SwingUtilities.getWindowAncestor(relationPanel); - if (ancestor instanceof UIDialog) { - ((UIDialog) ancestor).doCancel(); - } + UIUtil.invokeLaterIfNeeded(() -> { + Window ancestor = SwingUtilities.getWindowAncestor(relationPanel); + if (ancestor instanceof UIDialog) { + ((UIDialog) ancestor).doCancel(); + } + }); } } diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/JxTableDataNamePane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/JxTableDataNamePane.java index dfb0c2f31d..6e3b704af6 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/JxTableDataNamePane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/JxTableDataNamePane.java @@ -1,5 +1,6 @@ package com.fr.design.data.tabledata.datacenter; +import com.fine.theme.utils.FineUIScale; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane.NamePane; @@ -61,7 +62,8 @@ public class JxTableDataNamePane extends NamePane { */ public static Dimension calculatePaneDimension() { DesignerFrame parent = DesignerContext.getDesignerFrame(); - return new Dimension((int) (parent.getWidth() * 0.8), (int) (parent.getHeight() * 0.9)); + return new Dimension((int) (FineUIScale.unscale(parent.getWidth()) * 0.8), + (int) (FineUIScale.unscale(parent.getHeight()) * 0.9)); } }