Moved bundle and plane filter

This commit is contained in:
Willem Cazander 2022-03-16 13:54:47 +01:00
parent 4f2030c8e8
commit ad8102be3a
4 changed files with 23 additions and 24 deletions

View file

@ -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

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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());