Added notepad
This commit is contained in:
parent
cb03208ac1
commit
915f39d989
|
@ -22,18 +22,18 @@ public class CalculatorComponent {
|
||||||
private final DeskAppLauncher launcher;
|
private final DeskAppLauncher launcher;
|
||||||
|
|
||||||
public CalculatorComponent() {
|
public CalculatorComponent() {
|
||||||
launcher = new DeskAppLauncher("Calculator", () -> new CalculatorDeskApp());
|
launcher = new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Calculator", () -> new CalculatorDeskApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Activate
|
@Activate
|
||||||
void open() {
|
void open() {
|
||||||
log.debug(this, SystemGdxLog.ACTIVATE);
|
log.debug(this, SystemGdxLog.ACTIVATE);
|
||||||
deskAppService.installDeskApp(DeskAppMenuSection.PROGRAMMING, launcher);
|
deskAppService.installDeskApp(launcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deactivate
|
@Deactivate
|
||||||
void close() {
|
void close() {
|
||||||
log.debug(this, SystemGdxLog.DEACTIVATE);
|
log.debug(this, SystemGdxLog.DEACTIVATE);
|
||||||
deskAppService.removeDeskApp(DeskAppMenuSection.PROGRAMMING, launcher);
|
deskAppService.removeDeskApp(launcher);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,18 +22,18 @@ public class HeWalletComponent {
|
||||||
private final DeskAppLauncher launcher;
|
private final DeskAppLauncher launcher;
|
||||||
|
|
||||||
public HeWalletComponent() {
|
public HeWalletComponent() {
|
||||||
launcher = new DeskAppLauncher("Hebrew Wallet", () -> new HeWalletDeskApp());
|
launcher = new DeskAppLauncher(DeskAppMenuSection.INTERNET, "Hebrew Wallet", () -> new HeWalletDeskApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Activate
|
@Activate
|
||||||
void open() {
|
void open() {
|
||||||
log.debug(this, SystemGdxLog.ACTIVATE);
|
log.debug(this, SystemGdxLog.ACTIVATE);
|
||||||
deskAppService.installDeskApp(DeskAppMenuSection.INTERNET, launcher);
|
deskAppService.installDeskApp(launcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deactivate
|
@Deactivate
|
||||||
void close() {
|
void close() {
|
||||||
log.debug(this, SystemGdxLog.DEACTIVATE);
|
log.debug(this, SystemGdxLog.DEACTIVATE);
|
||||||
deskAppService.removeDeskApp(DeskAppMenuSection.INTERNET, launcher);
|
deskAppService.removeDeskApp(launcher);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -26,18 +26,18 @@ public class TosAmpComponent {
|
||||||
private final DeskAppLauncher launcher;
|
private final DeskAppLauncher launcher;
|
||||||
|
|
||||||
public TosAmpComponent() {
|
public TosAmpComponent() {
|
||||||
launcher = new DeskAppLauncher("TosAmp", () -> new TosAmpDeskApp(bootArgs.getFileChooser()));
|
launcher = new DeskAppLauncher(DeskAppMenuSection.MULTIMEDIA, "TosAmp", () -> new TosAmpDeskApp(bootArgs.getFileChooser()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Activate
|
@Activate
|
||||||
void open() {
|
void open() {
|
||||||
log.debug(this, SystemGdxLog.ACTIVATE);
|
log.debug(this, SystemGdxLog.ACTIVATE);
|
||||||
deskAppService.installDeskApp(DeskAppMenuSection.MULTIMEDIA, launcher);
|
deskAppService.installDeskApp(launcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deactivate
|
@Deactivate
|
||||||
void close() {
|
void close() {
|
||||||
log.debug(this, SystemGdxLog.DEACTIVATE);
|
log.debug(this, SystemGdxLog.DEACTIVATE);
|
||||||
deskAppService.removeDeskApp(DeskAppMenuSection.MULTIMEDIA, launcher);
|
deskAppService.removeDeskApp(launcher);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
<entry key="5522aa29da5b6b2cb4befaa14aacaade6aafd848d158293a4cdffbc2c41b23bd">../gdxapp4d-app-tosamp/src/chain</entry>
|
<entry key="5522aa29da5b6b2cb4befaa14aacaade6aafd848d158293a4cdffbc2c41b23bd">../gdxapp4d-app-tosamp/src/chain</entry>
|
||||||
<entry key="5522aa29da5b6b2cb4befaa14aacaade6aafd848d158293a4cdffbc2c41b23bd.gdxapp4d-app-tosamp.jar">../gdxapp4d-app-tosamp/target/classes</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/src/chain</entry>
|
||||||
<entry key="ccba3b29da8b1b1cb444f381449beede3cbfd442d158293a4cdffbc3c41a31cc.gdxapp4d-vrgem4.jar">../gdxapp4d-vrgem4/target/classes</entry>
|
<entry key="ccba3b29da8b1b1cb444f381449beede3cbfd442d158293a4cdffbc3c41a31cc.gdxapp4d-vrgem4.jar">../gdxapp4d-vrgem4/target/classes</entry>
|
||||||
|
|
||||||
|
|
|
@ -10,5 +10,7 @@
|
||||||
<link:chain key="6633aa29da5b6b2cb4bef781469cffde677fd848d158293a4cdffbc2c41b89fe"/>
|
<link:chain key="6633aa29da5b6b2cb4bef781469cffde677fd848d158293a4cdffbc2c41b89fe"/>
|
||||||
<!-- Link app-tosamp -->
|
<!-- Link app-tosamp -->
|
||||||
<link:chain key="5522aa29da5b6b2cb4befaa14aacaade6aafd848d158293a4cdffbc2c41b23bd"/>
|
<link:chain key="5522aa29da5b6b2cb4befaa14aacaade6aafd848d158293a4cdffbc2c41b23bd"/>
|
||||||
|
<!-- Link app-notepad -->
|
||||||
|
<link:chain key="4411aa29da5b6b2cb4befcc14aac55de6fffd848d158293a4cdffbc2c41b83fb"/>
|
||||||
</link:sea>
|
</link:sea>
|
||||||
</root:ocean>
|
</root:ocean>
|
||||||
|
|
|
@ -23,12 +23,12 @@ public class VrGem4DeskAppServiceImpl implements VrGem4DeskAppService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void installDeskApp(DeskAppMenuSection section, DeskAppLauncher launcher) {
|
public void installDeskApp(DeskAppLauncher launcher) {
|
||||||
getMenuSection(section).add(launcher);
|
getMenuSection(launcher.getMenuSection()).add(launcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeDeskApp(DeskAppMenuSection section, DeskAppLauncher launcher) {
|
public void removeDeskApp(DeskAppLauncher launcher) {
|
||||||
getMenuSection(section).remove(launcher);
|
getMenuSection(launcher.getMenuSection()).remove(launcher);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package love.distributedrebirth.gdxapp4d.vrgem4.service;
|
package love.distributedrebirth.gdxapp4d.vrgem4.service;
|
||||||
|
|
||||||
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppLauncher;
|
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppLauncher;
|
||||||
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppMenuSection;
|
|
||||||
|
|
||||||
public interface VrGem4DeskAppService {
|
public interface VrGem4DeskAppService {
|
||||||
|
|
||||||
void installDeskApp(DeskAppMenuSection section, DeskAppLauncher launcher);
|
void installDeskApp(DeskAppLauncher launcher);
|
||||||
|
|
||||||
void removeDeskApp(DeskAppMenuSection section, DeskAppLauncher launcher);
|
void removeDeskApp(DeskAppLauncher launcher);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,14 +4,20 @@ import java.util.function.Supplier;
|
||||||
|
|
||||||
public final class DeskAppLauncher {
|
public final class DeskAppLauncher {
|
||||||
|
|
||||||
|
private final DeskAppMenuSection menuSection;
|
||||||
private final String name;
|
private final String name;
|
||||||
private final Supplier<DeskApp> launcher;
|
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.name = name;
|
||||||
this.launcher = launcher;
|
this.launcher = launcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DeskAppMenuSection getMenuSection() {
|
||||||
|
return menuSection;
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,10 +43,10 @@ public class DeskTopScreenMenu {
|
||||||
this.terminal = terminal;
|
this.terminal = terminal;
|
||||||
this.deskAppService = deskAppService;
|
this.deskAppService = deskAppService;
|
||||||
apps = new ArrayList<>();
|
apps = new ArrayList<>();
|
||||||
apps.add(new DeskAppLauncher("Sys Glyph Set", () -> new SystemBaseGlyphApp()));
|
apps.add(new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "Sys Glyph Set", () -> new SystemBaseGlyphApp()));
|
||||||
apps.add(new DeskAppLauncher("Sys Number Parts", () -> new SystemBasePartApp()));
|
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) {
|
public void renderMenu(DeskTopScreen appScreen) {
|
||||||
|
|
|
@ -31,24 +31,24 @@ public class VrSys5Component {
|
||||||
private final DeskAppLauncher imguiLauncher;
|
private final DeskAppLauncher imguiLauncher;
|
||||||
|
|
||||||
public VrSys5Component() {
|
public VrSys5Component() {
|
||||||
basicLauncher = new DeskAppLauncher("Basic Console", () -> new BasicConsoleDeskApp());
|
basicLauncher = new DeskAppLauncher(DeskAppMenuSection.SYSTEM, "Basic Console", () -> new BasicConsoleDeskApp());
|
||||||
unicodeLauncher = new DeskAppLauncher("Base Unicode Plane", () -> new BaseUnicodePlaneDeskApp(localeService));
|
unicodeLauncher = new DeskAppLauncher(DeskAppMenuSection.SYSTEM, "Base Unicode Plane", () -> new BaseUnicodePlaneDeskApp(localeService));
|
||||||
imguiLauncher = new DeskAppLauncher("ImGui Demo", () -> new ImGuiDeskApp());
|
imguiLauncher = new DeskAppLauncher(DeskAppMenuSection.PROGRAMMING, "ImGui Demo", () -> new ImGuiDeskApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Activate
|
@Activate
|
||||||
void open() {
|
void open() {
|
||||||
log.debug(this, SystemGdxLog.ACTIVATE);
|
log.debug(this, SystemGdxLog.ACTIVATE);
|
||||||
deskAppService.installDeskApp(DeskAppMenuSection.SYSTEM, basicLauncher);
|
deskAppService.installDeskApp(basicLauncher);
|
||||||
deskAppService.installDeskApp(DeskAppMenuSection.SYSTEM, unicodeLauncher);
|
deskAppService.installDeskApp(unicodeLauncher);
|
||||||
deskAppService.installDeskApp(DeskAppMenuSection.PROGRAMMING, imguiLauncher);
|
deskAppService.installDeskApp(imguiLauncher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deactivate
|
@Deactivate
|
||||||
void close() {
|
void close() {
|
||||||
log.debug(this, SystemGdxLog.DEACTIVATE);
|
log.debug(this, SystemGdxLog.DEACTIVATE);
|
||||||
deskAppService.removeDeskApp(DeskAppMenuSection.SYSTEM, basicLauncher);
|
deskAppService.removeDeskApp(basicLauncher);
|
||||||
deskAppService.removeDeskApp(DeskAppMenuSection.SYSTEM, unicodeLauncher);
|
deskAppService.removeDeskApp(unicodeLauncher);
|
||||||
deskAppService.removeDeskApp(DeskAppMenuSection.PROGRAMMING, imguiLauncher);
|
deskAppService.removeDeskApp(imguiLauncher);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue