Browse Source

REPORT-114392 FR-FBP版本本地设计适配 代码质量

fbp-1.0
Destiny.Lin 10 months ago
parent
commit
b53b0b0de9
  1. 17
      designer-realize/src/main/java/com/fanruan/boot/env/function/DesignAnalyzerComponent.java
  2. 28
      designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java
  3. 13
      designer-realize/src/main/java/com/fanruan/boot/init/DesignerInitComponent.java

17
designer-realize/src/main/java/com/fanruan/boot/env/function/DesignAnalyzerComponent.java vendored

@ -136,26 +136,15 @@ public class DesignAnalyzerComponent extends ResourceAffiliate {
ElementMatchers.isAnnotatedWith(FaultTolerance.class), ElementMatchers.isAnnotatedWith(FaultTolerance.class),
FaultToleranceAdvice.class FaultToleranceAdvice.class
)); ));
// 保持M1 可用 // 保持M1 可用
Carina.getApplicationContext().group(AnalyzerKey.class).add(AnalyzerConfiguration.create(new Assistant() { Carina.getApplicationContext().group(AnalyzerKey.class).add(AnalyzerConfiguration.create((builder, typeDescription, classLoader, module) -> builder
.method(ElementMatchers.isAnnotatedWith(Collect.class))
@Override .intercept(MethodDelegation.to(CollectInterceptor.class))));
public DynamicType.Builder<?> supply(DynamicType.Builder<?> builder, TypeDescription typeDescription, ClassLoader classLoader, JavaModule module) {
return builder
.method(ElementMatchers.isAnnotatedWith(Collect.class))
.intercept(MethodDelegation.to(CollectInterceptor.class));
}
}));
Carina.getApplicationContext().group(AnalyzerAdviceKey.class).add(FineAdviceAssistant.create( Carina.getApplicationContext().group(AnalyzerAdviceKey.class).add(FineAdviceAssistant.create(
ElementMatchers.isAnnotatedWith(Collect.class), ElementMatchers.isAnnotatedWith(Collect.class),
CollectAdvice.class CollectAdvice.class
)); ));
} }

28
designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java vendored

