summaryrefslogtreecommitdiff
path: root/NET/worlds/console/WebControl.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-12 22:33:32 -0800
committerFuwn <[email protected]>2026-02-12 22:33:32 -0800
commitc7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch)
treedf9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/console/WebControl.java
downloadworldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz
worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip
Initial commit
Diffstat (limited to 'NET/worlds/console/WebControl.java')
-rw-r--r--NET/worlds/console/WebControl.java91
1 files changed, 91 insertions, 0 deletions
diff --git a/NET/worlds/console/WebControl.java b/NET/worlds/console/WebControl.java
new file mode 100644
index 0000000..588c453
--- /dev/null
+++ b/NET/worlds/console/WebControl.java
@@ -0,0 +1,91 @@
+package NET.worlds.console;
+
+public class WebControl extends RenderCanvasOverlay {
+ private final int ID_GO_BACK = 32768;
+ private final int ID_GO_FORWARD = 32769;
+ private final int ID_VIEW_STOP = 32770;
+ private final int ID_VIEW_REFRESH = 32771;
+ private final int ID_GO_HOME = 32772;
+ private final int ID_EXIT = 32773;
+ private WebControlImp imp = null;
+
+ public WebControl(RenderCanvas pCanvas, boolean hasToolbar) throws NoWebControlException {
+ super(pCanvas);
+
+ try {
+ this.imp = WebControlFactory.createWebControlImp(this.getNativeWindowHandle(), hasToolbar, false);
+ } catch (NoWebControlException var4) {
+ super.detach();
+ throw var4;
+ }
+ }
+
+ public WebControl(RenderCanvas pCanvas, int xPer, int yPer, boolean hasToolbar, boolean isFixedSize, boolean isBanner) throws NoWebControlException {
+ super(pCanvas, xPer, yPer, isFixedSize, !isBanner);
+ this.imp = WebControlFactory.createWebControlImp(this.getNativeWindowHandle(), hasToolbar, isBanner);
+ }
+
+ public boolean setURL(String pURL) {
+ if (this.imp == null) {
+ System.out.println("Null implementation in WebControl.setURL");
+ return false;
+ } else {
+ return this.imp.setURL(pURL);
+ }
+ }
+
+ public boolean setURL(String pURL, String pPostData) {
+ if (this.imp == null) {
+ System.out.println("Null implementation in WebControl.setURL");
+ return false;
+ } else {
+ return pPostData != null && !pPostData.equals("") ? this.imp.setURL(pURL, pPostData) : this.imp.setURL(pURL);
+ }
+ }
+
+ @Override
+ protected void handleCommand(int commandID) {
+ if (this.imp == null) {
+ System.out.println("Now this should be impossible. Null imp in WebControl.handleCommand.");
+ } else {
+ switch (commandID) {
+ case 32768:
+ this.imp.goBack();
+ break;
+ case 32769:
+ this.imp.goForward();
+ break;
+ case 32770:
+ this.imp.stop();
+ break;
+ case 32771:
+ this.imp.refresh();
+ break;
+ case 32772:
+ this.imp.home();
+ break;
+ case 32773:
+ this.detach();
+ }
+ }
+ }
+
+ @Override
+ void detach() {
+ if (this.imp != null) {
+ this.imp.detach();
+ }
+
+ super.detach();
+ }
+
+ @Override
+ void canvasResized(int parentX, int parentY) {
+ super.canvasResized(parentX, parentY);
+ if (this.imp == null) {
+ System.out.println("Null imp in WebControl.canvasResized");
+ } else {
+ this.imp.resize(parentX, parentY, this.getXPercent(), this.getYPercent());
+ }
+ }
+}