home *** CD-ROM | disk | FTP | other *** search
- import stardiv.tools.HoldJavaEnvironment;
-
- public class JScriptWindowObject extends JScriptFrameObject {
- private static final int WINDOW_ID_DEFAULTSTATUS = 273;
- private static final int WINDOW_ID_STATUS = 274;
- private static final int WINDOW_ID_BLUR = 275;
- private static final int WINDOW_ID_FOCUS = 276;
- private static final int WINDOW_ID_SCROLL = 277;
- private static final int WINDOW_ID_LOCATION = 278;
- private static final int WINDOW_ID_OPENER = 279;
- private static final int WINDOW_ID_NAVIGATOR = 280;
- private static final int WINDOW_ID_ONLOAD = 281;
- private static final int WINDOW_ID_ONUNLOAD = 282;
- private static final int WINDOW_ID_ONERROR = 283;
- private static final int WINDOW_ID_HISTORY = 284;
- private static final int WINDOW_ID_PROTOCOL = 301;
- private JScriptFrameObject aOpener;
-
- public final void SetOpener(JScriptFrameObject var1) {
- this.aOpener = var1;
- }
-
- public final JScriptFrameObject GetOpener() {
- return this.aOpener;
- }
-
- public void ClearGlobalVariables() {
- super.aNameArray = null;
- super.aHistoryArray = null;
- super.aIndexArray = null;
- this.InitAllProps();
-
- try {
- ((JScriptFrameObject)this).StopAllJavaScripts();
- } catch (UnsatisfiedLinkError var1) {
- }
- }
-
- public String GetName() {
- return "window";
- }
-
- public JScriptWindowObject(long var1) {
- super(var1);
- this.SetOpener((JScriptFrameObject)null);
- this.InitWinProps();
- }
-
- protected void InitAllProps() {
- if (super.aConstructorHandle != null) {
- super.aConstructorHandle.CreateObjectProperties(this);
- }
-
- ((JScriptFrameObject)this).InitFrameProps();
- this.InitWinProps();
- }
-
- private void InitWinProps() {
- try {
- ((JSbxObject)this).Put(new JSbxObjectProperty("defaultStatus", this, this, 273, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("status", this, this, 274, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("opener", this, this, 279, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("location", this, this, 278, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("navigator", this, this, 280, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("history", this, this, 284, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("onload", this, this, 281, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("onunload", this, this, 282, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("onerror", this, this, 283, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("blur", this, this, 275, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("focus", this, this, 276, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("scroll", this, this, 277, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("_protocol", this, this, 301, true, true));
- } catch (JSbxException var2) {
- HoldJavaEnvironment.AddToProtocol("Exception in JScriptWindowObject()-Ctor " + var2 + " ");
- }
-
- JavaScriptWrapperObject.InitStdObjects(this);
- }
-
- public JSbxValue PropertyCallFunction(JSbxObjectProperty var1, JScriptCallParam var2) throws JSbxExceptionBase {
- JSbxVector var3 = var2.GetParamVector();
- int var4 = var3 != null ? var3.GetSize() : 0;
- int var5 = var1.GetID();
- String var6 = "";
- double var7 = (double)0.0F;
- boolean var9 = false;
- boolean var10 = true;
-
- try {
- switch (var5) {
- case 275:
- this.blur();
- break;
- case 276:
- this.focus();
- break;
- case 277:
- if (var4 > 1) {
- this.scroll((int)GetDoubleParam(var3, 0), (int)GetDoubleParam(var3, 1));
- }
- break;
- case 301:
- if (var4 > 0) {
- HoldJavaEnvironment.AddToProtocol("_protocol()=" + GetStringParam(var3, 0));
- }
- break;
- default:
- return super.PropertyCallFunction(var1, var2);
- }
- } catch (UnsatisfiedLinkError var12) {
- }
-
- Object var11 = null;
- JSbxValue var13;
- if (var10) {
- var13 = new JSbxValue();
- } else if (var9) {
- var13 = new JSbxValue(var7);
- } else {
- var13 = new JSbxValue(var6);
- }
-
- var2.GetRuntimeParam().SetReturnValue(var13);
- return var13;
- }
-
- public void PropertyGet(JSbxObjectProperty var1, JSbxValue var2) throws JSbxException {
- int var3 = var1.GetID();
- JSbxValue var4 = null;
-
- try {
- switch (var3) {
- case 273:
- var4 = new JSbxValue(this.getDefaultStatus());
- break;
- case 274:
- var4 = new JSbxValue(this.getStatus());
- break;
- case 275:
- case 276:
- case 277:
- default:
- super.PropertyGet(var1, var2);
- return;
- case 278:
- var4 = new JSbxValue(this.getLocation());
- break;
- case 279:
- var4 = new JSbxValue(this.GetOpener());
- break;
- case 280:
- var4 = new JSbxValue(this.getNavigator());
- break;
- case 281:
- var4 = new JSbxValue(this.getOnLoad());
- break;
- case 282:
- var4 = new JSbxValue(this.getOnUnLoad());
- break;
- case 283:
- var4 = new JSbxValue(this.getOnError());
- break;
- case 284:
- var4 = new JSbxValue(this.getHistory());
- }
- } catch (UnsatisfiedLinkError var5) {
- }
-
- if (var4 == null) {
- var4 = new JSbxValue("*** not safe to inspect ***");
- }
-
- var2.Put(var4);
- }
-
- public void PropertyPut(JSbxObjectProperty var1, JSbxValue var2) throws JSbxException {
- int var3 = var1.GetID();
-
- try {
- switch (var3) {
- case 273:
- this.setDefaultStatus(var2.GetString());
- return;
- case 274:
- this.setStatus(var2.GetString());
- return;
- case 278:
- JScriptLocationObject var4 = this.getLocation();
- if (var4 != null) {
- var4.SetHref(var2.GetString());
- return;
- }
- break;
- case 279:
- this.SetOpener((JScriptFrameObject)var2.GetObject());
- return;
- case 281:
- this.setOnLoad(var2.GetString());
- return;
- case 282:
- this.setOnUnLoad(var2.GetString());
- return;
- case 283:
- this.setOnError(var2.GetString());
- return;
- default:
- super.PropertyPut(var1, var2);
- }
-
- } catch (UnsatisfiedLinkError var5) {
- }
- }
-
- public String Property_GetJScript_typeofString(JSbxObjectProperty var1) {
- return "Window";
- }
-
- public String GetJScriptString(boolean var1) {
- return "[object Window]";
- }
-
- protected native String getDefaultStatus();
-
- protected native void setDefaultStatus(String var1);
-
- protected native String getStatus();
-
- protected native void setStatus(String var1);
-
- protected native JScriptLocationObject getLocation();
-
- protected native JScriptNavigatorObject getNavigator();
-
- protected native JScriptHistoryObject getHistory();
-
- protected native void blur();
-
- protected native void focus();
-
- protected native void scroll(int var1, int var2);
-
- protected native String getOnLoad();
-
- protected native void setOnLoad(String var1);
-
- protected native String getOnUnLoad();
-
- protected native void setOnUnLoad(String var1);
-
- protected native String getOnError();
-
- protected native void setOnError(String var1);
-
- public static double GetDoubleParam(JSbxVector var0, int var1) throws JScriptException {
- JSbxValue var2 = (JSbxValue)var0.Get(var1);
- if (var2 == null) {
- var2 = new JSbxValue();
- }
-
- double var3 = (double)0.0F;
-
- try {
- var3 = var2.GetDouble();
- } catch (JSbxException var5) {
- }
-
- return var3;
- }
-
- public static String GetStringParam(JSbxVector var0, int var1) throws JScriptException {
- JSbxValue var2 = (JSbxValue)var0.Get(var1);
- if (var2 == null) {
- var2 = new JSbxValue();
- }
-
- String var3 = "";
-
- try {
- var3 = var2.GetString();
- } catch (JSbxException var4) {
- }
-
- return var3;
- }
-
- public static boolean GetBooleanParam(JSbxVector var0, int var1) throws JScriptException {
- JSbxValue var2 = (JSbxValue)var0.Get(var1);
- if (var2 == null) {
- var2 = new JSbxValue();
- }
-
- boolean var3 = false;
-
- try {
- var3 = var2.GetBool();
- } catch (JSbxException var4) {
- }
-
- return var3;
- }
-
- public static boolean IsParamANumber(JSbxVector var0, int var1) throws JScriptException {
- JSbxValue var2 = (JSbxValue)var0.Get(var1);
- if (var2 != null) {
- return var2.GetType() == 16;
- } else {
- return false;
- }
- }
- }
-