Browse Source

REPORT-17988 设计器启动速度--本机大概从 14.2s -> 10.2

bugfix
后面刷新env的原因是啥?
research/10.0
ju 6 years ago
parent
commit
a08bec7b16
  1. 2
      designer-base/src/main/java/com/fr/design/event/DesignerOpenedListener.java
  2. 19
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  3. 5
      designer-base/src/main/java/com/fr/start/BaseDesigner.java
  4. 11
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

2
designer-base/src/main/java/com/fr/design/event/DesignerOpenedListener.java

@ -9,5 +9,5 @@ public interface DesignerOpenedListener extends EventListener {
/** /**
* Invoked when the target of the listener has changed the rpt content. * Invoked when the target of the listener has changed the rpt content.
*/ */
public void designerOpened(); void designerOpened();
} }

19
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -308,16 +308,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
} }
} }
}); });
this.addDesignerOpenedListener(new DesignerOpenedListener() {
@Override
public void designerOpened() {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setComposite();
reCalculateFrameSize();
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().doResize();
}
});
this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
this.setVisible(false); this.setVisible(false);
this.setExtendedState(JFrame.MAXIMIZED_BOTH); this.setExtendedState(JFrame.MAXIMIZED_BOTH);
@ -326,7 +316,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
initMenuPane(); initMenuPane();
this.progressDialog = new ProgressDialog(this); this.progressDialog = new ProgressDialog(this);
} }
public void resizeFrame() {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setComposite();
reCalculateFrameSize();
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().doResize();
}
public void closeAuthorityEditing() { public void closeAuthorityEditing() {
DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.NORMAL); DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.NORMAL);
WestRegionContainerPane.getInstance().replaceDownPane( WestRegionContainerPane.getInstance().replaceDownPane(

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

@ -55,11 +55,14 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
public void show() { public void show() {
collectUserInformation(); collectUserInformation();
showDesignerFrame(false); showDesignerFrame(false);
DesignerContext.getDesignerFrame().setVisible(true);
//TODO: 2019-06-14 这里有啥作用?
DesignerContext.getDesignerFrame().refreshEnv(); DesignerContext.getDesignerFrame().refreshEnv();
for (int i = 0; !TemplateTreePane.getInstance().getTemplateFileTree().isTemplateShowing() && i < LOAD_TREE_MAXNUM; i++) { for (int i = 0; !TemplateTreePane.getInstance().getTemplateFileTree().isTemplateShowing() && i < LOAD_TREE_MAXNUM; i++) {
TemplateTreePane.getInstance().getTemplateFileTree().refresh(); TemplateTreePane.getInstance().getTemplateFileTree().refresh();
} }
DesignerContext.getDesignerFrame().setVisible(true);
DesignerContext.getDesignerFrame().resizeFrame();
} }

11
designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

@ -1,21 +1,11 @@
package com.fr.start.module; package com.fr.start.module;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.event.Event;
import com.fr.event.Listener;
import com.fr.module.Activator; import com.fr.module.Activator;
import com.fr.record.analyzer.EnableMetrics; import com.fr.record.analyzer.EnableMetrics;
import com.fr.record.analyzer.Metrics; import com.fr.record.analyzer.Metrics;
import com.fr.runtime.FineRuntime; import com.fr.runtime.FineRuntime;
import com.fr.start.DesignerInitial;
import com.fr.start.ServerStarter; import com.fr.start.ServerStarter;
import com.fr.start.server.FineEmbedServer;
import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/** /**
* Created by juhaoyu on 2018/1/8. * Created by juhaoyu on 2018/1/8.
@ -31,7 +21,6 @@ public class DesignerStartup extends Activator {
getSub("parallel").start(); getSub("parallel").start();
//designer模块启动好后,查看demo //designer模块启动好后,查看demo
browserDemo(); browserDemo();
startSub(DesignerShowActivator.class); startSub(DesignerShowActivator.class);
startSub(StartFinishActivator.class); startSub(StartFinishActivator.class);
FineRuntime.startFinish(); FineRuntime.startFinish();

Loading…
Cancel
Save