Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~plough/10-design into release/10.0

master
plough 7 years ago
parent
commit
f3876e3590
  1. 14
      designer-base/src/com/fr/start/BaseDesigner.java
  2. 13
      designer-base/src/com/fr/start/SplashFxActionListener.java
  3. 8
      designer-realize/src/com/fr/start/fx/SplashFx.java
  4. 18
      designer-realize/src/com/fr/start/fx/SplashFxWindow.java
  5. 6
      designer-realize/src/com/fr/start/module/DesignerStartup.java

14
designer-base/src/com/fr/start/BaseDesigner.java

@ -25,8 +25,6 @@ import com.fr.module.ModuleEvent;
import com.fr.stable.OperatingSystem; import com.fr.stable.OperatingSystem;
import java.awt.Window; import java.awt.Window;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File; import java.io.File;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
@ -76,10 +74,6 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
} }
public void show(final String[] args) { public void show(final String[] args) {
ExecutorService executorService = Executors.newSingleThreadExecutor();
executorService.submit(new Runnable() {
@Override
public void run() {
collectUserInformation(); collectUserInformation();
showDesignerFrame(args, DesignerContext.getDesignerFrame(), false); showDesignerFrame(args, DesignerContext.getDesignerFrame(), false);
DesignerContext.getDesignerFrame().refreshEnv(); DesignerContext.getDesignerFrame().refreshEnv();
@ -87,10 +81,6 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
TemplateTreePane.getInstance().getTemplateFileTree().refresh(); TemplateTreePane.getInstance().getTemplateFileTree().refresh();
} }
} }
});
executorService.shutdown();
DesignerContext.getDesignerFrame().setVisible(true);
}
private void createDesignerFrame() { private void createDesignerFrame() {
@ -160,11 +150,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
if (OperatingSystem.isMacOS()) { if (OperatingSystem.isMacOS()) {
enableFullScreenMode(df); enableFullScreenMode(df);
} }
df.addWindowListener(new WindowAdapter() {
public void windowOpened(WindowEvent e) {
df.getSelectedJTemplate().requestGridFocus(); df.getSelectedJTemplate().requestGridFocus();
}
});
return isException; return isException;
} }

13
designer-base/src/com/fr/start/SplashFxActionListener.java

@ -0,0 +1,13 @@
package com.fr.start;
/**
* 启动动画监听
* Created by zack on 2018/6/14.
*/
public interface SplashFxActionListener {
/**
* 启动动画关闭
*/
void splashClose();
}

8
designer-realize/src/com/fr/start/fx/SplashFx.java

@ -1,5 +1,7 @@
package com.fr.start.fx; package com.fr.start.fx;
import com.fr.design.mainframe.DesignerContext;
import com.fr.start.SplashFxActionListener;
import com.fr.start.SplashStrategy; import com.fr.start.SplashStrategy;
import javafx.application.Application; import javafx.application.Application;
import javafx.application.Platform; import javafx.application.Platform;
@ -31,6 +33,12 @@ public class SplashFx implements SplashStrategy {
} }
}); });
fxWindow = SplashFxWindow.waitForStartUpTest(); fxWindow = SplashFxWindow.waitForStartUpTest();
fxWindow.addSplashActionListener(new SplashFxActionListener() {
@Override
public void splashClose() {
DesignerContext.getDesignerFrame().setVisible(true);
}
});
} }
@Override @Override

18
designer-realize/src/com/fr/start/fx/SplashFxWindow.java

@ -4,6 +4,7 @@ import com.bulenkov.iconloader.util.JBUI;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.stable.OperatingSystem; import com.fr.stable.OperatingSystem;
import com.fr.start.SplashContext; import com.fr.start.SplashContext;
import com.fr.start.SplashFxActionListener;
import javafx.application.Application; import javafx.application.Application;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.scene.Scene; import javafx.scene.Scene;
@ -16,6 +17,8 @@ import javafx.scene.text.Text;
import javafx.stage.Stage; import javafx.stage.Stage;
import javafx.stage.StageStyle; import javafx.stage.StageStyle;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
@ -46,6 +49,7 @@ public class SplashFxWindow extends Application {
private Text moduleInfo; private Text moduleInfo;
private Text thanks; private Text thanks;
private List<SplashFxActionListener> listeners = new ArrayList<SplashFxActionListener>();
private static int uiScale(int i) { private static int uiScale(int i) {
return (int) (i * JBUI_INIT_SCALE); return (int) (i * JBUI_INIT_SCALE);
@ -121,6 +125,7 @@ public class SplashFxWindow extends Application {
public void run() { public void run() {
try { try {
((Stage) moduleInfo.getScene().getWindow()).close(); ((Stage) moduleInfo.getScene().getWindow()).close();
fireSplashClose();
} catch (Exception e) { } catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e); FRContext.getLogger().error(e.getMessage(), e);
} }
@ -161,4 +166,17 @@ public class SplashFxWindow extends Application {
}); });
} }
/**
* 添加一个动画状态监听
* @param listener
*/
public void addSplashActionListener(SplashFxActionListener listener) {
listeners.add(listener);
}
public void fireSplashClose() {
for (SplashFxActionListener listener : listeners) {
listener.splashClose();
}
}
} }

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

@ -2,6 +2,7 @@ package com.fr.start.module;
import com.fr.core.env.EnvConfig; import com.fr.core.env.EnvConfig;
import com.fr.core.env.EnvEvent; import com.fr.core.env.EnvEvent;
import com.fr.design.mainframe.DesignerContext;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.Listener; import com.fr.event.Listener;
import com.fr.module.Activator; import com.fr.module.Activator;
@ -27,10 +28,11 @@ public class DesignerStartup extends Activator {
startSub(EnvBasedModule.class); startSub(EnvBasedModule.class);
getRoot().getSingleton(EnvSwitcher.class).switch2LastEnv(); getRoot().getSingleton(EnvSwitcher.class).switch2LastEnv();
registerEnvListener(); registerEnvListener();
//启动设计器界面 DesignerContext.getDesignerFrame().setVisible(true);
designer.show(args);
//启动画面结束 //启动画面结束
SplashContext.getInstance().hide(); SplashContext.getInstance().hide();
//启动设计器界面
designer.show(args);
startSub(StartFinishActivator.class); startSub(StartFinishActivator.class);
} }

Loading…
Cancel
Save