Browse Source

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

fbp-1.0
Destiny.Lin 8 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),
FaultToleranceAdvice.class
));
// 保持M1 可用
Carina.getApplicationContext().group(AnalyzerKey.class).add(AnalyzerConfiguration.create(new Assistant() {
@Override
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(AnalyzerKey.class).add(AnalyzerConfiguration.create((builder, typeDescription, classLoader, module) -> builder
.method(ElementMatchers.isAnnotatedWith(Collect.class))
.intercept(MethodDelegation.to(CollectInterceptor.class))));
Carina.getApplicationContext().group(AnalyzerAdviceKey.class).add(FineAdviceAssistant.create(
ElementMatchers.isAnnotatedWith(Collect.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.xml.ReportXMLUtils;
import javax.swing.*;
import javax.swing.SwingWorker;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
@ -181,47 +181,34 @@ public class DesignComponent {
}
});
private boolean hasUpdated = false;
/**
* start
*/
@Start
public void start() {
List<LocaleMarker> markers = new ArrayList<>(Carina.getApplicationContext().group(InterMutableKey.class).getAll());
for (LocaleMarker marker : markers) {
if (marker.match(LocaleScope.DESIGN)) {
DesignI18nImpl.getInstance().addResource(marker.getPath());
}
}
CompletableFuture<Void> themeConfigPrepare = CompletableFuture.runAsync(() -> {
FormThemeConfigMigrator.getInstance().upgrade();
ReportThemeConfigMigrator.getInstance().upgrade();
}, DesignerStartupPool.common());
CompletableFuture<Void> mainDesignerPrepare = CompletableFuture.runAsync(this::designerModuleStart, DesignerStartupPool.common());
CompletableFuture<Void> extendDesignerPrepare = CompletableFuture.runAsync(this::designerExtendStart, DesignerStartupPool.common());
CompletableFuture<Void> otherFeaturesPrepare = CompletableFuture.runAsync(() -> {
startBBSLoginAuthServer();
migrateBBSInfoFromFineDB();
OSSupportCenter.buildAction(new OSBasedAction() {
@Override
public void execute(Object... objects) {
UserInfoPane.getInstance().updateBBSUserInfo();
}
}, SupportOSImpl.BBS_USER_LOGIN_PANE);
OSSupportCenter.buildAction(objects -> UserInfoPane.getInstance().updateBBSUserInfo(), SupportOSImpl.BBS_USER_LOGIN_PANE);
loadLogAppender();
//DesignerSocketIO.update();
DesignerWorkspaceLoader.init();
storePassport();
AlphaFineHelper.switchConfig4Locale();
RecoverManager.register(new RecoverForDesigner());
}, DesignerStartupPool.common());
CompletableFuture<Void> resourcePrepare = CompletableFuture.runAsync(() -> {
pushUpdateTask.run();
if (WorkContext.getCurrent().isLocal()) {
@ -229,10 +216,7 @@ public class DesignComponent {
UpmResourceLoader.INSTANCE.checkOldShopFile();
}
}, 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();
}
/*
/**
* 针对不同的对象在读取Object对象的xml的时候需要使用不同的对象生成器
* @return 返回对象生成器
*/
@ -374,9 +358,9 @@ public class DesignComponent {
}
//wei:fs的模块中可能有需要设计器界面做设置的地方,在这边添加
private static void addAdapterForPlate() {
private static void addAdapterForPlate() {
//wei:fs的模块中可能有需要设计器界面做设置的地方,在这边添加
ProcessTransitionAdapter.setProcessTransitionAdapter(new ProcessTransitionAdapter() {
@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) {
// 启动页关闭
SplashContext.getInstance().hide();
// 即时暂停
suspendRecorder(context);
Carina.getApplicationContext().group(ActivatorContextGroup.class).add(activatorContext);
PreLoadService.getInstance().waitForUI();
UIUtil.invokeLaterIfNeeded(() -> {
StartupPageModel model = StartupPageModel.create();
context.setStartupPageModel(model);
StopWatch suspendWatch = new StopWatch();
final Runnable recordSuspend = () -> {
long suspendTime = suspendWatch.getTime(TimeUnit.MILLISECONDS);
activatorContext.setSuspendTime(suspendTime);
};
// selectAndOpenLast
model.setOpenLastTemplateRunnable(() -> {
recordSuspend.run();
@ -136,7 +128,6 @@ public class DesignerInitComponent {
handleModel(model);
launchAfterWarmup();
});
// selectAndOpenEmpty
model.setOpenEmptyTemplateRunnable(() -> {
recordSuspend.run();
@ -144,7 +135,6 @@ public class DesignerInitComponent {
handleModel(model);
launchAfterWarmup();
});
// selectAndCreateNew
model.setCreateNewTemplateRunnable(() -> {
recordSuspend.run();
@ -152,14 +142,11 @@ public class DesignerInitComponent {
handleModel(model);
launchAfterWarmup();
});
StartupPageWindow window = new StartupPageWindow(model);
window.setVisible(true);
context.setOnWaiting(true);
suspendWatch.start();
});
waitSubTask();
}

Loading…
Cancel
Save