From 915f39d98918dcadb8a0651720d2fb9c4cc4a73d Mon Sep 17 00:00:00 2001 From: Willem Cazander Date: Thu, 10 Mar 2022 02:00:38 +0100 Subject: [PATCH] Added notepad --- .../app/calculator/CalculatorComponent.java | 6 +-- .../app/hewallet/HeWalletComponent.java | 6 +-- .../app/notepad/NotepadComponent.java | 39 +++++++++++++++++++ .../gdxapp4d/app/notepad/NotepadDeskApp.java | 24 ++++++++++++ .../gdxapp4d/app/tosamp/TosAmpComponent.java | 6 +-- gdxapp4d-boot-desktop/local-override.xml | 3 ++ .../src/chain/warp-sea.xml | 2 + .../vrgem4/VrGem4DeskAppServiceImpl.java | 8 ++-- .../vrgem4/service/VrGem4DeskAppService.java | 5 +-- .../service/deskapp/DeskAppLauncher.java | 8 +++- .../vrgem4/view/DeskTopScreenMenu.java | 6 +-- .../gdxapp4d/vrsys5/VrSys5Component.java | 18 ++++----- 12 files changed, 102 insertions(+), 29 deletions(-) create mode 100644 gdxapp4d-app-notepad/src/main/java/love/distributedrebirth/gdxapp4d/app/notepad/NotepadComponent.java create mode 100644 gdxapp4d-app-notepad/src/main/java/love/distributedrebirth/gdxapp4d/app/notepad/NotepadDeskApp.java diff --git a/gdxapp4d-app-calculator/src/main/java/love/distributedrebirth/gdxapp4d/app/calculator/CalculatorComponent.java b/gdxapp4d-app-calculator/src/main/java/love/distributedrebirth/gdxapp4d/app/calculator/CalculatorComponent.java index a87485d5..22f3f03c 100644 --- a/gdxapp4d-app-calculator/src/main/java/love/distributedrebirth/gdxapp4d/app/calculator/CalculatorComponent.java +++ b/gdxapp4d-app-calculator/src/main/java/love/distributedrebirth/gdxapp4d/app/calculator/CalculatorComponent.java @@ -22,18 +22,18 @@ public class CalculatorComponent { private final DeskAppLauncher launcher; public CalculatorComponent() { - launcher = new DeskAppLauncher("Calculator", () -> new CalculatorDeskApp()); + launcher = new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Calculator", () -> new CalculatorDeskApp()); } @Activate void open() { log.debug(this, SystemGdxLog.ACTIVATE); - deskAppService.installDeskApp(DeskAppMenuSection.PROGRAMMING, launcher); + deskAppService.installDeskApp(launcher); } @Deactivate void close() { log.debug(this, SystemGdxLog.DEACTIVATE); - deskAppService.removeDeskApp(DeskAppMenuSection.PROGRAMMING, launcher); + deskAppService.removeDeskApp(launcher); } } diff --git a/gdxapp4d-app-hewallet/src/main/java/love/distributedrebirth/gdxapp4d/app/hewallet/HeWalletComponent.java b/gdxapp4d-app-hewallet/src/main/java/love/distributedrebirth/gdxapp4d/app/hewallet/HeWalletComponent.java index c4e27133..dd4e4956 100644 --- a/gdxapp4d-app-hewallet/src/main/java/love/distributedrebirth/gdxapp4d/app/hewallet/HeWalletComponent.java +++ b/gdxapp4d-app-hewallet/src/main/java/love/distributedrebirth/gdxapp4d/app/hewallet/HeWalletComponent.java @@ -22,18 +22,18 @@ public class HeWalletComponent { private final DeskAppLauncher launcher; public HeWalletComponent() { - launcher = new DeskAppLauncher("Hebrew Wallet", () -> new HeWalletDeskApp()); + launcher = new DeskAppLauncher(DeskAppMenuSection.INTERNET, "Hebrew Wallet", () -> new HeWalletDeskApp()); } @Activate void open() { log.debug(this, SystemGdxLog.ACTIVATE); - deskAppService.installDeskApp(DeskAppMenuSection.INTERNET, launcher); + deskAppService.installDeskApp(launcher); } @Deactivate void close() { log.debug(this, SystemGdxLog.DEACTIVATE); - deskAppService.removeDeskApp(DeskAppMenuSection.INTERNET, launcher); + deskAppService.removeDeskApp(launcher); } } diff --git a/gdxapp4d-app-notepad/src/main/java/love/distributedrebirth/gdxapp4d/app/notepad/NotepadComponent.java b/gdxapp4d-app-notepad/src/main/java/love/distributedrebirth/gdxapp4d/app/notepad/NotepadComponent.java new file mode 100644 index 00000000..a098113c --- /dev/null +++ b/gdxapp4d-app-notepad/src/main/java/love/distributedrebirth/gdxapp4d/app/notepad/NotepadComponent.java @@ -0,0 +1,39 @@ +package love.distributedrebirth.gdxapp4d.app.notepad; + +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; +import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppMenuSection; + +@Component +public class NotepadComponent { + + @Reference + private SystemGdxLog log; + + @Reference + private VrGem4DeskAppService deskAppService; + + private final DeskAppLauncher launcher; + + public NotepadComponent() { + launcher = new DeskAppLauncher(DeskAppMenuSection.EDITORS, "Notepad", () -> new NotepadDeskApp()); + } + + @Activate + void open() { + log.debug(this, SystemGdxLog.ACTIVATE); + deskAppService.installDeskApp(launcher); + } + + @Deactivate + void close() { + log.debug(this, SystemGdxLog.DEACTIVATE); + deskAppService.removeDeskApp(launcher); + } +} diff --git a/gdxapp4d-app-notepad/src/main/java/love/distributedrebirth/gdxapp4d/app/notepad/NotepadDeskApp.java b/gdxapp4d-app-notepad/src/main/java/love/distributedrebirth/gdxapp4d/app/notepad/NotepadDeskApp.java new file mode 100644 index 00000000..fbe9f536 --- /dev/null +++ b/gdxapp4d-app-notepad/src/main/java/love/distributedrebirth/gdxapp4d/app/notepad/NotepadDeskApp.java @@ -0,0 +1,24 @@ +package love.distributedrebirth.gdxapp4d.app.notepad; + +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 NotepadDeskApp extends AbstractDeskApp implements DeskAppRenderer { + + private String value = ""; + + public void create() { + getContours().setTitle("Notepad"); + getContours().registrateContour(DeskAppContourSection.MAIN, this); + } + + @Override + public void render() { + ImGui.text("Value:"); + ImGui.text(value); + } +} diff --git a/gdxapp4d-app-tosamp/src/main/java/love/distributedrebirth/gdxapp4d/app/tosamp/TosAmpComponent.java b/gdxapp4d-app-tosamp/src/main/java/love/distributedrebirth/gdxapp4d/app/tosamp/TosAmpComponent.java index 9b23e0a4..88e93559 100644 --- a/gdxapp4d-app-tosamp/src/main/java/love/distributedrebirth/gdxapp4d/app/tosamp/TosAmpComponent.java +++ b/gdxapp4d-app-tosamp/src/main/java/love/distributedrebirth/gdxapp4d/app/tosamp/TosAmpComponent.java @@ -26,18 +26,18 @@ public class TosAmpComponent { private final DeskAppLauncher launcher; public TosAmpComponent() { - launcher = new DeskAppLauncher("TosAmp", () -> new TosAmpDeskApp(bootArgs.getFileChooser())); + launcher = new DeskAppLauncher(DeskAppMenuSection.MULTIMEDIA, "TosAmp", () -> new TosAmpDeskApp(bootArgs.getFileChooser())); } @Activate void open() { log.debug(this, SystemGdxLog.ACTIVATE); - deskAppService.installDeskApp(DeskAppMenuSection.MULTIMEDIA, launcher); + deskAppService.installDeskApp(launcher); } @Deactivate void close() { log.debug(this, SystemGdxLog.DEACTIVATE); - deskAppService.removeDeskApp(DeskAppMenuSection.MULTIMEDIA, launcher); + deskAppService.removeDeskApp(launcher); } } diff --git a/gdxapp4d-boot-desktop/local-override.xml b/gdxapp4d-boot-desktop/local-override.xml index 5d202eae..927de856 100644 --- a/gdxapp4d-boot-desktop/local-override.xml +++ b/gdxapp4d-boot-desktop/local-override.xml @@ -14,6 +14,9 @@ ../gdxapp4d-app-tosamp/src/chain ../gdxapp4d-app-tosamp/target/classes + ../gdxapp4d-app-notepad/src/chain + ../gdxapp4d-app-notepad/target/classes + ../gdxapp4d-vrgem4/src/chain ../gdxapp4d-vrgem4/target/classes diff --git a/gdxapp4d-chain-sys-ocean/src/chain/warp-sea.xml b/gdxapp4d-chain-sys-ocean/src/chain/warp-sea.xml index 8b3699d0..d87344c9 100644 --- a/gdxapp4d-chain-sys-ocean/src/chain/warp-sea.xml +++ b/gdxapp4d-chain-sys-ocean/src/chain/warp-sea.xml @@ -10,5 +10,7 @@ + + diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/VrGem4DeskAppServiceImpl.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/VrGem4DeskAppServiceImpl.java index f39a1d64..f93c84ff 100644 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/VrGem4DeskAppServiceImpl.java +++ b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/VrGem4DeskAppServiceImpl.java @@ -23,12 +23,12 @@ public class VrGem4DeskAppServiceImpl implements VrGem4DeskAppService { } @Override - public void installDeskApp(DeskAppMenuSection section, DeskAppLauncher launcher) { - getMenuSection(section).add(launcher); + public void installDeskApp(DeskAppLauncher launcher) { + getMenuSection(launcher.getMenuSection()).add(launcher); } @Override - public void removeDeskApp(DeskAppMenuSection section, DeskAppLauncher launcher) { - getMenuSection(section).remove(launcher); + public void removeDeskApp(DeskAppLauncher launcher) { + getMenuSection(launcher.getMenuSection()).remove(launcher); } } diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/service/VrGem4DeskAppService.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/service/VrGem4DeskAppService.java index 608e4bce..58cd8f2a 100644 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/service/VrGem4DeskAppService.java +++ b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/service/VrGem4DeskAppService.java @@ -1,11 +1,10 @@ package love.distributedrebirth.gdxapp4d.vrgem4.service; import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppLauncher; -import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppMenuSection; public interface VrGem4DeskAppService { - void installDeskApp(DeskAppMenuSection section, DeskAppLauncher launcher); + void installDeskApp(DeskAppLauncher launcher); - void removeDeskApp(DeskAppMenuSection section, DeskAppLauncher launcher); + void removeDeskApp(DeskAppLauncher launcher); } diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/service/deskapp/DeskAppLauncher.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/service/deskapp/DeskAppLauncher.java index 12a98526..c282d11e 100644 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/service/deskapp/DeskAppLauncher.java +++ b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/service/deskapp/DeskAppLauncher.java @@ -4,14 +4,20 @@ import java.util.function.Supplier; public final class DeskAppLauncher { + private final DeskAppMenuSection menuSection; private final String name; private final Supplier launcher; - public DeskAppLauncher(String name, Supplier launcher) { + public DeskAppLauncher(DeskAppMenuSection menuSection, String name, Supplier launcher) { + this.menuSection = menuSection; this.name = name; this.launcher = launcher; } + public DeskAppMenuSection getMenuSection() { + return menuSection; + } + public String getName() { return name; } diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/view/DeskTopScreenMenu.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/view/DeskTopScreenMenu.java index 85273178..b844f869 100644 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/view/DeskTopScreenMenu.java +++ b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/view/DeskTopScreenMenu.java @@ -43,10 +43,10 @@ public class DeskTopScreenMenu { this.terminal = terminal; this.deskAppService = deskAppService; apps = new ArrayList<>(); - apps.add(new DeskAppLauncher("Sys Glyph Set", () -> new SystemBaseGlyphApp())); - apps.add(new DeskAppLauncher("Sys Number Parts", () -> new SystemBasePartApp())); + apps.add(new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Sys Glyph Set", () -> new SystemBaseGlyphApp())); + apps.add(new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Sys Number Parts", () -> new SystemBasePartApp())); - apps.add(new DeskAppLauncher("Unicode4D", () -> new Unicode4DApp())); + apps.add(new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Unicode4D", () -> new Unicode4DApp())); } public void renderMenu(DeskTopScreen appScreen) { diff --git a/gdxapp4d-vrsys5/src/main/java/love/distributedrebirth/gdxapp4d/vrsys5/VrSys5Component.java b/gdxapp4d-vrsys5/src/main/java/love/distributedrebirth/gdxapp4d/vrsys5/VrSys5Component.java index 98736eb3..4b1167da 100644 --- a/gdxapp4d-vrsys5/src/main/java/love/distributedrebirth/gdxapp4d/vrsys5/VrSys5Component.java +++ b/gdxapp4d-vrsys5/src/main/java/love/distributedrebirth/gdxapp4d/vrsys5/VrSys5Component.java @@ -31,24 +31,24 @@ public class VrSys5Component { private final DeskAppLauncher imguiLauncher; public VrSys5Component() { - basicLauncher = new DeskAppLauncher("Basic Console", () -> new BasicConsoleDeskApp()); - unicodeLauncher = new DeskAppLauncher("Base Unicode Plane", () -> new BaseUnicodePlaneDeskApp(localeService)); - imguiLauncher = new DeskAppLauncher("ImGui Demo", () -> new ImGuiDeskApp()); + basicLauncher = new DeskAppLauncher(DeskAppMenuSection.SYSTEM, "Basic Console", () -> new BasicConsoleDeskApp()); + unicodeLauncher = new DeskAppLauncher(DeskAppMenuSection.SYSTEM, "Base Unicode Plane", () -> new BaseUnicodePlaneDeskApp(localeService)); + imguiLauncher = new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "ImGui Demo", () -> new ImGuiDeskApp()); } @Activate void open() { log.debug(this, SystemGdxLog.ACTIVATE); - deskAppService.installDeskApp(DeskAppMenuSection.SYSTEM, basicLauncher); - deskAppService.installDeskApp(DeskAppMenuSection.SYSTEM, unicodeLauncher); - deskAppService.installDeskApp(DeskAppMenuSection.PROGRAMMING, imguiLauncher); + deskAppService.installDeskApp(basicLauncher); + deskAppService.installDeskApp(unicodeLauncher); + deskAppService.installDeskApp(imguiLauncher); } @Deactivate void close() { log.debug(this, SystemGdxLog.DEACTIVATE); - deskAppService.removeDeskApp(DeskAppMenuSection.SYSTEM, basicLauncher); - deskAppService.removeDeskApp(DeskAppMenuSection.SYSTEM, unicodeLauncher); - deskAppService.removeDeskApp(DeskAppMenuSection.PROGRAMMING, imguiLauncher); + deskAppService.removeDeskApp(basicLauncher); + deskAppService.removeDeskApp(unicodeLauncher); + deskAppService.removeDeskApp(imguiLauncher); } }