From 818fde9b2f6497bb567daea3d579dbc2c8c2113a Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 11 May 2020 15:52:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-30557=20=E3=80=9010.0.6=E3=80=91?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=90=AF=E5=8A=A8=E7=B1=BB=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/fun/DesignerTransform.java | 23 +++++++++++++++++++ .../fun/impl/AbstractDesignerTransform.java | 23 +++++++++++++++++++ .../java/com/fr/start/DesignerInitial.java | 12 ++++++++-- 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java diff --git a/designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java b/designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java new file mode 100644 index 0000000000..cb408e6fe2 --- /dev/null +++ b/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 transform(); + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java new file mode 100644 index 0000000000..0f4d44d2d6 --- /dev/null +++ b/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; + } +} diff --git a/designer-realize/src/main/java/com/fr/start/DesignerInitial.java b/designer-realize/src/main/java/com/fr/start/DesignerInitial.java index 856208f400..5df71cdbf9 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerInitial.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerInitial.java @@ -1,12 +1,15 @@ package com.fr.start; import com.fr.design.constants.DesignerLaunchStatus; +import com.fr.design.fun.DesignerTransform; import com.fr.design.mainframe.DesignerContext; import com.fr.design.ui.util.UIUtil; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.event.Null; +import com.fr.invoke.Reflect; +import com.fr.stable.bridge.StableFactory; /** * Created by juhaoyu on 2019-06-14. @@ -14,13 +17,18 @@ import com.fr.event.Null; */ public class DesignerInitial { - private static volatile MainDesigner designer; + private static volatile BaseDesigner designer; public static void init(final String... args) { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - designer = new MainDesigner(args); + 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); + } } }); } From ebebf3673dc16ed0833bab23432b9762d14155fa Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 11 May 2020 16:35:39 +0800 Subject: [PATCH 2/3] REPORT-30557 fix name --- .../{DesignerTransform.java => DesignerProcessor.java} | 4 ++-- ...ignerTransform.java => AbstractDesignerProcessor.java} | 6 +++--- .../src/main/java/com/fr/start/DesignerInitial.java | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) rename designer-base/src/main/java/com/fr/design/fun/{DesignerTransform.java => DesignerProcessor.java} (74%) rename designer-base/src/main/java/com/fr/design/fun/impl/{AbstractDesignerTransform.java => AbstractDesignerProcessor.java} (65%) diff --git a/designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java b/designer-base/src/main/java/com/fr/design/fun/DesignerProcessor.java similarity index 74% rename from designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java rename to designer-base/src/main/java/com/fr/design/fun/DesignerProcessor.java index cb408e6fe2..aa9de716b3 100644 --- a/designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java +++ b/designer-base/src/main/java/com/fr/design/fun/DesignerProcessor.java @@ -11,9 +11,9 @@ import com.fr.start.BaseDesigner; * Created by hades on 2020/5/7 */ -public interface DesignerTransform extends Mutable { +public interface DesignerProcessor extends Mutable { - String MARK_STRING = "DesignerTransform"; + String MARK_STRING = "DesignerProcessor"; int CURRENT_LEVEL = 1; diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerProcessor.java similarity index 65% rename from designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java rename to designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerProcessor.java index 0f4d44d2d6..1398a522f6 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerProcessor.java @@ -1,6 +1,6 @@ package com.fr.design.fun.impl; -import com.fr.design.fun.DesignerTransform; +import com.fr.design.fun.DesignerProcessor; import com.fr.stable.fun.mark.API; /** @@ -8,8 +8,8 @@ import com.fr.stable.fun.mark.API; * @version 10.0 * Created by hades on 2020/5/7 */ -@API(level = DesignerTransform.CURRENT_LEVEL) -public abstract class AbstractDesignerTransform implements DesignerTransform { +@API(level = DesignerProcessor.CURRENT_LEVEL) +public abstract class AbstractDesignerProcessor implements DesignerProcessor { @Override public String mark4Provider() { diff --git a/designer-realize/src/main/java/com/fr/start/DesignerInitial.java b/designer-realize/src/main/java/com/fr/start/DesignerInitial.java index 5df71cdbf9..464e774cae 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerInitial.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerInitial.java @@ -1,7 +1,7 @@ package com.fr.start; import com.fr.design.constants.DesignerLaunchStatus; -import com.fr.design.fun.DesignerTransform; +import com.fr.design.fun.DesignerProcessor; import com.fr.design.mainframe.DesignerContext; import com.fr.design.ui.util.UIUtil; import com.fr.event.Event; @@ -23,9 +23,9 @@ public class DesignerInitial { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - DesignerTransform transform = StableFactory.getMarkedInstanceObjectFromClass(DesignerTransform.MARK_STRING, DesignerTransform.class); - if (transform != null) { - designer = Reflect.on(transform.transform()).create(args).get(); + DesignerProcessor processor = StableFactory.getMarkedInstanceObjectFromClass(DesignerProcessor.MARK_STRING, DesignerProcessor.class); + if (processor != null) { + designer = Reflect.on(processor.transform()).create(args).get(); } else { designer = new MainDesigner(args); } From 3e2daccbbc6e164112323f606258a7a2e33fbcc2 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 11 May 2020 17:22:36 +0800 Subject: [PATCH 3/3] REPORT-30557 fix name --- ...ignerProcessor.java => DesignerStartClassProcessor.java} | 4 ++-- ...va => AbstractDesignerStartClassProcessorProcessor.java} | 6 +++--- .../src/main/java/com/fr/start/DesignerInitial.java | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) rename designer-base/src/main/java/com/fr/design/fun/{DesignerProcessor.java => DesignerStartClassProcessor.java} (71%) rename designer-base/src/main/java/com/fr/design/fun/impl/{AbstractDesignerProcessor.java => AbstractDesignerStartClassProcessorProcessor.java} (59%) diff --git a/designer-base/src/main/java/com/fr/design/fun/DesignerProcessor.java b/designer-base/src/main/java/com/fr/design/fun/DesignerStartClassProcessor.java similarity index 71% rename from designer-base/src/main/java/com/fr/design/fun/DesignerProcessor.java rename to designer-base/src/main/java/com/fr/design/fun/DesignerStartClassProcessor.java index aa9de716b3..4874be8029 100644 --- a/designer-base/src/main/java/com/fr/design/fun/DesignerProcessor.java +++ b/designer-base/src/main/java/com/fr/design/fun/DesignerStartClassProcessor.java @@ -11,9 +11,9 @@ import com.fr.start.BaseDesigner; * Created by hades on 2020/5/7 */ -public interface DesignerProcessor extends Mutable { +public interface DesignerStartClassProcessor extends Mutable { - String MARK_STRING = "DesignerProcessor"; + String MARK_STRING = "DesignerStartClassProcessor"; int CURRENT_LEVEL = 1; diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerProcessor.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerStartClassProcessorProcessor.java similarity index 59% rename from designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerProcessor.java rename to designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerStartClassProcessorProcessor.java index 1398a522f6..7c94ffe37a 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerProcessor.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerStartClassProcessorProcessor.java @@ -1,6 +1,6 @@ package com.fr.design.fun.impl; -import com.fr.design.fun.DesignerProcessor; +import com.fr.design.fun.DesignerStartClassProcessor; import com.fr.stable.fun.mark.API; /** @@ -8,8 +8,8 @@ import com.fr.stable.fun.mark.API; * @version 10.0 * Created by hades on 2020/5/7 */ -@API(level = DesignerProcessor.CURRENT_LEVEL) -public abstract class AbstractDesignerProcessor implements DesignerProcessor { +@API(level = DesignerStartClassProcessor.CURRENT_LEVEL) +public abstract class AbstractDesignerStartClassProcessorProcessor implements DesignerStartClassProcessor { @Override public String mark4Provider() { diff --git a/designer-realize/src/main/java/com/fr/start/DesignerInitial.java b/designer-realize/src/main/java/com/fr/start/DesignerInitial.java index 464e774cae..39c702af56 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerInitial.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerInitial.java @@ -1,7 +1,7 @@ package com.fr.start; import com.fr.design.constants.DesignerLaunchStatus; -import com.fr.design.fun.DesignerProcessor; +import com.fr.design.fun.DesignerStartClassProcessor; import com.fr.design.mainframe.DesignerContext; import com.fr.design.ui.util.UIUtil; import com.fr.event.Event; @@ -23,7 +23,7 @@ public class DesignerInitial { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - DesignerProcessor processor = StableFactory.getMarkedInstanceObjectFromClass(DesignerProcessor.MARK_STRING, DesignerProcessor.class); + DesignerStartClassProcessor processor = StableFactory.getMarkedInstanceObjectFromClass(DesignerStartClassProcessor.MARK_STRING, DesignerStartClassProcessor.class); if (processor != null) { designer = Reflect.on(processor.transform()).create(args).get(); } else {