diff options
author | mk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-04-10 20:53:09 +0000 |
---|---|---|
committer | mk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-04-10 20:53:09 +0000 |
commit | 964752c882b129fce53428ebf167b58016e8be4a (patch) | |
tree | 823a7f725307dab4529ba903043377657c5e25c6 | |
parent | b283df94ce138b415c8d82e91fd4e21877df4846 (diff) | |
download | ATCD-964752c882b129fce53428ebf167b58016e8be4a.tar.gz |
Modifications to support having the DOVE Browser as an applet.
-rw-r--r-- | TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.java | 23 | ||||
-rw-r--r-- | TAO/examples/Simulator/DOVEBrowser/DemoCore.java | 4 | ||||
-rw-r--r-- | TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java | 10 |
3 files changed, 23 insertions, 14 deletions
diff --git a/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.java b/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.java index c5165d9d1b7..d1bd7cf4338 100644 --- a/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.java +++ b/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.java @@ -14,16 +14,24 @@ import java.awt.*; -public class DOVEBrowser { //extends java.applet.Applet { +public class DOVEBrowser extends java.applet.Applet { DemoCore demoCore_; + static String nameServiceIOR_ = null; - public DOVEBrowser (String nameServiceIOR) { - super (); - demoCore_ = new DemoCore (nameServiceIOR); + public DOVEBrowser () { + super (); } public void init () { + // in case of an applet use the following line, else not! + nameServiceIOR_ = this.getParameter ("NSIOR"); + + if (nameServiceIOR_ == null) { + System.out.println ("No NameSerivce IOR: Will use Name Service Lookup Protokol."); + } + + demoCore_ = new DemoCore (nameServiceIOR_, this); demoCore_.show (); demoCore_.run (); } @@ -35,13 +43,12 @@ public class DOVEBrowser { //extends java.applet.Applet { public static void main (String[] args) - { - String nameServiceIOR = null; + { if (args[0] == "-ORBnameserviceior") { - nameServiceIOR = args[1]; + nameServiceIOR_ = args[1]; } - DOVEBrowser doveBrowser = new DOVEBrowser (nameServiceIOR); + DOVEBrowser doveBrowser = new DOVEBrowser(); doveBrowser.init (); } } diff --git a/TAO/examples/Simulator/DOVEBrowser/DemoCore.java b/TAO/examples/Simulator/DOVEBrowser/DemoCore.java index 7303d3d7b19..376a0fb6c98 100644 --- a/TAO/examples/Simulator/DOVEBrowser/DemoCore.java +++ b/TAO/examples/Simulator/DOVEBrowser/DemoCore.java @@ -29,7 +29,7 @@ public class DemoCore extends Frame { private GridBagLayout gridbag_; private GridBagConstraints constraints_; - DemoCore (String nameServiceIOR) { + DemoCore (String nameServiceIOR, java.applet.Applet applet) { super (); setSize (600,400); @@ -45,7 +45,7 @@ public class DemoCore extends Frame { // Instantiate the DataHandler and the PushConsumer dataHandler_ = new NavWeapDataHandler (); - pushConsumerFactory_ = new PushConsumerFactory (dataHandler_, nameServiceIOR); + pushConsumerFactory_ = new PushConsumerFactory (dataHandler_, nameServiceIOR, applet); // List of Visualization Components vis_comp_list_ = new java.util.Vector(); diff --git a/TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java b/TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java index c2c2fbda5b2..505e06bb502 100644 --- a/TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java +++ b/TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java @@ -27,20 +27,22 @@ public class PushConsumerFactory { private Weapons weapons_; - public PushConsumerFactory (DataHandler dataHandler, String nameServiceIOR) //, java.applet.Applet applet) + public PushConsumerFactory (DataHandler dataHandler, String nameServiceIOR, java.applet.Applet applet) { try { dataHandler_ = dataHandler; - orb_ = org.omg.CORBA.ORB.init (); // applet, null); + orb_ = org.omg.CORBA.ORB.init (applet, null); boa_ = orb_.BOA_init (); // Get the Naming Service initial reference if (nameServiceIOR == null) { - NS_Resolve ns_resolve_ = new NS_Resolve (); - naming_service_object_ = ns_resolve_.resolve_name_service (orb_); + System.out.println ("Using the lookup protocol!"); + NS_Resolve ns_resolve_ = new NS_Resolve (); + naming_service_object_ = ns_resolve_.resolve_name_service (orb_); } else { + System.out.println ("Using the following IOR: " + nameServiceIOR); naming_service_object_ = orb_.string_to_object (nameServiceIOR); } |