From e1e781bb2135ef78592226f1a3eaba4925702f1f Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 3 May 2021 16:38:41 -0700 Subject: :star: --- NET/worlds/scape/OpenURLAction.java | 174 ++++++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 NET/worlds/scape/OpenURLAction.java (limited to 'NET/worlds/scape/OpenURLAction.java') diff --git a/NET/worlds/scape/OpenURLAction.java b/NET/worlds/scape/OpenURLAction.java new file mode 100644 index 0000000..6b58e33 --- /dev/null +++ b/NET/worlds/scape/OpenURLAction.java @@ -0,0 +1,174 @@ +/* */ package NET.worlds.scape; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.console.DefaultConsole; +/* */ import NET.worlds.console.NoWebControlException; +/* */ import NET.worlds.console.WebControl; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class OpenURLAction +/* */ extends Action +/* */ { +/* 29 */ String targetURL = "http://www.worlds.com"; +/* 30 */ int xPercent = 100; +/* 31 */ int yPercent = 100; +/* 32 */ boolean hasToolbar = true; +/* 33 */ boolean isFixed = false; +/* */ +/* */ +/* */ +/* */ public Persister trigger(Event e, Persister seqID) +/* */ { +/* 39 */ if (seqID != null) +/* */ { +/* */ +/* 42 */ return seqID; +/* */ } +/* */ +/* 45 */ Console c = Console.getActive(); +/* 46 */ if ((c != null) && ((c instanceof DefaultConsole))) +/* */ { +/* 48 */ System.out.println("Opening up a URL now."); +/* */ +/* 50 */ DefaultConsole dc = (DefaultConsole)c; +/* */ try { +/* 52 */ WebControl wc = new WebControl(dc.getRender(), +/* 53 */ this.xPercent, this.yPercent, this.hasToolbar, this.isFixed, +/* 54 */ false); +/* 55 */ wc.activate(); +/* 56 */ wc.setURL(this.targetURL); +/* */ } +/* */ catch (NoWebControlException localNoWebControlException) {} +/* */ +/* */ +/* */ +/* */ +/* 63 */ seqID = new SuperRoot(); +/* 64 */ return this; +/* */ } +/* */ +/* */ +/* */ +/* 69 */ return null; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public Object properties(int index, int offset, int mode, Object value) +/* */ throws NoSuchPropertyException +/* */ { +/* 79 */ Object ret = null; +/* 80 */ switch (index - offset) { +/* */ case 0: +/* 82 */ if (mode == 0) { +/* 83 */ ret = StringPropertyEditor.make( +/* 84 */ new Property(this, index, "Target URL")); +/* 85 */ } else if (mode == 1) { +/* 86 */ ret = this.targetURL; +/* 87 */ } else if (mode == 2) +/* 88 */ this.targetURL = ((String)value); +/* 89 */ break; +/* */ case 1: +/* 91 */ if (mode == 0) { +/* 92 */ ret = IntegerPropertyEditor.make( +/* 93 */ new Property(this, index, "X Overlay % or Width"), +/* 94 */ 0, 1024); +/* 95 */ } else if (mode == 1) { +/* 96 */ ret = new Integer(this.xPercent); +/* 97 */ } else if (mode == 2) +/* 98 */ this.xPercent = ((Integer)value).intValue(); +/* 99 */ break; +/* */ case 2: +/* 101 */ if (mode == 0) { +/* 102 */ ret = IntegerPropertyEditor.make( +/* 103 */ new Property(this, index, "Y Overlay % or Height"), +/* 104 */ 0, 1024); +/* 105 */ } else if (mode == 1) { +/* 106 */ ret = new Integer(this.yPercent); +/* 107 */ } else if (mode == 2) +/* 108 */ this.yPercent = ((Integer)value).intValue(); +/* 109 */ break; +/* */ case 3: +/* 111 */ if (mode == 0) { +/* 112 */ ret = BooleanPropertyEditor.make( +/* 113 */ new Property(this, index, "Has Toolbar"), +/* 114 */ "No", "Yes"); +/* 115 */ } else if (mode == 1) { +/* 116 */ ret = new Boolean(this.hasToolbar); +/* 117 */ } else if (mode == 2) +/* 118 */ this.hasToolbar = ((Boolean)value).booleanValue(); +/* 119 */ break; +/* */ case 4: +/* 121 */ if (mode == 0) { +/* 122 */ ret = BooleanPropertyEditor.make( +/* 123 */ new Property(this, index, "Fixed size"), +/* 124 */ "No - Percentage specified", "Yes - Pixels specified"); +/* 125 */ } else if (mode == 1) { +/* 126 */ ret = new Boolean(this.isFixed); +/* 127 */ } else if (mode == 2) +/* 128 */ this.isFixed = ((Boolean)value).booleanValue(); +/* 129 */ break; +/* */ default: +/* 131 */ ret = super.properties(index, offset + 4, mode, value); +/* */ } +/* */ +/* 134 */ return ret; +/* */ } +/* */ +/* */ +/* 138 */ private static Object classCookie = new Object(); +/* */ +/* */ public void saveState(Saver s) throws IOException +/* */ { +/* 142 */ s.saveVersion(0, classCookie); +/* 143 */ super.saveState(s); +/* */ +/* 145 */ s.saveString(this.targetURL); +/* 146 */ s.saveInt(this.xPercent); +/* 147 */ s.saveInt(this.yPercent); +/* 148 */ s.saveBoolean(this.hasToolbar); +/* 149 */ s.saveBoolean(this.isFixed); +/* */ } +/* */ +/* */ public void restoreState(Restorer r) throws IOException, TooNewException +/* */ { +/* 154 */ switch (r.restoreVersion(classCookie)) { +/* */ case 0: +/* 156 */ super.restoreState(r); +/* 157 */ this.targetURL = r.restoreString(); +/* 158 */ this.xPercent = r.restoreInt(); +/* 159 */ this.yPercent = r.restoreInt(); +/* 160 */ this.hasToolbar = r.restoreBoolean(); +/* 161 */ this.isFixed = r.restoreBoolean(); +/* 162 */ break; +/* */ +/* */ default: +/* 165 */ throw new TooNewException(); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\OpenURLAction.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */ \ No newline at end of file -- cgit v1.2.3