home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2004 May / DPPCPRO0504.ISO / May / Seatools / SeaTools.iso / tools / en / webhelp / webhelp.jar / WebHelp.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-04-17  |  12.8 KB  |  791 lines

  1. import BsscXML.BsscXML;
  2. import XMLConsumer.Consumer;
  3. import XMLConsumer.Project;
  4. import hhapplet.BsscHelpCommandAdapter;
  5. import hhapplet.BsscHelpRedirector;
  6. import hhapplet.ButtonPushEvent;
  7. import hhapplet.ButtonPushEventListener;
  8. import hhapplet.CanvasButton;
  9. import hhapplet.FtsView;
  10. import hhapplet.FtsViewSkin;
  11. import hhapplet.GloViewSkin;
  12. import hhapplet.GlossaryView;
  13. import hhapplet.ImageCache;
  14. import hhapplet.IndexView;
  15. import hhapplet.IndexViewSkin;
  16. import hhapplet.PaneSetting;
  17. import hhapplet.ResourceLib;
  18. import hhapplet.TabButton;
  19. import hhapplet.TabManagerAdaper;
  20. import hhapplet.TabPanel;
  21. import hhapplet.TocView;
  22. import hhapplet.TocViewSkin;
  23. import hhapplet.URLFileHandler;
  24. import java.applet.Applet;
  25. import java.awt.BorderLayout;
  26. import java.awt.CardLayout;
  27. import java.awt.Color;
  28. import java.awt.Component;
  29. import java.awt.Container;
  30. import java.awt.Event;
  31. import java.awt.Graphics;
  32. import java.awt.LayoutManager;
  33. import java.awt.Panel;
  34. import java.awt.Rectangle;
  35. import java.net.URL;
  36. import java.util.Enumeration;
  37. import java.util.Vector;
  38. import netscape.javascript.JSObject;
  39.  
  40. public class WebHelp extends Applet implements ButtonPushEventListener, BsscHelpCommandAdapter, TabManagerAdaper, Runnable {
  41.    private static final String STR_APPLET_ID = "WebHelp Applet Version 5.00.000";
  42.    private static final String STR_COPYRIGHT = "Copyright (c) 1998-2001 eHelp Corporation. All rights reserved.";
  43.    private boolean m_bShowTab = true;
  44.    private String m_strProjectFile = null;
  45.    private TocView m_tocView = null;
  46.    private IndexView m_indexView = null;
  47.    private FtsView m_ftsView = null;
  48.    private GlossaryView m_gloView = null;
  49.    private Panel m_pnlNav = null;
  50.    private TabPanel m_pnlTabs = null;
  51.    private CardLayout m_clLayout = null;
  52.    private TabButton[] m_abtns;
  53.    private CommandBuffer m_commandBuffer;
  54.    private String m_sLangId = "";
  55.    private boolean m_bMustHaveSize = false;
  56.    boolean m_bCanAccessJSObject = false;
  57.    private boolean m_bCanAccessJSObjectChecked = false;
  58.    private Thread m_CommandThread = null;
  59.    private Vector m_vProjects;
  60.    private PaneSetting m_tocPaneSetting;
  61.    private PaneSetting m_idxPaneSetting;
  62.    private PaneSetting m_ftsPaneSetting;
  63.    private PaneSetting m_gloPaneSetting;
  64.    private int m_nFirstPane;
  65.    private static final int m_nMaxPanes = 4;
  66.  
  67.    public void stop() {
  68.       System.out.println("!!!Applet Stop!!!");
  69.       if (System.getProperty("java.vendor").indexOf("Netscape") != -1 && this.CanQueryHeighAndWidthForNS()) {
  70.          try {
  71.             JSObject var1 = JSObject.getWindow(this);
  72.             var1.setMember("gbLoading", "Phase1");
  73.          } catch (Exception var3) {
  74.             ((Throwable)var3).printStackTrace();
  75.          }
  76.       }
  77.  
  78.       try {
  79.          if (this.m_CommandThread != null) {
  80.             new WhCommand("Quit", (String)null, (String)null);
  81.             this.m_CommandThread.stop();
  82.          }
  83.  
  84.          System.gc();
  85.          Runtime.getRuntime().gc();
  86.       } catch (Exception var2) {
  87.          ((Throwable)var2).printStackTrace();
  88.       }
  89.    }
  90.  
  91.    public boolean gotFocus(Event var1, Object var2) {
  92.       ((Component)this).nextFocus();
  93.       return true;
  94.    }
  95.  
  96.    public void notifyButtonPushEvent(ButtonPushEvent var1) {
  97.       if (this.m_tocPaneSetting != null && var1.getSource() == this.m_abtns[this.m_tocPaneSetting.getIndex()]) {
  98.          this.DoContents();
  99.       } else if (this.m_idxPaneSetting != null && var1.getSource() == this.m_abtns[this.m_idxPaneSetting.getIndex()]) {
  100.          this.DoIndex();
  101.       } else if (this.m_ftsPaneSetting != null && var1.getSource() == this.m_abtns[this.m_ftsPaneSetting.getIndex()]) {
  102.          this.DoSearch("");
  103.       } else {
  104.          if (this.m_gloPaneSetting != null && var1.getSource() == this.m_abtns[this.m_gloPaneSetting.getIndex()]) {
  105.             this.DoGlossary();
  106.          }
  107.  
  108.       }
  109.    }
  110.  
  111.    private void activeTabButton(int var1) {
  112.       int var2 = 0;
  113.  
  114.       do {
  115.          if (this.m_abtns[var2] != null) {
  116.             if (var2 != var1) {
  117.                this.m_abtns[var2].disactive();
  118.                if (var2 == var1 - 1) {
  119.                   this.m_abtns[var2].SetDrawRight(false);
  120.                } else {
  121.                   this.m_abtns[var2].SetDrawRight(true);
  122.                }
  123.  
  124.                if (var2 == var1 + 1) {
  125.                   this.m_abtns[var2].SetDrawLeft(false);
  126.                } else {
  127.                   this.m_abtns[var2].SetDrawLeft(true);
  128.                }
  129.             } else {
  130.                this.m_abtns[var2].active();
  131.             }
  132.  
  133.             this.m_abtns[var2].repaint(0L);
  134.          }
  135.  
  136.          ++var2;
  137.       } while(var2 < 4);
  138.  
  139.    }
  140.  
  141.    public boolean CanQueryHeighAndWidthForNS() {
  142.       if (this.m_bCanAccessJSObjectChecked) {
  143.          return this.m_bCanAccessJSObject;
  144.       } else {
  145.          this.m_bCanAccessJSObjectChecked = true;
  146.          return this._checkAccess();
  147.       }
  148.    }
  149.  
  150.    public void start() {
  151.       System.out.println("!!!Applet Start!!!");
  152.  
  153.       try {
  154.          this.m_commandBuffer = new CommandBuffer();
  155.          if (this.m_bMustHaveSize) {
  156.             this.checkSize();
  157.          }
  158.  
  159.          this.m_CommandThread = new Thread(this);
  160.          this.m_CommandThread.start();
  161.       } catch (Exception var2) {
  162.          ((Throwable)var2).printStackTrace();
  163.       }
  164.  
  165.       if (System.getProperty("java.vendor").indexOf("Netscape") == -1) {
  166.          this.myrun();
  167.       }
  168.  
  169.    }
  170.  
  171.    public String getAppletInfo() {
  172.       return "WebHelp Applet Version 5.00.000" + "\r\n" + "Copyright (c) 1998-2001 eHelp Corporation. All rights reserved.";
  173.    }
  174.  
  175.    private void DoGlossary() {
  176.       if (this.m_gloPaneSetting != null) {
  177.          this.activeTabButton(this.m_gloPaneSetting.getIndex());
  178.          if (this.m_pnlNav == null) {
  179.             this.m_clLayout = new CardLayout();
  180.             this.m_pnlNav = new Panel();
  181.             this.m_pnlNav.setLayout(this.m_clLayout);
  182.             ((Container)this).add("Center", this.m_pnlNav);
  183.          }
  184.  
  185.          this.m_bMustHaveSize = true;
  186.          if (this.m_gloView == null) {
  187.             GloViewSkin var1 = (GloViewSkin)this.m_gloPaneSetting.getViewSkin();
  188.             this.m_gloView = new GlossaryView(this.m_vProjects, var1);
  189.             this.m_pnlNav.add(ResourceLib.GetRes("Glossary"), this.m_gloView);
  190.             ((Applet)this).showStatus(ResourceLib.GetRes("LoadingGlossary"));
  191.          }
  192.  
  193.          this.m_clLayout.show(this.m_pnlNav, ResourceLib.GetRes("Glossary"));
  194.          ((Component)this).repaint();
  195.          this.RepaintTabs();
  196.          if (this.m_gloView != null) {
  197.             this.m_gloView.requestFocus();
  198.          }
  199.       }
  200.  
  201.    }
  202.  
  203.    public void reshape(int var1, int var2, int var3, int var4) {
  204.       System.out.println("!!!Applet Reshape!!!");
  205.  
  206.       try {
  207.          if (System.getProperty("java.vendor").startsWith("Netscape") && (System.getProperty("os.name").startsWith("Windows") || System.getProperty("os.name").startsWith("Mac"))) {
  208.             if (this.CanQueryHeighAndWidthForNS()) {
  209.                WebHelp$JavaScriptAccess var5 = new WebHelp$JavaScriptAccess(this, this);
  210.                var4 = var5.GetHeight(var4);
  211.                var3 = var5.GetWidth(var3);
  212.                if (!this.m_bShowTab) {
  213.                   try {
  214.                      if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
  215.                         ((Component)this).getParent().reshape(var1, var2, var3, var4);
  216.                      }
  217.                   } catch (Exception var7) {
  218.                      ((Throwable)var7).printStackTrace();
  219.                   }
  220.                }
  221.  
  222.                super.reshape(var1, var2, var3, var4);
  223.                ((Container)this).validate();
  224.             } else {
  225.                super.reshape(var1, var2, var3, var4);
  226.             }
  227.          } else {
  228.             super.reshape(var1, var2, var3, var4);
  229.             ((Container)this).validate();
  230.          }
  231.       } catch (Exception var8) {
  232.          ((Throwable)var8).printStackTrace();
  233.       }
  234.    }
  235.  
  236.    private void DoNavPane() {
  237.       ((Component)this).setBackground(new Color(192, 192, 192));
  238.       ((Container)this).setLayout(new BorderLayout());
  239.       this.m_strProjectFile = ((Applet)this).getParameter("ProjectFile");
  240.       if (this.m_strProjectFile != null && this.m_strProjectFile.length() > 0) {
  241.          this.loadProject(this.m_strProjectFile);
  242.       }
  243.  
  244.       String var1 = ((Applet)this).getParameter("HideTabs");
  245.       if (var1 != null && var1.toUpperCase().compareTo("TRUE") == 0) {
  246.          this.m_bShowTab = false;
  247.       } else {
  248.          this.m_bShowTab = true;
  249.       }
  250.  
  251.       Object var2 = null;
  252.       String var9 = ((Applet)this).getParameter("ContentsTab");
  253.       if (var9 == null) {
  254.          var9 = ResourceLib.GetRes("Contents");
  255.       }
  256.  
  257.       Object var3 = null;
  258.       String var10 = ((Applet)this).getParameter("IndexTab");
  259.       if (var10 == null) {
  260.          var10 = ResourceLib.GetRes("Index");
  261.       }
  262.  
  263.       Object var4 = null;
  264.       String var11 = ((Applet)this).getParameter("SearchTab");
  265.       if (var11 == null) {
  266.          var11 = ResourceLib.GetRes("Search");
  267.       }
  268.  
  269.       Object var5 = null;
  270.       String var12 = ((Applet)this).getParameter("GlossaryTab");
  271.       if (var12 == null) {
  272.          var12 = ResourceLib.GetRes("Glossary");
  273.       }
  274.  
  275.       this.m_pnlTabs = null;
  276.       this.m_pnlTabs = new TabPanel();
  277.       this.m_pnlTabs.setLayout((LayoutManager)null);
  278.       this.m_abtns = new TabButton[4];
  279.       if (this.m_tocPaneSetting != null) {
  280.          TabButton var6 = new TabButton(var9, this);
  281.          ((CanvasButton)var6).addButtonPushEventListener(this);
  282.          if (4 > this.m_tocPaneSetting.getIndex()) {
  283.             this.m_abtns[this.m_tocPaneSetting.getIndex()] = var6;
  284.          }
  285.       }
  286.  
  287.       if (this.m_idxPaneSetting != null) {
  288.          TabButton var13 = new TabButton(var10, this);
  289.          ((CanvasButton)var13).addButtonPushEventListener(this);
  290.          if (4 > this.m_idxPaneSetting.getIndex()) {
  291.             this.m_abtns[this.m_idxPaneSetting.getIndex()] = var13;
  292.          }
  293.       }
  294.  
  295.       if (this.m_ftsPaneSetting != null) {
  296.          TabButton var14 = new TabButton(var11, this);
  297.          ((CanvasButton)var14).addButtonPushEventListener(this);
  298.          if (4 > this.m_ftsPaneSetting.getIndex()) {
  299.             this.m_abtns[this.m_ftsPaneSetting.getIndex()] = var14;
  300.          }
  301.       }
  302.  
  303.       if (this.m_gloPaneSetting != null) {
  304.          TabButton var15 = new TabButton(var12, this);
  305.          ((CanvasButton)var15).addButtonPushEventListener(this);
  306.          if (4 > this.m_gloPaneSetting.getIndex()) {
  307.             this.m_abtns[this.m_gloPaneSetting.getIndex()] = var15;
  308.          }
  309.       }
  310.  
  311.       int var16 = 0;
  312.  
  313.       do {
  314.          if (this.m_abtns[var16] != null) {
  315.             this.m_pnlTabs.add(this.m_abtns[var16]);
  316.          }
  317.  
  318.          ++var16;
  319.       } while(var16 < 4);
  320.  
  321.       if (this.m_bShowTab) {
  322.          ((Container)this).add("North", this.m_pnlTabs);
  323.       }
  324.  
  325.       Rectangle var17 = ((Component)this).bounds();
  326.       int var7 = 1;
  327.       int var8 = 0;
  328.  
  329.       do {
  330.          if (this.m_abtns[var8] != null) {
  331.             this.rods_reshape(this.m_abtns[var8], var7, var17.y, this.m_abtns[var8].preferredSize().width, 25);
  332.             var7 += this.m_abtns[var8].bounds().width;
  333.          }
  334.  
  335.          ++var8;
  336.       } while(var8 < 4);
  337.  
  338.       this.rods_reshape(this.m_pnlTabs, var17.x, var17.y, var17.width, 28);
  339.       this.m_pnlTabs.requestFocus();
  340.       var8 = 0;
  341.  
  342.       do {
  343.          if (this.m_abtns[var8] != null) {
  344.             this.m_abtns[var8].active();
  345.          }
  346.  
  347.          ++var8;
  348.       } while(var8 < 4);
  349.  
  350.       var8 = 0;
  351.  
  352.       do {
  353.          if (this.m_abtns[var8] != null) {
  354.             this.m_abtns[var8].disactive();
  355.          }
  356.  
  357.          ++var8;
  358.       } while(var8 < 4);
  359.  
  360.       if (this.m_abtns[this.m_nFirstPane] != null) {
  361.          Object var20 = null;
  362.          ButtonPushEvent var21 = new ButtonPushEvent(this.m_abtns[this.m_nFirstPane], 0, 0);
  363.          this.notifyButtonPushEvent(var21);
  364.       }
  365.  
  366.    }
  367.  
  368.    public void Command(String var1, String var2) {
  369.       this.Command(var1, var2, (String)null);
  370.    }
  371.  
  372.    public synchronized void Command(String var1, String var2, String var3) {
  373.       if (this.m_CommandThread != null) {
  374.          WhCommand var4 = new WhCommand(var1, var2, var3);
  375.          this.m_commandBuffer.putCommand(var4);
  376.       }
  377.  
  378.    }
  379.  
  380.    public void Command(String var1) {
  381.       this.Command(var1, (String)null, (String)null);
  382.    }
  383.  
  384.    public void printVMInfo() {
  385.       try {
  386.          System.out.println(System.getProperty("java.version"));
  387.          System.out.println(System.getProperty("java.vendor"));
  388.          System.out.println(System.getProperty("java.vendor.url"));
  389.          System.out.println(System.getProperty("java.home"));
  390.          System.out.println(System.getProperty("java.class.path"));
  391.          System.out.println(System.getProperty("java.class.version"));
  392.          System.out.println(System.getProperty("os.name"));
  393.          System.out.println(System.getProperty("os.arch"));
  394.          System.out.println(System.getProperty("os.version"));
  395.          System.out.println(System.getProperty("user.name"));
  396.          System.out.println(System.getProperty("user.home"));
  397.          System.out.println(System.getProperty("user.dir"));
  398.       } catch (Exception var2) {
  399.          ((Throwable)var2).printStackTrace();
  400.       }
  401.    }
  402.  
  403.    public void paint(Graphics var1) {
  404.       System.out.println("!!!Applet paint!!!");
  405.       super.paint(var1);
  406.    }
  407.  
  408.    public void destroy() {
  409.       System.out.println("!!!Applet Destroy!!!");
  410.  
  411.       try {
  412.          System.gc();
  413.          Runtime.getRuntime().gc();
  414.       } catch (Exception var2) {
  415.          ((Throwable)var2).printStackTrace();
  416.       }
  417.    }
  418.  
  419.    protected void rods_reshape(Component var1, int var2, int var3, int var4, int var5) {
  420.       var1.move(var2, var3);
  421.       var1.resize(var4, var5);
  422.    }
  423.  
  424.    private void DoContents() {
  425.       if (this.m_tocPaneSetting != null) {
  426.          this.activeTabButton(this.m_tocPaneSetting.getIndex());
  427.          if (this.m_pnlNav == null) {
  428.             this.m_clLayout = new CardLayout();
  429.             this.m_pnlNav = new Panel();
  430.             this.m_pnlNav.setLayout(this.m_clLayout);
  431.             ((Container)this).add("Center", this.m_pnlNav);
  432.          }
  433.  
  434.          this.m_bMustHaveSize = true;
  435.          this.RepaintTabs();
  436.          if (this.m_tocView == null) {
  437.             TocViewSkin var1 = (TocViewSkin)this.m_tocPaneSetting.getViewSkin();
  438.             this.m_tocView = new TocView(this.m_vProjects, var1);
  439.             this.m_pnlNav.add(ResourceLib.GetRes("Contents"), this.m_tocView);
  440.             ((Applet)this).showStatus(ResourceLib.GetRes("LoadingContents"));
  441.          }
  442.  
  443.          this.m_clLayout.show(this.m_pnlNav, ResourceLib.GetRes("Contents"));
  444.          if (this.m_tocView != null) {
  445.             this.m_tocView.requestFocus();
  446.          }
  447.       }
  448.  
  449.    }
  450.  
  451.    public void resize(int var1, int var2) {
  452.       System.out.println("!!!Applet Resize!!!");
  453.       if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
  454.          if (this.CanQueryHeighAndWidthForNS()) {
  455.             try {
  456.                JSObject var3 = JSObject.getWindow(this);
  457.                var3.setMember("gbLoading", "Phase1");
  458.             } catch (Exception var6) {
  459.                ((Throwable)var6).printStackTrace();
  460.             }
  461.          }
  462.       } else if (System.getProperty("java.vendor").indexOf("Microsoft") != -1 && System.getProperty("java.version").startsWith("1.1")) {
  463.          try {
  464.             JSObject var7 = JSObject.getWindow(this);
  465.             var7.setMember("gbLoading", "Phase1");
  466.          } catch (Exception var5) {
  467.             ((Throwable)var5).printStackTrace();
  468.          }
  469.       }
  470.  
  471.       try {
  472.          if (this.CanQueryHeighAndWidthForNS()) {
  473.             WebHelp$JavaScriptAccess var8 = new WebHelp$JavaScriptAccess(this, this);
  474.             var2 = var8.GetHeight(var2);
  475.             var1 = var8.GetWidth(var1);
  476.          }
  477.  
  478.          super.resize(var1, var2);
  479.       } catch (Exception var4) {
  480.          ((Throwable)var4).printStackTrace();
  481.       }
  482.    }
  483.  
  484.    public synchronized boolean checkSize() {
  485.       if (((Component)this).bounds().width == 0 && ((Component)this).bounds().height == 0) {
  486.          String var1 = ((Applet)this).getDocumentBase().toString();
  487.          int var2 = var1.lastIndexOf(".");
  488.          String var3 = var1.substring(var2, var1.length());
  489.          var1 = var1.substring(0, var2);
  490.          var1 = var1 + "f" + var3;
  491.  
  492.          try {
  493.             URL var4 = new URL(var1);
  494.             ((Applet)this).getAppletContext().showDocument(var4, "_self");
  495.             return false;
  496.          } catch (Exception var5) {
  497.             ((Throwable)var5).printStackTrace();
  498.          }
  499.       }
  500.  
  501.       return true;
  502.    }
  503.  
  504.    private void DoSearch(String var1) {
  505.       if (this.m_ftsPaneSetting != null) {
  506.          this.activeTabButton(this.m_ftsPaneSetting.getIndex());
  507.          if (this.m_pnlNav == null) {
  508.             this.m_clLayout = new CardLayout();
  509.             this.m_pnlNav = new Panel();
  510.             this.m_pnlNav.setLayout(this.m_clLayout);
  511.             ((Container)this).add("Center", this.m_pnlNav);
  512.          }
  513.  
  514.          this.m_bMustHaveSize = true;
  515.          if (this.m_ftsView == null) {
  516.             FtsViewSkin var2 = (FtsViewSkin)this.m_ftsPaneSetting.getViewSkin();
  517.             this.m_ftsView = new FtsView(this.m_vProjects, var2);
  518.             this.m_pnlNav.add(ResourceLib.GetRes("Search"), this.m_ftsView);
  519.             ((Applet)this).showStatus(ResourceLib.GetRes("LoadingFTS"));
  520.          }
  521.  
  522.          if (var1 != null && var1.length() != 0) {
  523.             this.m_ftsView.setSearchString(var1);
  524.          }
  525.  
  526.          this.m_clLayout.show(this.m_pnlNav, ResourceLib.GetRes("Search"));
  527.          ((Component)this).repaint();
  528.          this.RepaintTabs();
  529.          if (this.m_ftsView != null) {
  530.             this.m_ftsView.requestFocus();
  531.          }
  532.       }
  533.  
  534.    }
  535.  
  536.    public void myrun() {
  537.       try {
  538.          System.gc();
  539.          Runtime.getRuntime().gc();
  540.          ImageCache.createInstance(this);
  541.          BsscXML.setDocumentBase(((Applet)this).getDocumentBase());
  542.          ResourceLib.InitRes();
  543.          String var1 = ((Applet)this).getParameter("ResourceFile");
  544.          if (var1 != null) {
  545.             ResourceLib.LoadResource(var1);
  546.          }
  547.  
  548.          this.m_tocPaneSetting = ResourceLib.getPaneSetting("toc");
  549.          this.m_idxPaneSetting = ResourceLib.getPaneSetting("index");
  550.          this.m_ftsPaneSetting = ResourceLib.getPaneSetting("fts");
  551.          this.m_gloPaneSetting = ResourceLib.getPaneSetting("glossary");
  552.          this.m_nFirstPane = ResourceLib.getFirstShowPaneIndex();
  553.          String var2 = ((Applet)this).getParameter("Frame");
  554.          if (var2 == null) {
  555.             var2 = "bsscright";
  556.          }
  557.  
  558.          BsscHelpRedirector.initRedirector(this, var2);
  559.          this.DoNavPane();
  560.          ((Component)this).show();
  561.       } catch (Exception var3) {
  562.          ((Throwable)var3).printStackTrace();
  563.       }
  564.    }
  565.  
  566.    private void RepaintTabs() {
  567.       if (this.m_bShowTab) {
  568.          if (this.m_pnlNav != null) {
  569.             this.m_pnlNav.paintAll(this.m_pnlNav.getGraphics());
  570.          }
  571.  
  572.          int var1 = 0;
  573.  
  574.          do {
  575.             if (this.m_abtns[var1] != null) {
  576.                this.m_abtns[var1].paint(this.m_abtns[var1].getGraphics());
  577.             }
  578.  
  579.             ++var1;
  580.          } while(var1 < 4);
  581.       }
  582.  
  583.    }
  584.  
  585.    private void DoIndex() {
  586.       if (this.m_idxPaneSetting != null) {
  587.          this.activeTabButton(this.m_idxPaneSetting.getIndex());
  588.          if (this.m_pnlNav == null) {
  589.             this.m_clLayout = new CardLayout();
  590.             this.m_pnlNav = new Panel();
  591.             this.m_pnlNav.setLayout(this.m_clLayout);
  592.             ((Container)this).add("Center", this.m_pnlNav);
  593.          }
  594.  
  595.          this.m_bMustHaveSize = true;
  596.          if (this.m_indexView == null) {
  597.             IndexViewSkin var1 = (IndexViewSkin)this.m_idxPaneSetting.getViewSkin();
  598.             this.m_indexView = new IndexView(this.m_vProjects, var1);
  599.             this.m_pnlNav.add(ResourceLib.GetRes("Index"), this.m_indexView);
  600.             ((Applet)this).showStatus(ResourceLib.GetRes("LoadingIndex"));
  601.          }
  602.  
  603.          this.m_clLayout.show(this.m_pnlNav, ResourceLib.GetRes("Index"));
  604.          this.m_pnlNav.paintAll(this.m_pnlNav.getGraphics());
  605.          this.RepaintTabs();
  606.          if (this.m_indexView != null) {
  607.             this.m_indexView.requestFocus();
  608.          }
  609.       }
  610.  
  611.    }
  612.  
  613.    public boolean GoNext(Object var1) {
  614.       if (this.m_pnlTabs == null) {
  615.          return false;
  616.       } else {
  617.          for(int var2 = 0; var2 < this.m_pnlTabs.getComponentCount(); ++var2) {
  618.             if (this.m_pnlTabs.getComponent(var2) == var1) {
  619.                if (var2 != this.m_pnlTabs.getComponentCount() - 1) {
  620.                   Component var3 = this.m_pnlTabs.getComponent(var2 + 1);
  621.                   var3.requestFocus();
  622.                   this.notifyButtonPushEvent(new ButtonPushEvent(var3, 0, 0));
  623.                   return true;
  624.                }
  625.  
  626.                return false;
  627.             }
  628.          }
  629.  
  630.          return false;
  631.       }
  632.    }
  633.  
  634.    private void DoSync(String var1, String var2) {
  635.       if (this.m_tocView != null) {
  636.          this.m_tocView.sync(var1, var2);
  637.       }
  638.  
  639.    }
  640.  
  641.    public void run() {
  642.       while(true) {
  643.          try {
  644.             Object var1 = null;
  645.  
  646.             while((var6 = this.m_commandBuffer.getCommand()) == null) {
  647.                Thread.currentThread();
  648.                Thread.sleep(100L);
  649.             }
  650.  
  651.             String var2 = var6.getName();
  652.             String var3 = var6.getParam0();
  653.             String var4 = var6.getParam1();
  654.             if (var2.equalsIgnoreCase("SyncToc")) {
  655.                this.DoSync(var3, var4);
  656.             } else if (var2.equalsIgnoreCase("Contents")) {
  657.                this.DoContents();
  658.             } else if (var2.equalsIgnoreCase("Index")) {
  659.                this.DoIndex();
  660.             } else if (var2.equalsIgnoreCase("Search")) {
  661.                this.DoSearch(var3);
  662.             } else if (var2.equalsIgnoreCase("Glossary")) {
  663.                this.DoGlossary();
  664.             } else if (var2.equalsIgnoreCase("Quit")) {
  665.                return;
  666.             }
  667.          } catch (Exception var5) {
  668.             ((Throwable)var5).printStackTrace();
  669.          }
  670.       }
  671.    }
  672.  
  673.    public void init() {
  674.       System.out.println("!!!Applet Init!!!");
  675.       if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
  676.          this.myrun();
  677.       }
  678.  
  679.    }
  680.  
  681.    public boolean GoPrev(Object var1) {
  682.       if (this.m_pnlTabs == null) {
  683.          return false;
  684.       } else {
  685.          for(int var2 = 0; var2 < this.m_pnlTabs.getComponentCount(); ++var2) {
  686.             if (this.m_pnlTabs.getComponent(var2) == var1) {
  687.                if (var2 != 0) {
  688.                   Component var3 = this.m_pnlTabs.getComponent(var2 - 1);
  689.                   var3.requestFocus();
  690.                   this.notifyButtonPushEvent(new ButtonPushEvent(var3, 0, 0));
  691.                   return true;
  692.                }
  693.  
  694.                return false;
  695.             }
  696.          }
  697.  
  698.          return false;
  699.       }
  700.    }
  701.  
  702.    public synchronized void resizeForNS(int var1, int var2) {
  703.       try {
  704.          if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
  705.             ((Component)this).getParent().reshape(0, 0, var1, var2);
  706.          }
  707.  
  708.          super.reshape(0, 0, var1, var2);
  709.          ((Container)this).validate();
  710.       } catch (Exception var4) {
  711.          ((Throwable)var4).printStackTrace();
  712.       }
  713.    }
  714.  
  715.    private boolean _checkAccess() {
  716.       if (System.getProperty("java.vendor").startsWith("Netscape") && (System.getProperty("os.name").startsWith("Windows") || System.getProperty("os.name").startsWith("Mac"))) {
  717.          try {
  718.             if (((Applet)this).getParameter("BrowserVersion") == null || !((Applet)this).getParameter("BrowserVersion").equalsIgnoreCase("4.6")) {
  719.                JSObject.getWindow(this);
  720.                this.m_bCanAccessJSObject = true;
  721.             }
  722.          } catch (Exception var2) {
  723.             System.gc();
  724.             ((Throwable)var2).printStackTrace();
  725.          }
  726.       }
  727.  
  728.       return this.m_bCanAccessJSObject;
  729.    }
  730.  
  731.    public void loadProject(String var1) {
  732.       try {
  733.          Project.setFileName(var1);
  734.          this.m_vProjects = new Vector();
  735.          URL var2 = URLFileHandler.makeURL(BsscXML.getDocumentBase(), var1, (String)null);
  736.          this.m_vProjects.addElement(new Project(var2));
  737.          int var3 = 0;
  738.  
  739.          do {
  740.             Project var4 = (Project)this.m_vProjects.elementAt(var3);
  741.  
  742.             try {
  743.                ((Consumer)var4).process();
  744.                if (var3 == 0) {
  745.                   this.m_sLangId = var4.getLangId();
  746.                } else {
  747.                   String var5 = var4.getLangId();
  748.                   if (!this.m_sLangId.equals(var5)) {
  749.                      System.out.println("The Project:" + ((Consumer)var4).getURL() + "is using a different language to the main project, which will cause the index and full text search functionality to be disabled for this remote project");
  750.                   }
  751.                }
  752.  
  753.                URL var15 = ((Consumer)var4).getURL();
  754.                Vector var6 = var4.getRemoteProject();
  755.                Enumeration var7 = var6.elements();
  756.  
  757.                while(var7.hasMoreElements()) {
  758.                   Object var8 = var7.nextElement();
  759.                   if (var8 instanceof String) {
  760.                      URL var9 = URLFileHandler.makeURL(var15, (String)var8 + var1, (String)null);
  761.                      boolean var10 = false;
  762.                      Enumeration var11 = this.m_vProjects.elements();
  763.  
  764.                      while(var11.hasMoreElements()) {
  765.                         Object var12 = var11.nextElement();
  766.                         if (var12 instanceof Project && ((Project)var12).getURL().equals(var9)) {
  767.                            var10 = true;
  768.                            break;
  769.                         }
  770.                      }
  771.  
  772.                      if (!var10) {
  773.                         this.m_vProjects.addElement(new Project(var9));
  774.                      }
  775.                   }
  776.                }
  777.  
  778.                ++var3;
  779.             } catch (Exception var13) {
  780.                this.m_vProjects.removeElementAt(var3);
  781.                ((Throwable)var13).printStackTrace();
  782.             }
  783.          } while(var3 < this.m_vProjects.size());
  784.  
  785.          System.out.println("Well done!");
  786.       } catch (Exception var14) {
  787.          ((Throwable)var14).printStackTrace();
  788.       }
  789.    }
  790. }
  791.