@ -151,7 +151,7 @@ import com.fr.task.Once;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.xml.ReportXMLUtils; import com.fr.xml.ReportXMLUtils;
import javax.swing.*; import javax.swing.SwingWorker;
import java.awt.*; import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.util.ArrayList; import java.util.ArrayList;
@ -181,47 +181,34 @@ public class DesignComponent {
} }
}); });
private boolean hasUpdated = false;
/** /**
* start * start
*/ */
@Start @Start
public void start() { public void start() {
List<LocaleMarker> markers = new ArrayList<>(Carina.getApplicationContext().group(InterMutableKey.class).getAll()); List<LocaleMarker> markers = new ArrayList<>(Carina.getApplicationContext().group(InterMutableKey.class).getAll());
for (LocaleMarker marker : markers) { for (LocaleMarker marker : markers) {
if (marker.match(LocaleScope.DESIGN)) { if (marker.match(LocaleScope.DESIGN)) {
DesignI18nImpl.getInstance().addResource(marker.getPath()); DesignI18nImpl.getInstance().addResource(marker.getPath());
} }
} }
CompletableFuture<Void> themeConfigPrepare = CompletableFuture.runAsync(() -> { CompletableFuture<Void> themeConfigPrepare = CompletableFuture.runAsync(() -> {
FormThemeConfigMigrator.getInstance().upgrade(); FormThemeConfigMigrator.getInstance().upgrade();
ReportThemeConfigMigrator.getInstance().upgrade(); ReportThemeConfigMigrator.getInstance().upgrade();
}, DesignerStartupPool.common()); }, DesignerStartupPool.common());
CompletableFuture<Void> mainDesignerPrepare = CompletableFuture.runAsync(this::designerModuleStart, DesignerStartupPool.common()); CompletableFuture<Void> mainDesignerPrepare = CompletableFuture.runAsync(this::designerModuleStart, DesignerStartupPool.common());
CompletableFuture<Void> extendDesignerPrepare = CompletableFuture.runAsync(this::designerExtendStart, DesignerStartupPool.common()); CompletableFuture<Void> extendDesignerPrepare = CompletableFuture.runAsync(this::designerExtendStart, DesignerStartupPool.common());
CompletableFuture<Void> otherFeaturesPrepare = CompletableFuture.runAsync(() -> { CompletableFuture<Void> otherFeaturesPrepare = CompletableFuture.runAsync(() -> {
startBBSLoginAuthServer(); startBBSLoginAuthServer();
migrateBBSInfoFromFineDB(); migrateBBSInfoFromFineDB();
OSSupportCenter.buildAction(new OSBasedAction() { OSSupportCenter.buildAction(objects -> UserInfoPane.getInstance().updateBBSUserInfo(), SupportOSImpl.BBS_USER_LOGIN_PANE);
@Override
public void execute(Object... objects) {
UserInfoPane.getInstance().updateBBSUserInfo();
}
}, SupportOSImpl.BBS_USER_LOGIN_PANE);
loadLogAppender(); loadLogAppender();
//DesignerSocketIO.update();
DesignerWorkspaceLoader.init(); DesignerWorkspaceLoader.init();
storePassport(); storePassport();
AlphaFineHelper.switchConfig4Locale(); AlphaFineHelper.switchConfig4Locale();
RecoverManager.register(new RecoverForDesigner()); RecoverManager.register(new RecoverForDesigner());
}, DesignerStartupPool.common()); }, DesignerStartupPool.common());
CompletableFuture<Void> resourcePrepare = CompletableFuture.runAsync(() -> { CompletableFuture<Void> resourcePrepare = CompletableFuture.runAsync(() -> {
pushUpdateTask.run(); pushUpdateTask.run();
if (WorkContext.getCurrent().isLocal()) { if (WorkContext.getCurrent().isLocal()) {
@ -229,10 +216,7 @@ public class DesignComponent {
UpmResourceLoader.INSTANCE.checkOldShopFile(); UpmResourceLoader.INSTANCE.checkOldShopFile();
} }
}, DesignerStartupPool.common()); }, DesignerStartupPool.common());
CompletableFuture.allOf(mainDesignerPrepare, extendDesignerPrepare, themeConfigPrepare, otherFeaturesPrepare, resourcePrepare).join();
CompletableFuture
.allOf(mainDesignerPrepare, extendDesignerPrepare, themeConfigPrepare, otherFeaturesPrepare, resourcePrepare)
.join();
} }
@ -356,7 +340,7 @@ public class DesignComponent {
return new CellElementValueConverter(); return new CellElementValueConverter();
} }
/* /**
* 针对不同的对象在读取Object对象的xml的时候需要使用不同的对象生成器 * 针对不同的对象在读取Object对象的xml的时候需要使用不同的对象生成器
* @return 返回对象生成器 * @return 返回对象生成器
*/ */
@ -374,9 +358,9 @@ public class DesignComponent {
} }
//wei:fs的模块中可能有需要设计器界面做设置的地方,在这边添加
private static void addAdapterForPlate() {
private static void addAdapterForPlate() {
//wei:fs的模块中可能有需要设计器界面做设置的地方,在这边添加
ProcessTransitionAdapter.setProcessTransitionAdapter(new ProcessTransitionAdapter() { ProcessTransitionAdapter.setProcessTransitionAdapter(new ProcessTransitionAdapter() {
@Override @Override

13
designer-realize/src/main/java/com/fanruan/boot/init/DesignerInitComponent.java

@ -107,28 +107,20 @@ public class DesignerInitComponent {
} }
private void showDesignerStartupPage(DesignerStartupContext context) { private void showDesignerStartupPage(DesignerStartupContext context) {
// 启动页关闭 // 启动页关闭
SplashContext.getInstance().hide(); SplashContext.getInstance().hide();
// 即时暂停 // 即时暂停
suspendRecorder(context); suspendRecorder(context);
Carina.getApplicationContext().group(ActivatorContextGroup.class).add(activatorContext); Carina.getApplicationContext().group(ActivatorContextGroup.class).add(activatorContext);
PreLoadService.getInstance().waitForUI(); PreLoadService.getInstance().waitForUI();
UIUtil.invokeLaterIfNeeded(() -> { UIUtil.invokeLaterIfNeeded(() -> {
StartupPageModel model = StartupPageModel.create(); StartupPageModel model = StartupPageModel.create();
context.setStartupPageModel(model); context.setStartupPageModel(model);
StopWatch suspendWatch = new StopWatch(); StopWatch suspendWatch = new StopWatch();
final Runnable recordSuspend = () -> { final Runnable recordSuspend = () -> {
long suspendTime = suspendWatch.getTime(TimeUnit.MILLISECONDS); long suspendTime = suspendWatch.getTime(TimeUnit.MILLISECONDS);
activatorContext.setSuspendTime(suspendTime); activatorContext.setSuspendTime(suspendTime);
}; };
// selectAndOpenLast // selectAndOpenLast
model.setOpenLastTemplateRunnable(() -> { model.setOpenLastTemplateRunnable(() -> {
recordSuspend.run(); recordSuspend.run();
@ -136,7 +128,6 @@ public class DesignerInitComponent {
handleModel(model); handleModel(model);
launchAfterWarmup(); launchAfterWarmup();
}); });
// selectAndOpenEmpty // selectAndOpenEmpty
model.setOpenEmptyTemplateRunnable(() -> { model.setOpenEmptyTemplateRunnable(() -> {
recordSuspend.run(); recordSuspend.run();
@ -144,7 +135,6 @@ public class DesignerInitComponent {
handleModel(model); handleModel(model);
launchAfterWarmup(); launchAfterWarmup();
}); });
// selectAndCreateNew // selectAndCreateNew
model.setCreateNewTemplateRunnable(() -> { model.setCreateNewTemplateRunnable(() -> {
recordSuspend.run(); recordSuspend.run();
@ -152,14 +142,11 @@ public class DesignerInitComponent {
handleModel(model); handleModel(model);
launchAfterWarmup(); launchAfterWarmup();
}); });
StartupPageWindow window = new StartupPageWindow(model); StartupPageWindow window = new StartupPageWindow(model);
window.setVisible(true); window.setVisible(true);
context.setOnWaiting(true); context.setOnWaiting(true);
suspendWatch.start(); suspendWatch.start();
}); });
waitSubTask(); waitSubTask();
} }

Loading…
Cancel
Save