From a3186867c18d0e80a0cca5953da0e0b02ca45a3f Mon Sep 17 00:00:00 2001 From: Willem Date: Fri, 4 Mar 2022 15:45:19 +0100 Subject: [PATCH] Added vrsys5 and fixed loading order bug --- gdxapp4d-boot-desktop/local-override.xml | 3 + .../src/chain/warp-sea.xml | 2 + .../gdxapp4d/tos4/GDXAppTos4Activator.java | 20 +-- .../gdxapp4d/tos4/service/SystemWarpShip.java | 3 +- .../vrgem4/GDXAppVrGem4Activator.java | 11 +- .../vrgem4/view/DeskTopScreenMenu.java | 2 - .../vrgem4/view/apps/BasicConsoleApp.java | 25 ---- gdxapp4d-vrsys5/pom.xml | 118 ++++++++++++++++++ gdxapp4d-vrsys5/src/chain/warp-sea.xml | 9 ++ .../vrsys5/BasicConsoleComponent.java | 30 +++++ .../gdxapp4d/vrsys5/BasicConsoleDeskApp.java | 28 +++++ pom.xml | 1 + 12 files changed, 210 insertions(+), 42 deletions(-) delete mode 100644 gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/view/apps/BasicConsoleApp.java create mode 100644 gdxapp4d-vrsys5/pom.xml create mode 100644 gdxapp4d-vrsys5/src/chain/warp-sea.xml create mode 100644 gdxapp4d-vrsys5/src/main/java/love/distributedrebirth/gdxapp4d/vrsys5/BasicConsoleComponent.java create mode 100644 gdxapp4d-vrsys5/src/main/java/love/distributedrebirth/gdxapp4d/vrsys5/BasicConsoleDeskApp.java diff --git a/gdxapp4d-boot-desktop/local-override.xml b/gdxapp4d-boot-desktop/local-override.xml index 51fec6e5..476ebf63 100644 --- a/gdxapp4d-boot-desktop/local-override.xml +++ b/gdxapp4d-boot-desktop/local-override.xml @@ -13,4 +13,7 @@ ../gdxapp4d-vrgem4/src/chain ../gdxapp4d-vrgem4/target/classes + + ../gdxapp4d-vrsys5/src/chain + ../gdxapp4d-vrsys5/target/classes diff --git a/gdxapp4d-chain-sys-engine/src/chain/warp-sea.xml b/gdxapp4d-chain-sys-engine/src/chain/warp-sea.xml index 7e4a9441..99ce160a 100644 --- a/gdxapp4d-chain-sys-engine/src/chain/warp-sea.xml +++ b/gdxapp4d-chain-sys-engine/src/chain/warp-sea.xml @@ -8,5 +8,7 @@ + + diff --git a/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4Activator.java b/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4Activator.java index ef417e79..54d56cff 100644 --- a/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4Activator.java +++ b/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4Activator.java @@ -13,7 +13,6 @@ import java.util.function.Consumer; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.x4o.xml.io.X4OConnectionException; @@ -193,9 +192,10 @@ public class GDXAppTos4Activator implements BundleActivator { context.registerService(SystemGdxBootArgs.class.getName(), new SystemGdxBootArgsImpl(), new Hashtable()); context.registerService(SystemGdxTerminal.class.getName(), systemGdxTerminal, new Hashtable()); + List registratedSeas = new ArrayList<>(); int result = 0; try { - result = systemWarpShip.loadWaterOcean(context, warpshipDevice.theShip().getEngine(), v -> fireMessageEvent(v)); + result = systemWarpShip.loadWaterOcean(context, warpshipDevice.theShip().getEngine(), v -> fireMessageEvent(v), registratedSeas); } catch (Exception e) { e.printStackTrace(); fireMessageEvent("ERROR: "+e.getMessage()); @@ -210,9 +210,9 @@ public class GDXAppTos4Activator implements BundleActivator { fireMessageEvent("tos4: chains resolved."); try { - ServiceReference[] refs = context.getServiceReferences( SystemWarpSea.class.getName(), "(warp.sea.name=*)" ); - for (int i=0;i[] refs = context.getServiceReferences( SystemWarpSea.class.getName(), "(warp.sea.name=*)" ); + for (SystemWarpSea service : registratedSeas) { + //SystemWarpSea service = (SystemWarpSea) context.getService( refs[i] ); String key = service.getWarpKey(); File waterHome = service.getWarpHome(); for (WaterSeaMagic magic:service.getWarpSea().theWater().getSeaMagics()) { @@ -221,8 +221,10 @@ public class GDXAppTos4Activator implements BundleActivator { String overrideBundleKey = key + "." + magic.getFile(); String overrideBundle = localOverrides.getProperty(overrideBundleKey); if (overrideBundle == null) { + LOG.debug("installAndStartBundles reference:file:"+waterHome.getAbsolutePath()+"/"+magic.getFile()); SystemGdxBootFactory.installAndStartBundles(context, "reference:file:"+waterHome.getAbsolutePath()+"/"+magic.getFile()); } else { + LOG.debug("installAndStartBundles reference:file:"+overrideBundle); SystemGdxBootFactory.installAndStartBundles(context, "reference:file:"+overrideBundle); } } @@ -326,7 +328,7 @@ public class GDXAppTos4Activator implements BundleActivator { } @Override - public int loadWaterOcean(BundleContext context, String key, Consumer logger) + public int loadWaterOcean(BundleContext context, String key, Consumer logger, List registratedSeas) throws IOException, InterruptedException, X4OConnectionException, SAXException { File waterHome; String override = localOverrides.getProperty(key); @@ -371,13 +373,15 @@ public class GDXAppTos4Activator implements BundleActivator { WaterOcean ocean = WaterOceanDriver.newInstance().createReader().readFile(waterSea); logger.accept("water-ocean: "+key+" ("+ocean.theWater().getName()+")"); + SystemWarpSeaImpl sea = new SystemWarpSeaImpl(key, waterHome, ocean); Hashtable props = new Hashtable(); props.put(SystemWarpSea.NAME_PROPERTY, ocean.theWater().getName()); - context.registerService(SystemWarpSea.class.getName(), new SystemWarpSeaImpl(key, waterHome, ocean), props); + context.registerService(SystemWarpSea.class.getName(), sea, props); + registratedSeas.add(sea); int result = 0; for (WaterSeaChain chain: ocean.theWater().getSeaChains()) { - result += loadWaterOcean(context, chain.getKey(), logger); + result += loadWaterOcean(context, chain.getKey(), logger, registratedSeas); } return result; } diff --git a/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/service/SystemWarpShip.java b/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/service/SystemWarpShip.java index f9616d1c..97c2123f 100644 --- a/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/service/SystemWarpShip.java +++ b/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/service/SystemWarpShip.java @@ -1,6 +1,7 @@ package love.distributedrebirth.gdxapp4d.tos4.service; import java.io.IOException; +import java.util.List; import java.util.function.Consumer; import org.osgi.framework.BundleContext; @@ -16,5 +17,5 @@ public interface SystemWarpShip { WaterDevice getWarpShip(); - int loadWaterOcean(BundleContext context, String key, Consumer logger) throws IOException, InterruptedException, X4OConnectionException, SAXException, BundleException; + int loadWaterOcean(BundleContext context, String key, Consumer logger, List registratedSeas) throws IOException, InterruptedException, X4OConnectionException, SAXException, BundleException; } diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/GDXAppVrGem4Activator.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/GDXAppVrGem4Activator.java index 28dfbed1..ebe237a1 100644 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/GDXAppVrGem4Activator.java +++ b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/GDXAppVrGem4Activator.java @@ -1,7 +1,9 @@ package love.distributedrebirth.gdxapp4d.vrgem4; import java.io.File; +import java.util.ArrayList; import java.util.Hashtable; +import java.util.List; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; @@ -12,13 +14,11 @@ import com.badlogic.gdx.Gdx; import imgui.type.ImBoolean; import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ; import love.distributedrebirth.bassboonyd.jmx.DefaultEnumBaseᴶᴹˣ; -import love.distributedrebirth.gdxapp4d.tos4.GDXAppTos4Activator.SystemWarpBaseImpl; import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootFactory; import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxBootArgs; import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxFont; import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpShip; import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal; -import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpBase; import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpSea; import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenCredits; import love.distributedrebirth.gdxapp4d.vrgem4.screen.ScreenDesktop1; @@ -170,10 +170,11 @@ public class GDXAppVrGem4Activator implements BundleActivator { ServiceReference systemWarpShipRef = context.getServiceReference(SystemWarpShip.class); SystemWarpShip systemWarpShip = context.getService(systemWarpShipRef); + List registratedSeas = new ArrayList<>(); int result = 0; try { for (WaterShipOcean ocean:systemWarpShip.getWarpShip().theShip().getShipOceans()) { - result = systemWarpShip.loadWaterOcean(context, ocean.getSea(), v -> bootScreen.bootLine(v)); + result = systemWarpShip.loadWaterOcean(context, ocean.getSea(), v -> bootScreen.bootLine(v), registratedSeas); } } catch (Exception e) { e.printStackTrace(); @@ -187,9 +188,7 @@ public class GDXAppVrGem4Activator implements BundleActivator { bootScreen.bootLine("vrGEM4: chains resolved."); try { - ServiceReference[] refs = context.getServiceReferences( SystemWarpSea.class.getName(), "(warp.sea.name=*)" ); - for (int i=0;i(); - apps.add(new DeskAppLauncher("Basic Console", () -> new BasicConsoleApp())); apps.add(new DeskAppLauncher("Sys Glyph Set", () -> new SystemBaseGlyphApp())); apps.add(new DeskAppLauncher("Sys Number Parts", () -> new SystemBasePartApp())); apps.add(new DeskAppLauncher("Sys Unicode", () -> new SystemBaseUnicodePlaneApp())); diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/view/apps/BasicConsoleApp.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/view/apps/BasicConsoleApp.java deleted file mode 100644 index 4e252beb..00000000 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/view/apps/BasicConsoleApp.java +++ /dev/null @@ -1,25 +0,0 @@ -package love.distributedrebirth.gdxapp4d.vrgem4.view.apps; - -import imgui.ImGui; -import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; -import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.AbstractDeskApp; -import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppContourSection; - -@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") -public class BasicConsoleApp extends AbstractDeskApp { - - @Override - public void create() { - getContours().setTitle("Basic Conssole"); - getContours().registrateContour(DeskAppContourSection.MAIN, () -> { - ImGui.text("10 PRINT \"The BASIC Shahada of DUNE;\""); - ImGui.text("20 PRINT \"- THERE IS NO GOD BUT @Ω仙⁴\""); - ImGui.text("30 PRINT \"- THERE IS NO RULE BUT CONSENT\""); - ImGui.text("40 PRINT \"- THERE IS NO FAILURE BUT DEATH\""); - ImGui.text("50 PRINT \"- TERRY A. DAVIS WAS THE PROPHET OF @Ω仙9⁴\""); - ImGui.text("60 PRINT \"- TERRY A. DAVIS WAS THE FIRST TRUE MENTAT\""); - ImGui.text("70 PRINT \"- TERRY A. DAVIS WAS THE BEST CODER ALIVE\""); - ImGui.text("RUN"); - }); - } -} diff --git a/gdxapp4d-vrsys5/pom.xml b/gdxapp4d-vrsys5/pom.xml new file mode 100644 index 00000000..54a4f671 --- /dev/null +++ b/gdxapp4d-vrsys5/pom.xml @@ -0,0 +1,118 @@ + + 4.0.0 + + love.distributedrebirth.gdxapp4d + gdxapp4d + 0.0.1-SNAPSHOT + + gdxapp4d-vrsys5 + bundle + + + love.distributedrebirth.gdxapp4d + gdxapp4d-vrgem4 + ${project.version} + provided + + + + + + org.apache.felix + maven-bundle-plugin + true + + true + + <_donotcopy>(.git) + <_dsannotations>* + <_metatypeannotations>* + + org.osgi.framework, + org.osgi.service.packageadmin, + org.osgi.service.url, + org.osgi.service.startlevel, + org.osgi.util.tracker, + love.distributedrebirth.gdxapp4d.tos4.service, + love.distributedrebirth.gdxapp4d.vrgem4.service, + love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp, + com.badlogic.gdx, + com.badlogic.gdx.assets, + com.badlogic.gdx.assets.loaders, + com.badlogic.gdx.assets.loaders.resolvers, + com.badlogic.gdx.audio, + com.badlogic.gdx.files, + com.badlogic.gdx.graphics, + com.badlogic.gdx.graphics.g2d, + com.badlogic.gdx.graphics.g2d.freetype, + com.badlogic.gdx.graphics.g3d, + com.badlogic.gdx.graphics.g3d.attributes, + com.badlogic.gdx.graphics.g3d.decals, + com.badlogic.gdx.graphics.g3d.environment, + com.badlogic.gdx.graphics.g3d.loader, + com.badlogic.gdx.graphics.g3d.model, + com.badlogic.gdx.graphics.g3d.model.data, + com.badlogic.gdx.graphics.g3d.particles, + com.badlogic.gdx.graphics.g3d.particles.bactches, + com.badlogic.gdx.graphics.g3d.particles.emitters, + com.badlogic.gdx.graphics.g3d.particles.influencers, + com.badlogic.gdx.graphics.g3d.particles.renderers, + com.badlogic.gdx.graphics.g3d.particles.values, + com.badlogic.gdx.graphics.g3d.shaders, + com.badlogic.gdx.graphics.g3d.utils, + com.badlogic.gdx.graphics.g3d.utils.shapebuilders, + com.badlogic.gdx.graphics.glutils, + com.badlogic.gdx.graphics.profiling, + com.badlogic.gdx.input, + com.badlogic.gdx.maps, + com.badlogic.gdx.maps.objects, + com.badlogic.gdx.maps.tiled, + com.badlogic.gdx.maps.tiled.objects, + com.badlogic.gdx.maps.tiled.renderers, + com.badlogic.gdx.maps.tiled.tiles, + com.badlogic.gdx.math, + com.badlogic.gdx.math.collision, + com.badlogic.gdx.net, + com.badlogic.gdx.scenes.scene2d, + com.badlogic.gdx.scenes.scene2d.actions, + com.badlogic.gdx.scenes.scene2d.ui, + com.badlogic.gdx.scenes.scene2d.utils, + com.badlogic.gdx.utils, + com.badlogic.gdx.utils.async, + com.badlogic.gdx.utils.compression, + com.badlogic.gdx.utils.compression.lz, + com.badlogic.gdx.utils.compression.lzma, + com.badlogic.gdx.utils.compression.rangecoder, + com.badlogic.gdx.utils.reflect, + com.badlogic.gdx.utils.viewport, + imgui, + imgui.flag, + imgui.glfw, + imgui.gl3, + imgui.type, + net.spookygames.gdx.nativefilechooser, + love.distributedrebirth.bassboonyd, + love.distributedrebirth.bassboonyd.jmx, + love.distributedrebirth.numberxd, + love.distributedrebirth.numberxd.base2t, + love.distributedrebirth.numberxd.base2t.part, + love.distributedrebirth.numberxd.base2t.part.warp, + love.distributedrebirth.numberxd.base2t.type, + love.distributedrebirth.numberxd.base2t.typexl, + love.distributedrebirth.numberxd.glyph, + love.distributedrebirth.numberxd.x4o, + love.distributedrebirth.warpme, + love.distributedrebirth.warpme.core, + love.distributedrebirth.warpme.hash, + love.distributedrebirth.warpme.sea, + love.distributedrebirth.warpme.ship, + love.distributedrebirth.unicode4d, + love.distributedrebirth.unicode4d.atlas + + distributedrebirth.love + + + + + + \ No newline at end of file diff --git a/gdxapp4d-vrsys5/src/chain/warp-sea.xml b/gdxapp4d-vrsys5/src/chain/warp-sea.xml new file mode 100644 index 00000000..3ed3d582 --- /dev/null +++ b/gdxapp4d-vrsys5/src/chain/warp-sea.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/gdxapp4d-vrsys5/src/main/java/love/distributedrebirth/gdxapp4d/vrsys5/BasicConsoleComponent.java b/gdxapp4d-vrsys5/src/main/java/love/distributedrebirth/gdxapp4d/vrsys5/BasicConsoleComponent.java new file mode 100644 index 00000000..9bac81d8 --- /dev/null +++ b/gdxapp4d-vrsys5/src/main/java/love/distributedrebirth/gdxapp4d/vrsys5/BasicConsoleComponent.java @@ -0,0 +1,30 @@ +package love.distributedrebirth.gdxapp4d.vrsys5; + +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; +import org.osgi.service.component.annotations.Reference; + +import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxLog; +import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4DeskAppService; +import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppLauncher; + +@Component +public class BasicConsoleComponent { + + @Reference + private SystemGdxLog log; + + @Reference + private VrGem4DeskAppService deskAppService; + + @Activate + void open() { + log.info(this, "Activate BasicConsoleComponent"); + deskAppService.registrateDeskApp(new DeskAppLauncher("Basic Console", () -> new BasicConsoleDeskApp())); + } + + @Deactivate + void close() { + } +} diff --git a/gdxapp4d-vrsys5/src/main/java/love/distributedrebirth/gdxapp4d/vrsys5/BasicConsoleDeskApp.java b/gdxapp4d-vrsys5/src/main/java/love/distributedrebirth/gdxapp4d/vrsys5/BasicConsoleDeskApp.java new file mode 100644 index 00000000..f756d395 --- /dev/null +++ b/gdxapp4d-vrsys5/src/main/java/love/distributedrebirth/gdxapp4d/vrsys5/BasicConsoleDeskApp.java @@ -0,0 +1,28 @@ +package love.distributedrebirth.gdxapp4d.vrsys5; + +import imgui.ImGui; +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; +import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.AbstractDeskApp; +import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppContourSection; +import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppRenderer; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +public class BasicConsoleDeskApp extends AbstractDeskApp implements DeskAppRenderer { + + public void create() { + getContours().setTitle("Basic Console"); + getContours().registrateContour(DeskAppContourSection.MAIN, this); + } + + @Override + public void render() { + ImGui.text("10 PRINT \"The BASIC Shahada of DUNE;\""); + ImGui.text("20 PRINT \"- THERE IS NO GOD BUT @Ω仙⁴\""); + ImGui.text("30 PRINT \"- THERE IS NO RULE BUT CONSENT\""); + ImGui.text("40 PRINT \"- THERE IS NO FAILURE BUT DEATH\""); + ImGui.text("50 PRINT \"- TERRY A. DAVIS WAS THE PROPHET OF @Ω仙9⁴\""); + ImGui.text("60 PRINT \"- TERRY A. DAVIS WAS THE FIRST TRUE MENTAT\""); + ImGui.text("70 PRINT \"- TERRY A. DAVIS WAS THE BEST CODER ALIVE\""); + ImGui.text("RUN"); + } +} diff --git a/pom.xml b/pom.xml index 653f43b5..bbcf0307 100644 --- a/pom.xml +++ b/pom.xml @@ -27,6 +27,7 @@ gdxapp4d-vrgem4 gdxapp4d-app-calculator gdxapp4d-app-hewallet + gdxapp4d-vrsys5 UTF-8