Browse Source

Merge remote-tracking branch 'origin/release/10.0' into release/10.0

feature/big-screen
Maksim 5 years ago
parent
commit
682bffa610
  1. 7
      designer-base/src/main/java/com/fr/design/RestartHelper.java
  2. 12
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  3. 3
      designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java
  4. 3
      designer-realize/src/main/java/com/fr/start/DesignerLauncher.java
  5. 2
      designer-realize/src/main/java/com/fr/start/DesignerSubListener.java
  6. 2
      designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java
  7. 1
      designer-realize/src/main/java/com/fr/start/MainDesigner.java

7
designer-base/src/main/java/com/fr/design/RestartHelper.java

@ -153,7 +153,14 @@ public class RestartHelper {
} finally { } finally {
WorkContext.getCurrent().close(); WorkContext.getCurrent().close();
frame.dispose(); frame.dispose();
try {
// 更新升级过渡用 供当前测试 后面可删除
Class.forName("com.fr.exit.DesignerExiter");
DesignerExiter.getInstance().execute(); DesignerExiter.getInstance().execute();
} catch (Exception ignore) {
} finally {
System.exit(0);
}
} }
} }

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

@ -50,16 +50,18 @@ import com.fr.file.FILEFactory;
import com.fr.file.FileFILE; import com.fr.file.FileFILE;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.invoke.Reflect;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginContext;
import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.image4j.codec.ico.ICODecoder; import com.fr.stable.image4j.codec.ico.ICODecoder;
import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter; import com.fr.stable.os.support.OSSupportCenter;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
@ -501,8 +503,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
image = ICODecoder.read(DesignerFrame.class image = ICODecoder.read(DesignerFrame.class
.getResourceAsStream("/com/fr/base/images/oem/logo.ico")); .getResourceAsStream("/com/fr/base/images/oem/logo.ico"));
} }
if (OperatingSystem.isMacos()) {
Class clazz = Class.forName("com.apple.eawt.Application");
BufferedImage icon = image.isEmpty() ? IOUtils.readImage("/com/fr/base/images/oem/logo.png") : image.get(image.size() - 1);
Reflect.on(Reflect.on(clazz).call("getApplication").get()).call("setDockIconImage", icon);
} else {
this.setIconImages(image); this.setIconImages(image);
} catch (IOException e) { }
} catch (IOException | ClassNotFoundException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
this.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png")); this.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png"));
} }

3
designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java

@ -30,6 +30,8 @@ import com.fr.general.http.HttpToolbox;
import com.fr.json.JSONArray; import com.fr.json.JSONArray;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.process.engine.core.FineProcessContext;
import com.fr.process.engine.core.FineProcessEngineEvent;
import com.fr.stable.*; import com.fr.stable.*;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse; import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse;
@ -598,6 +600,7 @@ public class UpdateMainDialog extends UIDialog {
final String installLib = StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LOGS_NAME, UpdateConstants.INSTALL_LIB); final String installLib = StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LOGS_NAME, UpdateConstants.INSTALL_LIB);
final JFrame frame = DesignerContext.getDesignerFrame(); final JFrame frame = DesignerContext.getDesignerFrame();
final RestartHelper helper = new RestartHelper(); final RestartHelper helper = new RestartHelper();
FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY);
new FileProcess(callBack) { new FileProcess(callBack) {
@Override @Override
public void onDownloadSuccess() { public void onDownloadSuccess() {

3
designer-realize/src/main/java/com/fr/start/DesignerLauncher.java

@ -1,5 +1,6 @@
package com.fr.start; package com.fr.start;
import com.fr.design.RestartHelper;
import com.fr.process.FineProcess; import com.fr.process.FineProcess;
import com.fr.process.engine.FineJavaProcessFactory; import com.fr.process.engine.FineJavaProcessFactory;
import com.fr.process.engine.core.FineProcessContext; import com.fr.process.engine.core.FineProcessContext;
@ -63,6 +64,6 @@ public class DesignerLauncher {
public void restart() { public void restart() {
beforeExit(); beforeExit();
start(args); RestartHelper.restart();
} }
} }

2
designer-realize/src/main/java/com/fr/start/DesignerSubListener.java

@ -26,6 +26,7 @@ public class DesignerSubListener {
} }
public void start() { public void start() {
if (FineProcessContext.getParentPipe() != null) {
FineProcessContext.getParentPipe().listen(FineProcessEngineEvent.READY, new Listener<Null>() { FineProcessContext.getParentPipe().listen(FineProcessEngineEvent.READY, new Listener<Null>() {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {
@ -36,3 +37,4 @@ public class DesignerSubListener {
}); });
} }
} }
}

2
designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java

@ -57,7 +57,7 @@ public class DesignerSuperListener {
process.getPipe().listen(FineProcessEngineEvent.DESTROY, new Listener<Null>() { process.getPipe().listen(FineProcessEngineEvent.DESTROY, new Listener<Null>() {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {
DesignerLauncher.getInstance().exit(); System.exit(0);
} }
}); });
} }

1
designer-realize/src/main/java/com/fr/start/MainDesigner.java

@ -106,6 +106,7 @@ public class MainDesigner extends BaseDesigner {
watch.start(); watch.start();
//启动运行时 //启动运行时
FineRuntime.start(); FineRuntime.start();
DesignerSubListener.getInstance().start();
Module designerRoot = ModuleContext.parseRoot("designer-startup.xml"); Module designerRoot = ModuleContext.parseRoot("designer-startup.xml");
//传递启动参数 //传递启动参数
designerRoot.setSingleton(StartupArgs.class, new StartupArgs(args)); designerRoot.setSingleton(StartupArgs.class, new StartupArgs(args));

Loading…
Cancel
Save