Added notepad

This commit is contained in:
Willem Cazander 2022-03-10 02:00:38 +01:00
parent cb03208ac1
commit 915f39d989
12 changed files with 102 additions and 29 deletions

View file

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

View file

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

View file

@ -4,14 +4,20 @@ import java.util.function.Supplier;
public final class DeskAppLauncher {
private final DeskAppMenuSection menuSection;
private final String name;
private final Supplier<DeskApp> launcher;
public DeskAppLauncher(String name, Supplier<DeskApp> launcher) {
public DeskAppLauncher(DeskAppMenuSection menuSection, String name, Supplier<DeskApp> launcher) {
this.menuSection = menuSection;
this.name = name;
this.launcher = launcher;
}
public DeskAppMenuSection getMenuSection() {
return menuSection;
}
public String getName() {
return name;
}

View file

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