Browse Source

REPORT-27685 && REPORT-27478 && REPORT-27454

feature/big-screen
hades 5 years ago
parent
commit
4011ec7344
  1. 9
      designer-base/src/main/java/com/fr/design/RestartHelper.java
  2. 14
      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/DesignerSuperListener.java
  6. 1
      designer-realize/src/main/java/com/fr/start/MainDesigner.java

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

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

14
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.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.invoke.Reflect;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
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.OSSupportCenter;
import com.fr.stable.project.ProjectConstants;
@ -501,8 +503,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
image = ICODecoder.read(DesignerFrame.class
.getResourceAsStream("/com/fr/base/images/oem/logo.ico"));
}
this.setIconImages(image);
} catch (IOException e) {
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);
}
} catch (IOException | ClassNotFoundException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
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.JSONObject;
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.project.ProjectConstants;
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 JFrame frame = DesignerContext.getDesignerFrame();
final RestartHelper helper = new RestartHelper();
FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY);
new FileProcess(callBack) {
@Override
public void onDownloadSuccess() {

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

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

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>() {
@Override
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();
//启动运行时
FineRuntime.start();
DesignerSubListener.getInstance().start();
Module designerRoot = ModuleContext.parseRoot("designer-startup.xml");
//传递启动参数
designerRoot.setSingleton(StartupArgs.class, new StartupArgs(args));

Loading…
Cancel
Save