Browse Source

Merge pull request #149 in DESIGN/design from ~ZACK/design:release/10.0 to release/10.0

* commit 'a0883aed7f16bddc40d113e268aafac2d4f3ae0b':
  REPORT-8813 设计器启动增加加载工程的loading ,单例面板要放到基础模块之后加载
master
zack 6 years ago
parent
commit
f7822e1bf6
  1. 3
      designer-base/src/com/fr/design/gui/iprogressbar/UIProgressBorder.java
  2. 19
      designer-realize/src/com/fr/start/Designer.java
  3. 30
      designer-realize/src/com/fr/start/module/DesignerStartup.java

3
designer-base/src/com/fr/design/gui/iprogressbar/UIProgressBorder.java

@ -1,6 +1,7 @@
package com.fr.design.gui.iprogressbar; package com.fr.design.gui.iprogressbar;
import com.fr.design.border.UIRoundedBorder; import com.fr.design.border.UIRoundedBorder;
import com.fr.stable.OperatingSystem;
import java.awt.AlphaComposite; import java.awt.AlphaComposite;
import java.awt.BasicStroke; import java.awt.BasicStroke;
@ -62,7 +63,9 @@ public class UIProgressBorder extends UIRoundedBorder {
g2d.fill(new RoundRectangle2D.Double(x, y, width, height, 0, 0)); g2d.fill(new RoundRectangle2D.Double(x, y, width, height, 0, 0));
g2d.setColor(oldColor); g2d.setColor(oldColor);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
if(OperatingSystem.isWindows()){//mac下自带阴影
paintBorderShadow(g2d, 7, x, y, width, height); paintBorderShadow(g2d, 7, x, y, width, height);
}
g2d.setColor(oldColor); g2d.setColor(oldColor);
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 1f)); g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 1f));

19
designer-realize/src/com/fr/start/Designer.java

@ -137,25 +137,6 @@ public class Designer extends BaseDesigner {
TemplateInfoCollector.getInstance(); TemplateInfoCollector.getInstance();
} }
}); });
service.submit(new Runnable() {
@Override
public void run() {
CellElementPropertyPane.getInstance();
}
});
service.submit(new Runnable() {
@Override
public void run() {
DesignerFrameFileDealerPane.getInstance();//这边会涉及到TemplateTreePane
}
});
service.submit(new Runnable() {
@Override
public void run() {
WidgetInfoConfig.getInstance();
}
});
service.shutdown(); service.shutdown();
} }

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

@ -1,8 +1,11 @@
package com.fr.start.module; package com.fr.start.module;
import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.Listener; import com.fr.event.Listener;
import com.fr.form.ui.WidgetInfoConfig;
import com.fr.module.Activator; import com.fr.module.Activator;
import com.fr.start.Designer; import com.fr.start.Designer;
import com.fr.start.EnvSwitcher; import com.fr.start.EnvSwitcher;
@ -26,6 +29,7 @@ public class DesignerStartup extends Activator {
startSub(BasicActivator.class); startSub(BasicActivator.class);
final String[] args = getModule().upFindSingleton(StartupArgs.class).get(); final String[] args = getModule().upFindSingleton(StartupArgs.class).get();
final Designer designer = new Designer(args); final Designer designer = new Designer(args);
preLoadSomething();
//启动env //启动env
startSub(DesignerWorkspaceProvider.class); startSub(DesignerWorkspaceProvider.class);
startSub(EnvBasedModule.class); startSub(EnvBasedModule.class);
@ -47,6 +51,32 @@ public class DesignerStartup extends Activator {
startSub(StartFinishActivator.class); startSub(StartFinishActivator.class);
} }
/**
* 基础模块结束后可以提前加载一部分依赖基础模块(国际化,图标样式之类)的东西
*/
private void preLoadSomething(){
ExecutorService service = Executors.newCachedThreadPool();
service.submit(new Runnable() {
@Override
public void run() {
CellElementPropertyPane.getInstance();
}
});
service.submit(new Runnable() {
@Override
public void run() {
DesignerFrameFileDealerPane.getInstance();//这边会涉及到TemplateTreePane
}
});
service.submit(new Runnable() {
@Override
public void run() {
WidgetInfoConfig.getInstance();
}
});
service.shutdown();
}
/** /**
* 切换环境时重新启动所有相关模块 * 切换环境时重新启动所有相关模块
*/ */

Loading…
Cancel
Save