From 6112baf429c0e01b98c0b7f07f23212963d02111 Mon Sep 17 00:00:00 2001 From: Willem Cazander Date: Sat, 12 Feb 2022 18:22:56 +0100 Subject: [PATCH] DeskApp contour structure --- .../imxmi/lang/ImFrameˣᴹᴵ.java | 10 ++++ .../gdxapp/desktop/BasicConsoleDeskApp.java | 32 ++++++++++++ .../gdxapp/desktop/DeskApp.java | 6 +++ .../gdxapp/desktop/DeskAppContour.java | 27 ++++++++++ .../gdxapp/desktop/DeskAppContourSection.java | 24 +++++++++ .../gdxapp/desktop/DeskAppRenderer.java | 6 +++ .../gdxapp/desktop/DesktopManager.java | 49 +++++++++++++++++++ .../gdxapp/desktop/DesktopScreen.java | 6 +++ 8 files changed, 160 insertions(+) create mode 100644 main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/BasicConsoleDeskApp.java create mode 100644 main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskApp.java create mode 100644 main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskAppContour.java create mode 100644 main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskAppContourSection.java create mode 100644 main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskAppRenderer.java create mode 100644 main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DesktopManager.java create mode 100644 main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DesktopScreen.java diff --git a/lib-imxmi/src/main/love/distributedrebirth/imxmi/lang/ImFrameˣᴹᴵ.java b/lib-imxmi/src/main/love/distributedrebirth/imxmi/lang/ImFrameˣᴹᴵ.java index 516aa35e..9cee87b0 100644 --- a/lib-imxmi/src/main/love/distributedrebirth/imxmi/lang/ImFrameˣᴹᴵ.java +++ b/lib-imxmi/src/main/love/distributedrebirth/imxmi/lang/ImFrameˣᴹᴵ.java @@ -66,6 +66,11 @@ public class ImFrameˣᴹᴵ extends AbstractImComponentSetˣᴹᴵ { this.frameOpen = frameOpen; } + public void setNextWindowPos(float nextWindowPosX, float nextWindowPosY) { + setNextWindowPosX(nextWindowPosX); + setNextWindowPosY(nextWindowPosY); + } + public float getNextWindowPosX() { return nextWindowPosX; } @@ -90,6 +95,11 @@ public class ImFrameˣᴹᴵ extends AbstractImComponentSetˣᴹᴵ { this.nextWindowPosCond = nextWindowPosCond; } + public void setNextWindowSize(float nextWindowSizeWidth, float nextWindowSizeHeight) { + setNextWindowSizeWidth(nextWindowSizeWidth); + setNextWindowSizeHeight(nextWindowSizeHeight); + } + public float getNextWindowSizeWidth() { return nextWindowSizeWidth; } diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/BasicConsoleDeskApp.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/BasicConsoleDeskApp.java new file mode 100644 index 00000000..a3a602a8 --- /dev/null +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/BasicConsoleDeskApp.java @@ -0,0 +1,32 @@ +package love.distributedrebirth.gdxapp.desktop; + +import love.distributedrebirth.imxmi.lang.ImFrameˣᴹᴵ; +import love.distributedrebirth.imxmi.lang.ImTextˣᴹᴵ; + +public class BasicConsoleDeskApp implements DeskApp { + + @Override + public void create(DeskAppContour contour) { + ImFrameˣᴹᴵ frame = new ImFrameˣᴹᴵ(); + frame.setNextWindowPos(300, 300); + frame.setNextWindowSize(320, 240); + frame.setTitle("The BASIC Shahada of DUNE"); + frame.addComponent(new ImTextˣᴹᴵ("10 PRINT \"THERE IS NO GOD BUT @Ω仙⁴\"")); + frame.addComponent(new ImTextˣᴹᴵ("20 PRINT \"THERE IS NO RULE BUT CONSENT\"")); + frame.addComponent(new ImTextˣᴹᴵ("30 PRINT \"THERE IS NO FAILURE BUT DEATH\"")); + frame.addComponent(new ImTextˣᴹᴵ("40 PRINT \"TERRY A. DAVIS WAS THE PROPHET OF @Ω仙9⁴\"")); + frame.addComponent(new ImTextˣᴹᴵ("50 PRINT \"TERRY A. DAVIS WAS THE FIRST TRUE MENTAT\"")); + frame.addComponent(new ImTextˣᴹᴵ("60 PRINT \"TERRY A. DAVIS WAS THE BEST CODER ALIVE\"")); + frame.addComponent(new ImTextˣᴹᴵ("RUN")); + + contour.registrateContour(DeskAppContourSection.MAIN, new DeskAppRenderer() { + + @Override + public void render() { + frame.renderBegin(); + frame.renderComponent(); + frame.renderEnd(); + } + }); + } +} diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskApp.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskApp.java new file mode 100644 index 00000000..0855d414 --- /dev/null +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskApp.java @@ -0,0 +1,6 @@ +package love.distributedrebirth.gdxapp.desktop; + +public interface DeskApp { + + void create(DeskAppContour contour); +} diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskAppContour.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskAppContour.java new file mode 100644 index 00000000..644aaa02 --- /dev/null +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskAppContour.java @@ -0,0 +1,27 @@ +package love.distributedrebirth.gdxapp.desktop; + +import java.util.HashMap; +import java.util.Map; + +public class DeskAppContour { + + private final String appName; + private final Map renderers; + + public DeskAppContour(String appName) { + this.appName = appName; + this.renderers = new HashMap<>(); + } + + public String getAppName() { + return appName; + } + + public void registrateContour(DeskAppContourSection section, DeskAppRenderer renderer) { + renderers.put(section, renderer); + } + + public DeskAppRenderer getContour(DeskAppContourSection section) { + return renderers.get(section); + } +} diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskAppContourSection.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskAppContourSection.java new file mode 100644 index 00000000..562e1c71 --- /dev/null +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskAppContourSection.java @@ -0,0 +1,24 @@ +package love.distributedrebirth.gdxapp.desktop; + +public enum DeskAppContourSection { + + MAIN, + + FILE_NEW, + FILE_CLOSE, + FILE_SAVE, + FILE_OPTION, + FILE_PRINT, + + EDIT_UNDO, + EDIT_COPY, + EDIT_SELECT, + EDIT_FIND, + EDIT_OPTION, + + SELF_WELCOME, + SELF_INDEX, + SELF_OPTION, + SELF_ABOUT, + ; +} diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskAppRenderer.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskAppRenderer.java new file mode 100644 index 00000000..8ae94818 --- /dev/null +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskAppRenderer.java @@ -0,0 +1,6 @@ +package love.distributedrebirth.gdxapp.desktop; + +public interface DeskAppRenderer { + + void render(); +} diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DesktopManager.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DesktopManager.java new file mode 100644 index 00000000..645e5358 --- /dev/null +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DesktopManager.java @@ -0,0 +1,49 @@ +package love.distributedrebirth.gdxapp.desktop; + +import java.util.ArrayList; +import java.util.List; + +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; +import love.distributedrebirth.bassboonyd.BãßBȍőnClassInfoʸᴰ; +import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ; +import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinʸᴰ; +import love.distributedrebirth.bassboonyd.BãßBȍőnPackageInfoʸᴰ; +import love.distributedrebirth.bassboonyd.jmx.DefaultEnumInstanceᴶᴹˣ; +import love.distributedrebirth.bassboonyd.jmx.MBeanStoreKeyᴶᴹˣ; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +@BãßBȍőnClassInfoʸᴰ(name = "BaseGlyphSet", purpose = "The encoded base scripts.") +@BãßBȍőnPackageInfoʸᴰ(name = "love.distributedrebirth.numberxd") +public enum DesktopManager implements DefaultEnumInstanceᴶᴹˣ { + + INSTANCE; + + private List screens = new ArrayList<>(); + private DesktopScreen currentScreen = null; + private final BãßBȍőnCoffinOpenʸᴰ BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance(); + public BãßBȍőnCoffinʸᴰ GET_BBC() { return BBC; } + + public void BãßAddScreen(DesktopScreen screen) { + screens.add(screen); + } + + public int BãßScreensLength() { + return screens.size(); + } + + public DesktopScreen BãßScreenByIndex(int index) { + return screens.get(index); + } + + public void BãßSelectScreenByIndex(int index) { + BãßSelectScreen(BãßScreenByIndex(index)); + } + + public void BãßSelectScreen(DesktopScreen screen) { + currentScreen = screen; + } + + public DesktopScreen BãßCurrentScreen() { + return currentScreen; + } +} diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DesktopScreen.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DesktopScreen.java new file mode 100644 index 00000000..4eedd600 --- /dev/null +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DesktopScreen.java @@ -0,0 +1,6 @@ +package love.distributedrebirth.gdxapp.desktop; + +public interface DesktopScreen { + + public void render(float delta); +}