Browse Source

REPORT-72828 设计器启动优化之起始页设计

1、修复远程目录的展示问题
2、UI效果,距离右边 6 px
3、参数设置放到 UI 线程中
feature/x
Harrison 2 years ago
parent
commit
bf9738a86a
  1. 1
      designer-base/src/main/java/com/fr/start/BaseDesigner.java
  2. 7
      designer-base/src/main/java/com/fr/startup/ui/StartupPageModel.java
  3. 2
      designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java
  4. 5
      designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java

1
designer-base/src/main/java/com/fr/start/BaseDesigner.java

@ -130,6 +130,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
DesignerFrame df = DesignerContext.getDesignerFrame();
isException = openFile(df, isException, file);
df.fireDesignerOpened();
FineLoggerFactory.getLogger().debug("show designer cost {} ms", DesignerStartupContext.getRecorder().getTime());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
if (!isException) {

7
designer-base/src/main/java/com/fr/startup/ui/StartupPageModel.java

@ -2,7 +2,9 @@ package com.fr.startup.ui;
import com.fr.design.DesignerEnvManager;
import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.DesignerWorkspaceType;
import com.fr.third.guava.collect.Lists;
import com.fr.workspace.connect.WorkspaceConnectionInfo;
import java.util.ArrayList;
import java.util.HashMap;
@ -36,7 +38,12 @@ public class StartupPageModel {
.stream()
.map((e) -> {
DesignerWorkspaceInfo workspaceInfo = envManager.getWorkspaceInfo(e);
if (workspaceInfo.getType() == DesignerWorkspaceType.Remote) {
WorkspaceConnectionInfo connection = workspaceInfo.getConnection();
return new StartupWorkspaceBean(e, connection.getUrl(), workspaceInfo.getType());
} else {
return new StartupWorkspaceBean(e, workspaceInfo.getPath(), workspaceInfo.getType());
}
})
.collect(Collectors.toList());
Map<String, List<String>> recentFileMap = new HashMap<>();

2
designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java

@ -214,7 +214,7 @@ public class StartupPageWindow extends JFrame {
}
};
recentOpenPanel.setLayout(new BorderLayout());
recentOpenPanel.setBorder(BorderFactory.createEmptyBorder(25, 25, 25, 25));
recentOpenPanel.setBorder(BorderFactory.createEmptyBorder(25, 25, 25, 6));
StartupWorkspaceBean workspaceInfo = pageModel.getSelectWorkspaceInfo();
JPanel workspaceWrapperYPanel = new JPanel();

5
designer-realize/src/main/java/com/fr/start/module/optimized/DesignerStartupPageActivator.java

@ -103,10 +103,13 @@ public class DesignerStartupPageActivator extends Activator {
DesignerStartupContext.getInstance().setOnStartup(true);
DesignerStartupPageUtil.enterWorkspace();
} finally {
UIUtil.invokeLaterIfNeeded(() -> {
// 换到 awt 线程中关闭,不然异步会出现问题。
DesignerStartupContext.getInstance().setOnStartup(false);
});
}
FineLoggerFactory.getLogger().debug("designer-startup-page started cost {} ms", stopWatch.getTime(TimeUnit.MILLISECONDS));
FineLoggerFactory.getLogger().debug("designer-startup-page started cost {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS));
}
@Override

Loading…
Cancel
Save