diff options
| author | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
| commit | e1e781bb2135ef78592226f1a3eaba4925702f1f (patch) | |
| tree | 8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/scape/WebWallControlAction.java | |
| download | worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip | |
Diffstat (limited to 'NET/worlds/scape/WebWallControlAction.java')
| -rw-r--r-- | NET/worlds/scape/WebWallControlAction.java | 180 |
1 files changed, 180 insertions, 0 deletions
diff --git a/NET/worlds/scape/WebWallControlAction.java b/NET/worlds/scape/WebWallControlAction.java new file mode 100644 index 0000000..dac9611 --- /dev/null +++ b/NET/worlds/scape/WebWallControlAction.java @@ -0,0 +1,180 @@ +/* */ package NET.worlds.scape; +/* */ +/* */ import NET.worlds.console.WebControlImp; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class WebWallControlAction +/* */ extends Action +/* */ { +/* */ WebWallControlAction() +/* */ { +/* 16 */ this.mode = 1; +/* 17 */ this.webWall = null; +/* 18 */ this.postData = null; +/* 19 */ this.url = "http://www.worlds.com/"; +/* */ } +/* */ +/* */ +/* 23 */ private final int reload = 1; +/* 24 */ private final int setURL = 2; +/* 25 */ private final int refresh = 3; +/* 26 */ private final int back = 4; +/* 27 */ private final int forward = 5; +/* 28 */ private final int stop = 6; +/* 29 */ private final int home = 7; +/* */ private int mode; +/* */ private String url; +/* */ private String postData; +/* */ private WebPageWall webWall; +/* */ +/* */ public Persister trigger(Event e, Persister seqID) { +/* 36 */ if (!getWebWall()) +/* */ { +/* 38 */ System.out.println("ERROR! Tried to attach WebWallControlAction to something other than a WebWall object."); +/* */ +/* 40 */ return null; +/* */ } +/* */ +/* 43 */ switch (this.mode) +/* */ { +/* */ case 1: +/* 46 */ this.webWall.rebuild(); +/* 47 */ break; +/* */ +/* */ case 2: +/* 50 */ this.webWall.getWebControlImp().setURL(this.url, this.postData); +/* 51 */ break; +/* */ +/* */ case 3: +/* 54 */ this.webWall.getWebControlImp().refresh(); +/* 55 */ break; +/* */ +/* */ case 4: +/* 58 */ this.webWall.getWebControlImp().goBack(); +/* 59 */ break; +/* */ +/* */ case 5: +/* 62 */ this.webWall.getWebControlImp().goForward(); +/* 63 */ break; +/* */ +/* */ case 6: +/* 66 */ this.webWall.getWebControlImp().stop(); +/* 67 */ break; +/* */ +/* */ case 7: +/* 70 */ this.webWall.getWebControlImp().home(); +/* */ } +/* */ +/* */ +/* 74 */ return null; +/* */ } +/* */ +/* */ +/* */ private boolean getWebWall() +/* */ { +/* 80 */ if (this.webWall != null) { +/* 81 */ return true; +/* */ } +/* */ +/* */ +/* 85 */ Object owner = getOwner(); +/* 86 */ if ((owner == null) || (!(owner instanceof WebPageWall))) { +/* 87 */ return false; +/* */ } +/* 89 */ this.webWall = ((WebPageWall)owner); +/* */ +/* 91 */ if (this.webWall == null) +/* */ { +/* 93 */ return false; +/* */ } +/* */ +/* 96 */ if (this.webWall.getWebControlImp() == null) { +/* 97 */ return false; +/* */ } +/* 99 */ return true; +/* */ } +/* */ +/* */ +/* */ +/* 104 */ private static Object classCookie = new Object(); +/* */ +/* */ public void saveState(Saver s) throws IOException +/* */ { +/* 108 */ s.saveVersion(0, classCookie); +/* 109 */ super.saveState(s); +/* 110 */ s.saveInt(this.mode); +/* 111 */ s.saveString(this.url); +/* 112 */ s.saveString(this.postData); +/* */ } +/* */ +/* */ public void restoreState(Restorer r) throws IOException, TooNewException +/* */ { +/* 117 */ switch (r.restoreVersion(classCookie)) +/* */ { +/* */ case 0: +/* 120 */ super.restoreState(r); +/* 121 */ this.mode = r.restoreInt(); +/* 122 */ this.url = r.restoreString(); +/* 123 */ this.postData = r.restoreString(); +/* */ } +/* */ +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public Object properties(int index, int offset, int pmode, Object value) +/* */ throws NoSuchPropertyException +/* */ { +/* 134 */ Object ret = null; +/* 135 */ switch (index - offset) { +/* */ case 0: +/* 137 */ if (pmode == 0) { +/* 138 */ ret = IntegerPropertyEditor.make( +/* 139 */ new Property(this, index, "1=Reload, 2=SetURL, 3=Refresh, 4=Back, 5=Fwd, 6=Stop, 7=Home")); +/* */ } +/* 141 */ else if (pmode == 1) { +/* 142 */ ret = new Integer(this.mode); +/* 143 */ } else if (pmode == 2) +/* 144 */ this.mode = ((Integer)value).intValue(); +/* 145 */ break; +/* */ +/* */ case 1: +/* 148 */ if (pmode == 0) { +/* 149 */ ret = StringPropertyEditor.make(new Property(this, +/* 150 */ index, +/* 151 */ "URL for mode 2")); +/* 152 */ } else if (pmode == 1) { +/* 153 */ ret = this.url; +/* 154 */ } else if (pmode == 2) +/* 155 */ this.url = ((String)value).trim(); +/* 156 */ break; +/* */ +/* */ case 2: +/* 159 */ if (pmode == 0) { +/* 160 */ ret = StringPropertyEditor.make(new Property(this, +/* 161 */ index, +/* 162 */ "POST data for mode 2")); +/* 163 */ } else if (pmode == 1) { +/* 164 */ ret = this.postData; +/* 165 */ } else if (pmode == 2) +/* 166 */ this.postData = ((String)value).trim(); +/* 167 */ break; +/* */ +/* */ default: +/* 170 */ ret = super.properties(index, offset + 3, pmode, value); +/* */ } +/* 172 */ return ret; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\WebWallControlAction.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |