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

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

View file

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

View file

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

View file

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

View file

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

View file

@ -14,6 +14,9 @@
<entry key="5522aa29da5b6b2cb4befaa14aacaade6aafd848d158293a4cdffbc2c41b23bd">../gdxapp4d-app-tosamp/src/chain</entry>
<entry key="5522aa29da5b6b2cb4befaa14aacaade6aafd848d158293a4cdffbc2c41b23bd.gdxapp4d-app-tosamp.jar">../gdxapp4d-app-tosamp/target/classes</entry>
<entry key="4411aa29da5b6b2cb4befcc14aac55de6fffd848d158293a4cdffbc2c41b83fb">../gdxapp4d-app-notepad/src/chain</entry>
<entry key="4411aa29da5b6b2cb4befcc14aac55de6fffd848d158293a4cdffbc2c41b83fb.gdxapp4d-app-notepad.jar">../gdxapp4d-app-notepad/target/classes</entry>
<entry key="ccba3b29da8b1b1cb444f381449beede3cbfd442d158293a4cdffbc3c41a31cc">../gdxapp4d-vrgem4/src/chain</entry>
<entry key="ccba3b29da8b1b1cb444f381449beede3cbfd442d158293a4cdffbc3c41a31cc.gdxapp4d-vrgem4.jar">../gdxapp4d-vrgem4/target/classes</entry>

View file

@ -10,5 +10,7 @@
<link:chain key="6633aa29da5b6b2cb4bef781469cffde677fd848d158293a4cdffbc2c41b89fe"/>
<!-- Link app-tosamp -->
<link:chain key="5522aa29da5b6b2cb4befaa14aacaade6aafd848d158293a4cdffbc2c41b23bd"/>
<!-- Link app-notepad -->
<link:chain key="4411aa29da5b6b2cb4befcc14aac55de6fffd848d158293a4cdffbc2c41b83fb"/>
</link:sea>
</root:ocean>

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

View file

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