Browse Source

REPORT-30557 【10.0.6】设计器启动类替换接口

feature/big-screen
hades 5 years ago
parent
commit
818fde9b2f
  1. 23
      designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java
  2. 23
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java
  3. 10
      designer-realize/src/main/java/com/fr/start/DesignerInitial.java

23
designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java

@ -0,0 +1,23 @@
package com.fr.design.fun;
import com.fr.stable.fun.mark.Mutable;
import com.fr.start.BaseDesigner;
/**
* 设计器启动类替换接口
*
* @author hades
* @version 10.0
* Created by hades on 2020/5/7
*/
public interface DesignerTransform extends Mutable {
String MARK_STRING = "DesignerTransform";
int CURRENT_LEVEL = 1;
Class<? extends BaseDesigner> transform();
}

23
designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java

@ -0,0 +1,23 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.DesignerTransform;
import com.fr.stable.fun.mark.API;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/5/7
*/
@API(level = DesignerTransform.CURRENT_LEVEL)
public abstract class AbstractDesignerTransform implements DesignerTransform {
@Override
public String mark4Provider() {
return getClass().getName();
}
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
}

10
designer-realize/src/main/java/com/fr/start/DesignerInitial.java

@ -1,12 +1,15 @@
package com.fr.start; package com.fr.start;
import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.constants.DesignerLaunchStatus;
import com.fr.design.fun.DesignerTransform;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.event.Listener; import com.fr.event.Listener;
import com.fr.event.Null; import com.fr.event.Null;
import com.fr.invoke.Reflect;
import com.fr.stable.bridge.StableFactory;
/** /**
* Created by juhaoyu on 2019-06-14. * Created by juhaoyu on 2019-06-14.
@ -14,14 +17,19 @@ import com.fr.event.Null;
*/ */
public class DesignerInitial { public class DesignerInitial {
private static volatile MainDesigner designer; private static volatile BaseDesigner designer;
public static void init(final String... args) { public static void init(final String... args) {
UIUtil.invokeLaterIfNeeded(new Runnable() { UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override @Override
public void run() { public void run() {
DesignerTransform transform = StableFactory.getMarkedInstanceObjectFromClass(DesignerTransform.MARK_STRING, DesignerTransform.class);
if (transform != null) {
designer = Reflect.on(transform.transform()).create(args).get();
} else {
designer = new MainDesigner(args); designer = new MainDesigner(args);
} }
}
}); });
} }

Loading…
Cancel
Save