Browse Source

REPORT-40822 存储过程数据集》编辑界面点击预览,预览框出现在编辑界面背面

【问题原因】设计器中,在弹窗的弹窗场景里,如果是使用DesignerContext.getDesignerFrame()获取父弹窗的话有点问题,会造成第二级的弹窗位于第一级弹窗背后。另外这里的预览会有闪屏现象,原因是在StoreProcedureDataWrapper中会在一个SwingWorker中将dialog(测试的时候发现这个dialog一直没有预览数据)置为可见,但是在另一个SwingWorker中又会将其置为不可见,然后在后续逻辑中重新构建一个包含预览数据的弹窗弹出,这样会造成弹窗又开又关又开,闪屏
【改动思路】传入new JFrame()作为父弹窗,就可以保证预览的弹窗在最上层了;关于闪屏,这边改为第一个空白的dialog置为可见那行代码注释掉,然后自己测试,修改前后预览失败的表现基本一致(修改后无闪屏);另外还修改了一些导包问题
feature/big-screen
Yvan 4 years ago
parent
commit
80ab13972c
  1. 4
      designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java
  2. 13
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/StoreProcedureDataWrapper.java

4
designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java

@ -442,7 +442,7 @@ public class PreviewTablePane extends BasicPane {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
previewTablePane.fireLoadedListener();
previewTablePane.showWindow(DesignerContext.getDesignerFrame()).setVisible(true);
previewTablePane.showWindow(new JFrame()).setVisible(true);
}
/**
@ -475,7 +475,7 @@ public class PreviewTablePane extends BasicPane {
};
prieviewPane.setLayout(FRGUIPaneFactory.createBorderLayout());
prieviewPane.add(tabPreviewpane, BorderLayout.CENTER);
prieviewPane.showWindow(DesignerContext.getDesignerFrame()).setVisible(true);
prieviewPane.showWindow(new JFrame()).setVisible(true);
}
private void populateStoreDataSQL() throws Exception {

13
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/StoreProcedureDataWrapper.java

@ -12,12 +12,12 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.iprogressbar.AutoProgressBar;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.Icon;
import javax.swing.JOptionPane;
import javax.swing.SwingWorker;
import java.util.ArrayList;
import java.util.Arrays;
@ -81,7 +81,7 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
getWorker().cancel(true);
}
});
loadingBar = new AutoProgressBar(dialog, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) {
loadingBar = new AutoProgressBar(dialog, Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) {
public void doMonitorCanceled() {
getDialog().setVisible(false);
getWorker().cancel(true);
@ -103,7 +103,7 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
return columnNameList;
}
if (!createStore(false)) {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_No_TableData"));
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Engine_No_TableData"));
return new ArrayList<String>();
}
columnNameList = Arrays.asList(procedureDataModel.getColumnName());
@ -174,11 +174,12 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
protected Object doInBackground() throws Exception {
loadingBar.close();
PreviewTablePane.resetPreviewTable();
dialog.setVisible(true);
// REPORT-40822 这里的dialog是个空界面,这里设置成可见之后,后面又会设置成不可见,造成闪屏
//dialog.setVisible(true);
return null;
}
}.execute();
connectionBar = new AutoProgressBar(dialog, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Now_Create_Connection"), "", 0, 100) {
connectionBar = new AutoProgressBar(dialog, Toolkit.i18nText("Fine-Design_Basic_Utils_Now_Create_Connection"), "", 0, 100) {
public void doMonitorCanceled() {
connectionBar.close();
worker.cancel(true);
@ -196,7 +197,7 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
connectionBar.close();
// bug 61345 预览失败时,关闭窗口
dialog.setVisible(false);
throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"));
throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"));
}
connectionBar.close();
storeProcedure.resetDataModelList();

Loading…
Cancel
Save