// // (C) COPYRIGHT International Business Machines Corp. 1997 // All Rights Reserved // Licensed Materials - Property of IBM // // US Government Users Restricted Rights - Use, duplication or // disclosure restricted by GSA ADP Schedule Contract with IBM Corp. // /* * $Header: /home/gda/dxcvs/dx/src/ui++/java/dx/net/WRLApplication.java,v 1.1.1.1 1999/03/24 15:17:31 gda Exp $ */ package dx.net; import java.applet.*; import java.util.Vector; import java.net.*; import java.io.InputStream; import java.io.InputStreamReader; import java.lang.*; import java.lang.reflect.*; import netscape.javascript.JSObject; import vrml.external.field.*; import vrml.external.Node; import vrml.external.Browser; import vrml.external.exception.*; public abstract class WRLApplication extends DXLinkApplication implements vrml.external.field.EventOutObserver { private Vector cosmos; private EventOutSFVec3f hitPointEO; private EventOutSFTime touchTimeEO; private EventOutSFVec3f vps_tp = null; private EventOutSFRotation vps_rot = null; private JSObject window; private JSObject parent; private JSObject document; private JSObject frames; protected WRLApplication() { super(); this.vps_tp = null; this.vps_rot = null; this.cosmos = new Vector(4); this.window = null; this.parent = null; this.document = null; this.frames = null; } public void start() { super.start(); if (this.window == null) { this.window = (JSObject)JSObject.getWindow(this); this.parent = (JSObject)window.getMember("parent"); this.document = (JSObject)window.getMember("document"); this.frames = (JSObject)parent.getMember("frames"); } } public void showWorld(String name, String path, int id) { this.locateWorlds(); URL url = null; try { url = new URL(getCodeBase(), path); } catch (MalformedURLException mue) { System.out.println ("WRLApplication: cannot create url from " + path); } boolean success = false; InputStream is = null; try { Browser cosmo = (Browser)this.cosmos.elementAt(id); // // If you ever want to know for absolute sure, what methods // are supported in your implementation of a vrml browser, // then enable this code. // /* Class cclass = cosmo.getClass(); Method[] meds = cclass.getMethods(); int mlen = meds.length; int i; for (i=0; i