/* */ package NET.worlds.scape; /* */ /* */ import NET.worlds.console.Console; /* */ import NET.worlds.network.URL; /* */ import java.io.IOException; /* */ import java.text.MessageFormat; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class sendURL /* */ extends TriggeredSwitchableBehavior /* */ implements MouseDownHandler, BumpHandler, FrameHandler /* */ { /* */ protected String browser; /* */ protected String destination; /* */ protected boolean silentURL; /* */ protected boolean initialized; /* */ /* */ public sendURL() /* */ { /* 37 */ this.initialized = false; /* 38 */ this.trigger = new String("none"); /* 39 */ this.externalTriggerTag = new String(""); /* 40 */ this.silentURL = false; /* 41 */ this.browser = new String("NETSCAPE"); /* 42 */ this.destination = new String("http://www.worlds.net"); /* */ } /* */ /* */ public static native int init(String paramString); /* */ /* */ public static native int get(String paramString); /* */ /* */ public static native int silent_get(String paramString); /* */ /* */ public void ExternalTrigger(Trigger source, int seqno, int eventno) { /* 52 */ sendURLStart(); /* */ } /* */ /* */ /* */ public void sendURLStart() /* */ { /* 58 */ if (this.silentURL) { /* 59 */ silent_get(this.destination); /* */ } else { /* 61 */ get(this.destination); /* */ } /* */ } /* */ /* */ public boolean handle(FrameEvent e) /* */ { /* 67 */ if (!this.initialized) { /* 68 */ init(this.browser); /* 69 */ this.initialized = true; /* */ } /* 71 */ return true; /* */ } /* */ /* */ /* */ public boolean handle(MouseDownEvent e) /* */ { /* 77 */ if ((this.enabled) && /* 78 */ (this.trigger.equals("click"))) { /* 79 */ sendURLStart(); /* */ } /* */ /* 82 */ return true; /* */ } /* */ /* */ public boolean handle(BumpEventTemp e) /* */ { /* 87 */ if ((this.enabled) && /* 88 */ (this.trigger.equals("bump"))) { /* 89 */ sendURLStart(); /* */ } /* */ /* 92 */ return true; /* */ } /* */ /* */ /* */ /* */ /* */ public Object properties(int index, int offset, int mode, Object value) /* */ throws NoSuchPropertyException /* */ { /* 101 */ Object ret = null; /* 102 */ switch (index - offset) { /* */ case 0: /* 104 */ if (mode == 0) { /* 105 */ ret = StringPropertyEditor.make( /* 106 */ new Property(this, index, "Trigger")); /* 107 */ } else if (mode == 1) { /* 108 */ ret = new String(this.trigger); /* 109 */ } else if (mode == 2) { /* 110 */ this.trigger = ((String)value).toString().trim(); /* 111 */ if (this.trigger.equals("external")) { /* 112 */ Trigger.TriggeredSwitchableBehaviorList[ /* 113 */ Trigger.TriggeredSwitchableBehaviorListCount] = this; /* 114 */ Trigger.TriggeredSwitchableBehaviorListCount += 1; /* */ } /* */ } /* */ /* 118 */ break; /* */ case 1: /* 120 */ if (mode == 0) { /* 121 */ ret = StringPropertyEditor.make( /* 122 */ new Property(this, index, "External Trigger Tag")); /* 123 */ } else if (mode == 1) { /* 124 */ ret = new String(this.externalTriggerTag); /* 125 */ } else if (mode == 2) { /* 126 */ this.externalTriggerTag = ((String)value).toString().trim(); /* */ } /* 128 */ break; /* */ case 2: /* 130 */ if (mode == 0) { /* 131 */ ret = BooleanPropertyEditor.make( /* 132 */ new Property(this, index, "Silent URL"), /* 133 */ "No", "Yes"); /* 134 */ } else if (mode == 1) { /* 135 */ ret = new Boolean(this.silentURL); /* 136 */ } else if (mode == 2) /* 137 */ this.silentURL = ((Boolean)value).booleanValue(); /* 138 */ break; /* */ case 3: /* 140 */ if (mode == 0) { /* 141 */ ret = StringPropertyEditor.make( /* 142 */ new Property(this, index, "Destination")); /* 143 */ } else if (mode == 1) { /* 144 */ ret = new String(this.destination); /* 145 */ } else if (mode == 2) { /* 146 */ this.destination = ((String)value).toString().trim(); /* */ } /* 148 */ break; /* */ default: /* 150 */ ret = super.properties(index, offset + 4, mode, value); /* */ } /* 152 */ return ret; /* */ } /* */ /* */ public String toString() /* */ { /* 157 */ return /* */ /* 159 */ super.toString() + "[enabled " + this.enabled + ", trigger " + this.trigger + ", externalTriggerTag " + this.externalTriggerTag + "]"; /* */ } /* */ /* */ public void saveState(Saver s) /* */ throws IOException /* */ { /* 165 */ Object[] arguments = { new String(getName()) }; /* 166 */ Console.println(MessageFormat.format( /* 167 */ Console.message("sendURL-obs"), arguments)); /* 168 */ s.saveString(this.trigger); /* 169 */ s.saveString(this.externalTriggerTag); /* 170 */ s.saveBoolean(this.silentURL); /* 171 */ s.saveString(this.destination); /* */ } /* */ /* */ public void restoreState(Restorer r) /* */ throws IOException /* */ { /* 177 */ this.trigger = r.restoreString(); /* 178 */ this.externalTriggerTag = r.restoreString(); /* 179 */ this.silentURL = r.restoreBoolean(); /* 180 */ this.destination = r.restoreString(); /* 181 */ if (this.trigger.equals("external")) { /* 182 */ Object[] arguments = { new String(getName()) }; /* 183 */ Console.println(MessageFormat.format( /* 184 */ Console.message("sendURL-obs"), arguments)); /* 185 */ Trigger.TriggeredSwitchableBehaviorList[ /* 186 */ Trigger.TriggeredSwitchableBehaviorListCount] = this; /* 187 */ Trigger.TriggeredSwitchableBehaviorListCount += 1; /* */ } /* */ else { /* 190 */ SendURLAction sua = new SendURLAction(); /* 191 */ if (this.destination != null) /* 192 */ sua.setDestination(URL.make(this.destination)); /* 193 */ sua.setTrigger(this.trigger); /* 194 */ r.replace(this, sua); /* */ } /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\sendURL.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */