From ad8102be3a5f6f8386aa7821e059a53cf0adcbd0 Mon Sep 17 00:00:00 2001 From: Willem Date: Wed, 16 Mar 2022 13:54:47 +0100 Subject: [PATCH] Moved bundle and plane filter --- .../app/glyphdemo/GlyphDemoComponent.java | 17 ++++++++++++++--- .../app/glyphdemo/apps/DemoGlyphSetDeskApp.java | 8 +++----- .../glyphdemo/apps/DemoNumberPartDeskApp.java | 8 +++----- .../glyphdemo/apps/DemoUnicodePlaneDeskApp.java | 14 +++----------- 4 files changed, 23 insertions(+), 24 deletions(-) diff --git a/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/GlyphDemoComponent.java b/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/GlyphDemoComponent.java index 0d0d5d94..45b73afd 100644 --- a/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/GlyphDemoComponent.java +++ b/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/GlyphDemoComponent.java @@ -1,5 +1,7 @@ package love.distributedrebirth.gdxapp4d.app.glyphdemo; +import java.util.ResourceBundle; + import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Deactivate; @@ -11,6 +13,7 @@ import love.distributedrebirth.gdxapp4d.app.glyphdemo.apps.DemoNumberPartDeskApp import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxLog; import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4DeskAppService; import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4LocaleService; +import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4Unicode4DService; import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppLauncher; import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppMenuSection; @@ -26,14 +29,22 @@ public class GlyphDemoComponent { @Reference private VrGem4LocaleService localeService; + @Reference + private VrGem4Unicode4DService unicode4DService; + + private final static String I18N_BUNDLE = "love.distributedrebirth.gdxapp4d.app.glyphdemo.Main"; private final DeskAppLauncher unicodeLauncher; private final DeskAppLauncher baseGlyphLauncher; private final DeskAppLauncher basePartLauncher; public GlyphDemoComponent() { - unicodeLauncher = new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Demo Unicode Plane", () -> new DemoUnicodePlaneDeskApp(localeService)); - baseGlyphLauncher = new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Demo Glyph Set", () -> new DemoGlyphSetDeskApp(localeService)); - basePartLauncher = new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Demo Number Parts", () -> new DemoNumberPartDeskApp(localeService)); + unicodeLauncher = new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Demo Unicode Plane", () -> new DemoUnicodePlaneDeskApp(createBundle())); + baseGlyphLauncher = new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Demo Glyph Set", () -> new DemoGlyphSetDeskApp(createBundle())); + basePartLauncher = new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Demo Number Parts", () -> new DemoNumberPartDeskApp(createBundle())); + } + + private ResourceBundle createBundle() { + return ResourceBundle.getBundle(I18N_BUNDLE, localeService.getTextLocale()); } @Activate diff --git a/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoGlyphSetDeskApp.java b/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoGlyphSetDeskApp.java index 801a18fb..f8aead60 100644 --- a/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoGlyphSetDeskApp.java +++ b/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoGlyphSetDeskApp.java @@ -6,7 +6,6 @@ import imgui.ImGui; import imgui.flag.ImGuiTableFlags; import imgui.type.ImBoolean; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; -import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4LocaleService; import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.AbstractDeskApp; import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppContourSection; import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppRenderer; @@ -15,15 +14,14 @@ import love.distributedrebirth.numberxd.glyph.BaseGlyphSet; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class DemoGlyphSetDeskApp extends AbstractDeskApp { - private final VrGem4LocaleService localeService; + private final ResourceBundle bundle; private final ImBoolean showBase27 = new ImBoolean(false); - public DemoGlyphSetDeskApp(VrGem4LocaleService localeService) { - this.localeService = localeService; + public DemoGlyphSetDeskApp(ResourceBundle bundle) { + this.bundle = bundle; } private String getTxt(String key) { - ResourceBundle bundle = ResourceBundle.getBundle("love.distributedrebirth.gdxapp4d.app.glyphdemo.Main", localeService.getTextLocale()); return bundle.getString(DemoGlyphSetDeskApp.class.getSimpleName()+"."+key); } diff --git a/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoNumberPartDeskApp.java b/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoNumberPartDeskApp.java index 55f77990..14c7af4c 100644 --- a/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoNumberPartDeskApp.java +++ b/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoNumberPartDeskApp.java @@ -9,7 +9,6 @@ import imgui.flag.ImGuiTableFlags; import imgui.type.ImBoolean; import imgui.type.ImInt; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; -import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4LocaleService; import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.AbstractDeskApp; import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppContourSection; import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppRenderer; @@ -24,18 +23,17 @@ import love.distributedrebirth.numberxd.glyph.BaseGlyphSet; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class DemoNumberPartDeskApp extends AbstractDeskApp implements DeskAppRenderer { - private final VrGem4LocaleService localeService; + private final ResourceBundle bundle; private ImInt selectedBasePart = new ImInt(); private final ImBoolean showBase10 = new ImBoolean(false); private final ImBoolean showBase16 = new ImBoolean(false); private final ImBoolean showBase27 = new ImBoolean(false); - public DemoNumberPartDeskApp(VrGem4LocaleService localeService) { - this.localeService = localeService; + public DemoNumberPartDeskApp(ResourceBundle bundle) { + this.bundle = bundle; } private String getTxt(String key) { - ResourceBundle bundle = ResourceBundle.getBundle("love.distributedrebirth.gdxapp4d.app.glyphdemo.Main", localeService.getTextLocale()); return bundle.getString(DemoNumberPartDeskApp.class.getSimpleName()+"."+key); } diff --git a/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoUnicodePlaneDeskApp.java b/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoUnicodePlaneDeskApp.java index 33ec5d30..6500fce5 100644 --- a/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoUnicodePlaneDeskApp.java +++ b/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoUnicodePlaneDeskApp.java @@ -5,7 +5,6 @@ import java.util.ResourceBundle; import imgui.ImGui; import imgui.flag.ImGuiTableFlags; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; -import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4LocaleService; import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.AbstractDeskApp; import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppContourSection; import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppRenderer; @@ -14,14 +13,13 @@ import love.distributedrebirth.unicode4d.UnicodePlaneᶻᴰ; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class DemoUnicodePlaneDeskApp extends AbstractDeskApp implements DeskAppRenderer { - private final VrGem4LocaleService localeService; + private final ResourceBundle bundle; - public DemoUnicodePlaneDeskApp(VrGem4LocaleService localeService) { - this.localeService = localeService; + public DemoUnicodePlaneDeskApp(ResourceBundle bundle) { + this.bundle = bundle; } private String getTxt(String key) { - ResourceBundle bundle = ResourceBundle.getBundle("love.distributedrebirth.gdxapp4d.app.glyphdemo.Main", localeService.getTextLocale()); return bundle.getString(DemoUnicodePlaneDeskApp.class.getSimpleName()+"."+key); } @@ -38,12 +36,6 @@ public class DemoUnicodePlaneDeskApp extends AbstractDeskApp implements DeskAppR ImGui.tableSetupColumn(getTxt("colText")); ImGui.tableHeadersRow(); for (UnicodePlaneᶻᴰ plane:UnicodePlaneᶻᴰ.values()) { - if (plane.name().contains("SUPPLE")) { - continue; - } - if (plane.name().contains("EXTEN")) { - continue; - } ImGui.tableNextRow(); ImGui.tableNextColumn(); ImGui.text(plane.name());