home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 June / CHIPHEFT062001.ISO / browser / nc32lyc / comm.z / java40.jar / netscape / applet / DerivedAppletFrame$LoadAppletEvent.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-08-15  |  5.0 KB  |  114 lines

  1. package netscape.applet;
  2.  
  3. import java.applet.Applet;
  4.  
  5. class DerivedAppletFrame$LoadAppletEvent extends DerivedAppletFrame.AppletEvent {
  6.    // $FF: synthetic field
  7.    private final DerivedAppletFrame this$DerivedAppletFrame;
  8.    DerivedAppletFrame m_appletFrame;
  9.  
  10.    DerivedAppletFrame$LoadAppletEvent(DerivedAppletFrame var1, DerivedAppletFrame var2) {
  11.       super(var1);
  12.       this.this$DerivedAppletFrame = var1;
  13.       this.this$DerivedAppletFrame = var1;
  14.       this.m_appletFrame = var2;
  15.    }
  16.  
  17.    public void dispatch() {
  18.       String var1 = null;
  19.       if (this.this$DerivedAppletFrame.getParameter("mayscript") != null) {
  20.          var1 = this.this$DerivedAppletFrame.documentURL.toString();
  21.       }
  22.  
  23.       this.this$DerivedAppletFrame.classLoader = AppletClassLoader.getClassLoader(this.this$DerivedAppletFrame.context, this.this$DerivedAppletFrame.codebaseURL, this.this$DerivedAppletFrame.archiveURL, var1, this.this$DerivedAppletFrame.reloadClasses);
  24.       Object var2 = this.this$DerivedAppletFrame.m_statusLock;
  25.       synchronized(var2){}
  26.  
  27.       try {
  28.          if (this.this$DerivedAppletFrame.status != 1) {
  29.             this.this$DerivedAppletFrame.wrongState("can't load", this.this$DerivedAppletFrame.statusToString(this.this$DerivedAppletFrame.status));
  30.             this.this$DerivedAppletFrame.handler.stopDispatching();
  31.             return;
  32.          }
  33.       } catch (Throwable var31) {
  34.          throw var31;
  35.       }
  36.  
  37.       String var32 = this.this$DerivedAppletFrame.getParameter("code");
  38.       if (var32.endsWith(".class")) {
  39.          var32 = var32.substring(0, var32.length() - 6);
  40.       }
  41.  
  42.       if (var32.endsWith(".java")) {
  43.          var32 = var32.substring(0, var32.length() - 5);
  44.       }
  45.  
  46.       var32 = var32.replace('/', '.');
  47.  
  48.       try {
  49.          Class var3 = Class.forName("java.applet.Applet");
  50.          Class var4 = this.this$DerivedAppletFrame.classLoader.loadClass(var32);
  51.          if (var4 == null) {
  52.             throw new ClassNotFoundException(var4.toString() + " could not be loaded");
  53.          }
  54.  
  55.          if (!var3.isAssignableFrom(var4)) {
  56.             throw new ClassCastException(var32 + " is not an applet");
  57.          }
  58.  
  59.          this.this$DerivedAppletFrame.applet = (Applet)var4.newInstance();
  60.       } catch (VerifyError var24) {
  61.          this.this$DerivedAppletFrame.showAppletException(var24, "class " + ((Throwable)var24).getMessage() + " got a security violation: method verification error");
  62.          this.this$DerivedAppletFrame.status = 0;
  63.          this.this$DerivedAppletFrame.handler.stopDispatching();
  64.          return;
  65.       } catch (SecurityException var25) {
  66.          this.this$DerivedAppletFrame.showAppletException(var25, "class " + var32 + " got a security violation: " + ((Throwable)var25).getMessage());
  67.          this.this$DerivedAppletFrame.status = 0;
  68.          this.this$DerivedAppletFrame.handler.stopDispatching();
  69.          return;
  70.       } catch (ClassNotFoundException var26) {
  71.          this.this$DerivedAppletFrame.showAppletException(var26, "class " + var32 + " could not be loaded");
  72.          this.this$DerivedAppletFrame.status = 0;
  73.          this.this$DerivedAppletFrame.handler.stopDispatching();
  74.          return;
  75.       } catch (InstantiationException var27) {
  76.          this.this$DerivedAppletFrame.showAppletException(var27, "class " + var32 + " can't be instantiated");
  77.          this.this$DerivedAppletFrame.status = 0;
  78.          this.this$DerivedAppletFrame.handler.stopDispatching();
  79.          return;
  80.       } catch (IllegalAccessException var28) {
  81.          System.err.println("# class " + var32 + " is not public or has no public constructor");
  82.          this.this$DerivedAppletFrame.status = 0;
  83.          this.this$DerivedAppletFrame.handler.stopDispatching();
  84.          return;
  85.       } catch (Exception var29) {
  86.          this.this$DerivedAppletFrame.showAppletException(var29, "exception: " + ((Throwable)var29).toString());
  87.          this.this$DerivedAppletFrame.status = 0;
  88.          this.this$DerivedAppletFrame.handler.stopDispatching();
  89.          return;
  90.       } catch (Error var30) {
  91.          this.this$DerivedAppletFrame.showAppletException(var30, "error: " + ((Throwable)var30).toString());
  92.          this.this$DerivedAppletFrame.status = 0;
  93.          this.this$DerivedAppletFrame.handler.stopDispatching();
  94.          return;
  95.       }
  96.  
  97.       this.this$DerivedAppletFrame.applet.setStub(this.m_appletFrame);
  98.       this.this$DerivedAppletFrame.applet.hide();
  99.       this.this$DerivedAppletFrame.add("Center", this.this$DerivedAppletFrame.applet);
  100.       this.this$DerivedAppletFrame.validate();
  101.       Object var34 = this.this$DerivedAppletFrame.m_statusLock;
  102.       synchronized(var34){}
  103.  
  104.       try {
  105.          this.this$DerivedAppletFrame.status = 2;
  106.          this.this$DerivedAppletFrame.rightState("loaded");
  107.          this.this$DerivedAppletFrame.m_statusLock.notifyAll();
  108.       } catch (Throwable var23) {
  109.          throw var23;
  110.       }
  111.  
  112.    }
  113. }
  114.