home *** CD-ROM | disk | FTP | other *** search
- import hhapplet.AboutDialogBox;
- import hhapplet.BsscHelpCommandAdapter;
- import hhapplet.BsscHelpRedirector;
- import hhapplet.ButtonLauncher;
- import hhapplet.ButtonPushEvent;
- import hhapplet.ButtonPushEventListener;
- import hhapplet.DialogDoneTarget;
- import hhapplet.FTSPane;
- import hhapplet.FTSParser;
- import hhapplet.FTSSearcher;
- import hhapplet.IndexPane;
- import hhapplet.IndexSecondaryDialog;
- import hhapplet.IndexSecondaryEntry;
- import hhapplet.LabelLauncher;
- import hhapplet.PopupMenu;
- import hhapplet.ResourceLib;
- import hhapplet.SiteMapParserToContents;
- import hhapplet.SiteMapParserToIndex;
- import hhapplet.SplashScreen;
- import hhapplet.TabButton;
- import hhapplet.TabManagerAdaper;
- import hhapplet.TabPanel;
- import hhapplet.URLFileHandler;
- import java.applet.Applet;
- import java.awt.BorderLayout;
- import java.awt.CardLayout;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Event;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.awt.Label;
- import java.awt.LayoutManager;
- import java.awt.Panel;
- import java.awt.Rectangle;
- import java.awt.Window;
- import java.io.IOException;
- import java.net.URL;
- import java.util.Vector;
- import netscape.javascript.JSObject;
- import sitemap.MyBufferedInputStream;
- import sitemap.SiteMapParser;
- import treeview.TreeViewImageSet;
-
- public class WebHelp extends Applet implements ButtonPushEventListener, BsscHelpCommandAdapter, TabManagerAdaper, BsscHelpRedirector {
- private static final String STR_APPLET_ID = "WebHelp Applet Version 2.00.000";
- private static final String STR_COPYRIGHT = "Copyright (c) 1998-2000 eHelp Corporation. All rights reserved.";
- private boolean m_bShowTab = true;
- private Window m_winFrameToShow = null;
- private String m_strContentsFile = null;
- private String m_strIndexFile = null;
- private String m_strSearchFile = null;
- private String m_strHelpFile = null;
- private boolean m_bContentsLoaded = false;
- private boolean m_bIndexLoaded = false;
- private boolean m_bSearchLoaded = false;
- private boolean m_bHelpLoaded = false;
- private String m_strCurrentCommand = null;
- private Panel m_pnlNav = null;
- private TabPanel m_pnlTabs = null;
- private CardLayout m_clLayout = null;
- private boolean m_bParsing = false;
- private Image[] m_imgList = null;
- private TreeViewImageSet m_tvisImages = null;
- private SiteMapParser m_smpContents = null;
- private SiteMapParser m_smpIndex = null;
- private SiteMapParser m_smpHelp = null;
- private IndexPane m_ipIndex = null;
- private FTSPane m_spSearch = null;
- private Thread contents_thread = null;
- private Thread parser_thread = null;
- private Thread search_thread = null;
- private Thread sync_thread = null;
- private TabButton m_tbtnToc = null;
- private TabButton m_tbtnIndex = null;
- private TabButton m_tbtnSearch = null;
- private TabButton m_tbtnHelp = null;
- private boolean m_bMustHaveSize = false;
- private boolean m_bIsIE3 = false;
- private long m_lnTimeCreated = System.currentTimeMillis();
- private FTSParser m_ftsParser = null;
- private FTSSearcher m_ftsSearcher = null;
- boolean m_bCanAccessJSObject = false;
- private boolean m_bCanAccessJSObjectChecked = false;
-
- public void stop() {
- System.out.println("!!!Applet Stop!!!");
- if (System.getProperty("java.vendor").indexOf("Netscape") != -1 && this.CanQueryHeighAndWidthForNS()) {
- try {
- JSObject var1 = JSObject.getWindow(this);
- var1.setMember("gbLoading", "Phase1");
- } catch (Exception var3) {
- ((Throwable)var3).printStackTrace();
- }
- }
-
- try {
- if (this.m_winFrameToShow != null) {
- this.m_winFrameToShow.hide();
- }
-
- System.gc();
- Runtime.getRuntime().gc();
- } catch (Exception var2) {
- ((Throwable)var2).printStackTrace();
- }
- }
-
- public boolean gotFocus(Event var1, Object var2) {
- ((Component)this).nextFocus();
- return true;
- }
-
- public void notifyButtonPushEvent(ButtonPushEvent var1) {
- if (var1.getSource() == this.m_tbtnToc) {
- this.DoContents(this.m_strContentsFile);
- } else if (var1.getSource() == this.m_tbtnIndex) {
- this.DoIndex(this.m_strIndexFile);
- } else if (var1.getSource() == this.m_tbtnSearch) {
- this.DoSearch(this.m_strSearchFile);
- } else {
- if (this.m_tbtnHelp != null && var1.getSource() == this.m_tbtnHelp) {
- this.DoHelp(this.m_strHelpFile);
- }
-
- }
- }
-
- private void DoBadCommand(String var1) {
- ((Container)this).add(new Label("The command \"" + var1 + "\" is unrecognised"));
- }
-
- private void DoHHVersion(boolean var1) {
- String var2 = null;
- Object var3 = null;
- String var4 = null;
- if (!var1) {
- var2 = ((Applet)this).getParameter("Button");
- String var12 = ((Applet)this).getParameter("Text");
- if (var2 == null && var12 == null) {
- return;
- }
-
- var4 = var2 != null ? var2 : var12;
- }
-
- Vector var5 = new Vector();
- var5.addElement("WebHelp Applet Version 2.00.000");
- var5.addElement("Copyright (c) 1998-2000 eHelp Corporation. All rights reserved.");
-
- try {
- var5.addElement("Java VM vendor: " + System.getProperty("java.vendor"));
- } catch (Exception var11) {
- ((Throwable)var11).printStackTrace();
- }
-
- try {
- var5.addElement("Java version: " + System.getProperty("java.version"));
- } catch (Exception var10) {
- ((Throwable)var10).printStackTrace();
- }
-
- try {
- var5.addElement("Java library version: " + System.getProperty("java.class.version"));
- } catch (Exception var9) {
- ((Throwable)var9).printStackTrace();
- }
-
- try {
- String var6 = "Operating System: " + System.getProperty("os.name") + " " + System.getProperty("os.version") + " (" + System.getProperty("os.arch") + ")";
- var5.addElement(var6);
- } catch (Exception var8) {
- ((Throwable)var8).printStackTrace();
- }
-
- AboutDialogBox var13 = new AboutDialogBox("About WebHelp Applet", var5);
- if (var1) {
- var13.show();
- } else {
- Object var7 = var2 != null ? new ButtonLauncher(var4, var13) : new LabelLauncher(var4, var13);
- ((Container)this).setLayout(new BorderLayout());
- ((Container)this).add("Center", (Component)var7);
- this.m_winFrameToShow = var13;
- }
- }
-
- private void DoAutoSync(String var1) {
- if (this.m_smpContents != null) {
- if (this.sync_thread != null && this.sync_thread.isAlive()) {
- this.sync_thread.stop();
- }
-
- this.sync_thread = new DoSync(this.m_smpContents, var1, "SyncThread");
- this.sync_thread.start();
- }
-
- }
-
- public boolean CanQueryHeighAndWidthForNS() {
- if (this.m_bCanAccessJSObjectChecked) {
- return this.m_bCanAccessJSObject;
- } else {
- this.m_bCanAccessJSObjectChecked = true;
- return this._checkAccess();
- }
- }
-
- public void start() {
- System.out.println("!!!Applet Start!!!");
-
- try {
- if (this.m_bMustHaveSize) {
- this.checkSize();
- }
- } catch (Exception var2) {
- ((Throwable)var2).printStackTrace();
- }
-
- if (System.getProperty("java.vendor").indexOf("Netscape") == -1) {
- this.myrun();
- }
-
- }
-
- public String getAppletInfo() {
- return "WebHelp Applet Version 2.00.000" + "\r\n" + "Copyright (c) 1998-2000 eHelp Corporation. All rights reserved.";
- }
-
- private void DoHelp(String var1) {
- boolean var2 = false;
- if (this.m_tbtnSearch != null) {
- this.m_tbtnSearch.enable();
- this.m_tbtnSearch.SetDrawLeft(true);
- if (!var2) {
- var2 = true;
- this.m_tbtnSearch.SetDrawRight(false);
- } else {
- this.m_tbtnSearch.SetDrawRight(true);
- }
-
- this.m_tbtnSearch.repaint(0L);
- }
-
- if (this.m_tbtnIndex != null) {
- this.m_tbtnIndex.enable();
- this.m_tbtnIndex.SetDrawLeft(true);
- if (!var2) {
- var2 = true;
- this.m_tbtnIndex.SetDrawRight(false);
- } else {
- this.m_tbtnIndex.SetDrawRight(true);
- }
-
- this.m_tbtnIndex.repaint(0L);
- }
-
- if (this.m_tbtnToc != null) {
- this.m_tbtnToc.enable();
- this.m_tbtnToc.SetDrawLeft(true);
- if (!var2) {
- var2 = true;
- this.m_tbtnToc.SetDrawRight(false);
- } else {
- this.m_tbtnToc.SetDrawRight(true);
- }
-
- this.m_tbtnToc.repaint(0L);
- }
-
- if (this.m_tbtnHelp != null) {
- this.m_tbtnHelp.disable();
- this.m_tbtnHelp.repaint(0L);
- }
-
- this.RepaintTabs();
- }
-
- public void reshape(int var1, int var2, int var3, int var4) {
- System.out.println("!!!Applet Reshape!!!");
-
- try {
- if (System.getProperty("java.vendor").startsWith("Netscape") && (System.getProperty("os.name").startsWith("Windows") || System.getProperty("os.name").startsWith("Mac"))) {
- if (this.CanQueryHeighAndWidthForNS()) {
- WebHelp$JavaScriptAccess var5 = new WebHelp$JavaScriptAccess(this, this);
- var4 = var5.GetHeight(var4);
- var3 = var5.GetWidth(var3);
- if (!this.m_bShowTab) {
- try {
- if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
- ((Component)this).getParent().reshape(var1, var2, var3, var4);
- }
- } catch (Exception var7) {
- ((Throwable)var7).printStackTrace();
- }
- }
-
- super.reshape(var1, var2, var3, var4);
- ((Container)this).validate();
- } else {
- super.reshape(var1, var2, var3, var4);
- }
- } else {
- super.reshape(var1, var2, var3, var4);
- ((Container)this).validate();
- }
- } catch (Exception var8) {
- ((Throwable)var8).printStackTrace();
- }
- }
-
- private void DoNavPane() {
- ((Component)this).setBackground(new Color(192, 192, 192));
- ((Container)this).setLayout(new BorderLayout());
- this.m_strContentsFile = ((Applet)this).getParameter("ContentsFile");
- this.m_strIndexFile = ((Applet)this).getParameter("IndexFile");
- this.m_strSearchFile = ((Applet)this).getParameter("SearchFile");
- this.m_strHelpFile = ((Applet)this).getParameter("HelpFile");
- String var1 = ((Applet)this).getParameter("HideTabs");
- if (var1 != null && var1.toUpperCase().compareTo("TRUE") == 0) {
- this.m_bShowTab = false;
- } else {
- this.m_bShowTab = true;
- }
-
- String var2 = null;
- if (this.m_strContentsFile != null) {
- var2 = ((Applet)this).getParameter("ContentsTab");
- if (var2 == null) {
- var2 = ResourceLib.GetRes("Contents");
- }
- }
-
- String var3 = null;
- if (this.m_strIndexFile != null) {
- var3 = ((Applet)this).getParameter("IndexTab");
- if (var3 == null) {
- var3 = ResourceLib.GetRes("Index");
- }
- }
-
- String var4 = null;
- if (this.m_strSearchFile != null) {
- var4 = ((Applet)this).getParameter("SearchTab");
- if (var4 == null) {
- var4 = ResourceLib.GetRes("Search");
- }
- }
-
- String var5 = null;
- if (this.m_strHelpFile != null) {
- var5 = ((Applet)this).getParameter("HelpTab");
- if (var5 == null) {
- var5 = "Help";
- }
- }
-
- this.m_pnlTabs = null;
- this.m_pnlTabs = new TabPanel();
- this.m_pnlTabs.setLayout((LayoutManager)null);
- if (this.m_strContentsFile != null) {
- this.m_tbtnToc = new TabButton(var2, this);
- this.m_tbtnToc.addButtonPushEventListener(this);
- this.m_pnlTabs.add(this.m_tbtnToc);
- }
-
- if (this.m_strIndexFile != null) {
- this.m_tbtnIndex = new TabButton(var3, this);
- this.m_tbtnIndex.addButtonPushEventListener(this);
- this.m_pnlTabs.add(this.m_tbtnIndex);
- }
-
- if (this.m_strSearchFile != null) {
- this.m_tbtnSearch = new TabButton(var4, this);
- this.m_tbtnSearch.addButtonPushEventListener(this);
- this.m_pnlTabs.add(this.m_tbtnSearch);
- }
-
- if (this.m_strHelpFile != null) {
- this.m_tbtnHelp = new TabButton(var5, this);
- this.m_tbtnHelp.addButtonPushEventListener(this);
- this.m_pnlTabs.add(this.m_tbtnHelp);
- }
-
- if (this.m_bShowTab) {
- ((Container)this).add("North", this.m_pnlTabs);
- }
-
- Rectangle var6 = ((Component)this).bounds();
- if (this.m_tbtnToc != null) {
- this.rods_reshape(this.m_tbtnToc, 1, var6.y, this.m_tbtnToc.preferredSize().width, 25);
- }
-
- if (this.m_tbtnIndex != null) {
- int var7 = 1;
- if (this.m_tbtnToc != null) {
- var7 += this.m_tbtnToc.bounds().width;
- }
-
- this.rods_reshape(this.m_tbtnIndex, var7, var6.y, this.m_tbtnIndex.preferredSize().width, 25);
- }
-
- if (this.m_tbtnSearch != null) {
- int var14 = 1;
- if (this.m_tbtnToc != null) {
- var14 += this.m_tbtnToc.bounds().width;
- }
-
- if (this.m_tbtnIndex != null) {
- var14 += this.m_tbtnIndex.bounds().width;
- }
-
- this.rods_reshape(this.m_tbtnSearch, var14, var6.y, this.m_tbtnSearch.preferredSize().width, 25);
- }
-
- if (this.m_tbtnHelp != null) {
- int var15 = 1;
- if (this.m_tbtnToc != null) {
- var15 += this.m_tbtnToc.bounds().width;
- }
-
- if (this.m_tbtnIndex != null) {
- var15 += this.m_tbtnIndex.bounds().width;
- }
-
- if (this.m_tbtnSearch != null) {
- var15 += this.m_tbtnSearch.bounds().width;
- }
-
- this.rods_reshape(this.m_tbtnHelp, var15, var6.y, this.m_tbtnHelp.preferredSize().width, 25);
- }
-
- this.rods_reshape(this.m_pnlTabs, var6.x, var6.y, var6.width, 28);
- this.m_pnlTabs.requestFocus();
- if (this.m_tbtnIndex != null) {
- this.m_tbtnIndex.active();
- }
-
- if (this.m_tbtnToc != null) {
- this.m_tbtnToc.active();
- }
-
- if (this.m_tbtnSearch != null) {
- this.m_tbtnSearch.active();
- }
-
- if (this.m_tbtnHelp != null) {
- this.m_tbtnHelp.active();
- }
-
- if (this.m_tbtnToc != null) {
- this.m_tbtnToc.disactive();
- }
-
- if (this.m_tbtnIndex != null) {
- this.m_tbtnIndex.disactive();
- }
-
- if (this.m_tbtnSearch != null) {
- this.m_tbtnSearch.disactive();
- }
-
- if (this.m_tbtnHelp != null) {
- this.m_tbtnHelp.disactive();
- }
-
- boolean var16 = true;
- boolean var8 = true;
- String var9 = ((Applet)this).getParameter("CurrentTab");
- if (var9 != null && (var9.equalsIgnoreCase("Index") || var9.equalsIgnoreCase("Search"))) {
- var16 = false;
- }
-
- if (var9 != null && (var9.equalsIgnoreCase("Contents") || var9.equalsIgnoreCase("Search"))) {
- var8 = false;
- }
-
- Object var10 = null;
- ButtonPushEvent var17;
- if (var16) {
- var17 = new ButtonPushEvent(this.m_tbtnToc, 0, 0);
- } else if (var8) {
- var17 = new ButtonPushEvent(this.m_tbtnIndex, 0, 0);
- } else {
- var17 = new ButtonPushEvent(this.m_tbtnSearch, 0, 0);
- }
-
- this.notifyButtonPushEvent(var17);
- if (this.m_bShowTab) {
- try {
- String var11 = System.getProperty("java.vendor");
- if (var11.startsWith("Netscape")) {
- Panel var12 = new Panel();
- ((Container)var12).setLayout((LayoutManager)null);
- ((Component)var12).resize(((Component)this).bounds().width, 14);
- ((Container)this).add("South", var12);
- return;
- }
- } catch (Exception var13) {
- ((Throwable)var13).printStackTrace();
- }
- }
-
- }
-
- public synchronized void Command(String var1, String var2) {
- try {
- if (var1 != null) {
- if (var1.equalsIgnoreCase("SyncToc")) {
- this.DoSync(var2);
- } else if (var1.equalsIgnoreCase("AutoSync")) {
- this.DoAutoSync(var2);
- } else if (var1.equalsIgnoreCase("Contents")) {
- this.DoContents(var2);
- } else if (var1.equalsIgnoreCase("Index")) {
- this.DoIndex(var2);
- } else if (var1.equalsIgnoreCase("Search")) {
- this.DoSearch(var2);
- } else if (var1.equalsIgnoreCase("Version")) {
- this.ShowVersion();
- } else {
- this.DoBadCommand("Command method does not support " + var1);
- }
- }
- } catch (Exception var4) {
- ((Throwable)var4).printStackTrace();
- }
- }
-
- public void paint(Graphics var1) {
- System.out.println("!!!Applet paint!!!");
- super.paint(var1);
- }
-
- public void printVMInfo() {
- try {
- System.out.println(System.getProperty("java.version"));
- System.out.println(System.getProperty("java.vendor"));
- System.out.println(System.getProperty("java.vendor.url"));
- System.out.println(System.getProperty("java.home"));
- System.out.println(System.getProperty("java.class.path"));
- System.out.println(System.getProperty("java.class.version"));
- System.out.println(System.getProperty("os.name"));
- System.out.println(System.getProperty("os.arch"));
- System.out.println(System.getProperty("os.version"));
- System.out.println(System.getProperty("user.name"));
- System.out.println(System.getProperty("user.home"));
- System.out.println(System.getProperty("user.dir"));
- } catch (Exception var2) {
- ((Throwable)var2).printStackTrace();
- }
- }
-
- public void destroy() {
- System.out.println("!!!Applet Destroy!!!");
-
- try {
- if (this.m_winFrameToShow != null) {
- this.m_winFrameToShow.hide();
- this.m_winFrameToShow.dispose();
- this.m_winFrameToShow = null;
- }
-
- if (this.m_smpContents != null) {
- this.m_smpContents.closeFiles();
- this.m_smpContents = null;
- }
-
- if (this.m_smpIndex != null) {
- this.m_smpIndex.closeFiles();
- this.m_smpIndex = null;
- }
-
- if (this.m_smpHelp != null) {
- this.m_smpHelp.closeFiles();
- this.m_smpHelp = null;
- }
-
- if (this.m_ipIndex != null && this.m_ipIndex.getList() != null) {
- this.m_ipIndex.getList().clear();
- }
-
- if (this.m_ipIndex != null && this.m_ipIndex.getForAppleList() != null) {
- this.m_ipIndex.getForAppleList().clear();
- }
-
- if (this.m_ipIndex != null) {
- this.m_ipIndex = null;
- }
-
- if (this.m_spSearch != null && this.m_spSearch.getList() != null) {
- this.m_spSearch.getList().clear();
- this.m_spSearch = null;
- }
-
- if (this.m_tvisImages != null) {
- this.m_tvisImages.releaseImages(this.m_imgList);
- this.m_tvisImages = null;
- }
-
- if (this.contents_thread != null && this.contents_thread.isAlive()) {
- this.contents_thread.stop();
- this.contents_thread = null;
- }
-
- if (this.parser_thread != null && this.parser_thread.isAlive()) {
- this.parser_thread.stop();
- this.parser_thread = null;
- }
-
- if (this.search_thread != null && this.search_thread.isAlive()) {
- this.search_thread.stop();
- this.search_thread = null;
- }
-
- if (this.sync_thread != null && this.sync_thread.isAlive()) {
- this.sync_thread.stop();
- this.sync_thread = null;
- }
-
- System.gc();
- Runtime.getRuntime().gc();
- } catch (Exception var2) {
- ((Throwable)var2).printStackTrace();
- }
- }
-
- protected void rods_reshape(Component var1, int var2, int var3, int var4, int var5) {
- var1.move(var2, var3);
- var1.resize(var4, var5);
- }
-
- public boolean showDoc(URL var1, String var2) {
- if (var2 != null) {
- if (System.getProperty("java.vendor").indexOf("Netscape") == -1 && !System.getProperty("os.name").startsWith("MacOS")) {
- this.redirect(var1, var2);
- } else {
- ((Applet)this).getAppletContext().showDocument(var1, var2);
- }
- } else {
- ((Applet)this).getAppletContext().showDocument(var1, "_self");
- }
-
- return true;
- }
-
- private void DoContents(String var1) {
- boolean var2 = false;
- if (this.m_tbtnToc != null) {
- this.m_tbtnToc.active();
- this.m_tbtnToc.repaint(0L);
- }
-
- if (this.m_tbtnIndex != null) {
- this.m_tbtnIndex.disactive();
- this.m_tbtnIndex.SetDrawRight(true);
- if (!var2) {
- var2 = true;
- this.m_tbtnIndex.SetDrawLeft(false);
- } else {
- this.m_tbtnIndex.SetDrawLeft(true);
- }
-
- this.m_tbtnIndex.repaint(0L);
- }
-
- if (this.m_tbtnSearch != null) {
- this.m_tbtnSearch.disactive();
- this.m_tbtnSearch.SetDrawRight(true);
- if (!var2) {
- var2 = true;
- this.m_tbtnSearch.SetDrawLeft(false);
- } else {
- this.m_tbtnSearch.SetDrawLeft(true);
- }
-
- this.m_tbtnSearch.repaint(0L);
- }
-
- if (this.m_tbtnHelp != null) {
- this.m_tbtnHelp.disactive();
- this.m_tbtnHelp.SetDrawRight(true);
- if (!var2) {
- var2 = true;
- this.m_tbtnHelp.SetDrawLeft(false);
- } else {
- this.m_tbtnHelp.SetDrawLeft(true);
- }
-
- this.m_tbtnHelp.repaint(0L);
- }
-
- this.RepaintTabs();
- if (var1 == null) {
- ((Container)this).setLayout(new BorderLayout());
- }
-
- if (this.m_pnlNav == null) {
- this.m_clLayout = new CardLayout();
- this.m_pnlNav = new Panel();
- this.m_pnlNav.setLayout(this.m_clLayout);
- ((Container)this).add("Center", this.m_pnlNav);
- }
-
- if (this.m_tvisImages == null) {
- this.m_tvisImages = new TreeViewImageSet();
- this.m_imgList = new Image[14];
- this.m_imgList = this.m_tvisImages.reallyGetImages();
- }
-
- if (var1 == null) {
- var1 = ((Applet)this).getParameter("Item1");
- }
-
- if (this.m_bContentsLoaded && this.m_strContentsFile != null && this.m_strContentsFile.equals(var1)) {
- this.m_clLayout.show(this.m_pnlNav, ResourceLib.GetRes("Contents"));
- if (this.m_smpContents != null) {
- ((SiteMapParserToContents)this.m_smpContents.getOutput()).getTree().requestFocus();
- }
-
- } else {
- this.m_strContentsFile = var1;
- this.m_bContentsLoaded = true;
- this.m_bMustHaveSize = true;
- ((Component)this).repaint(0L);
- this.RepaintTabs();
- SiteMapParserToContents var3 = new SiteMapParserToContents(this, this.m_imgList, this);
- if (this.m_smpContents != null) {
- this.m_smpContents.closeFiles();
- }
-
- ((Applet)this).showStatus(ResourceLib.GetRes("LoadingContents"));
- this.m_pnlNav.add(ResourceLib.GetRes("Contents"), var3.getTree());
- this.m_clLayout.show(this.m_pnlNav, ResourceLib.GetRes("Contents"));
- var3.getTree().requestFocus();
- ((Component)this).repaint(0L);
- ((Component)this).show();
- this.m_smpContents = new SiteMapParser(var3);
- this.contents_thread = this.m_smpContents.parseInSeparateThread(var1, ((Applet)this).getDocumentBase(), this);
- var3.getTree().requestFocus();
- }
- }
-
- public void resize(int var1, int var2) {
- System.out.println("!!!Applet Resize!!!");
- if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
- if (this.CanQueryHeighAndWidthForNS()) {
- try {
- JSObject var3 = JSObject.getWindow(this);
- var3.setMember("gbLoading", "Phase1");
- } catch (Exception var6) {
- ((Throwable)var6).printStackTrace();
- }
- }
- } else if (System.getProperty("java.vendor").indexOf("Microsoft") != -1 && System.getProperty("java.version").startsWith("1.1")) {
- try {
- JSObject var7 = JSObject.getWindow(this);
- var7.setMember("gbLoading", "Phase1");
- } catch (Exception var5) {
- ((Throwable)var5).printStackTrace();
- }
- }
-
- try {
- if (this.CanQueryHeighAndWidthForNS()) {
- WebHelp$JavaScriptAccess var8 = new WebHelp$JavaScriptAccess(this, this);
- var2 = var8.GetHeight(var2);
- var1 = var8.GetWidth(var1);
- }
-
- super.resize(var1, var2);
- } catch (Exception var4) {
- ((Throwable)var4).printStackTrace();
- }
- }
-
- public synchronized boolean checkSize() {
- if (((Component)this).bounds().width == 0 && ((Component)this).bounds().height == 0) {
- String var1 = ((Applet)this).getDocumentBase().toString();
- int var2 = var1.lastIndexOf(".");
- String var3 = var1.substring(var2, var1.length());
- var1 = var1.substring(0, var2);
- var1 = var1 + "f" + var3;
-
- try {
- URL var4 = new URL(var1);
- ((Applet)this).getAppletContext().showDocument(var4, "_self");
- return false;
- } catch (Exception var5) {
- ((Throwable)var5).printStackTrace();
- }
- }
-
- return true;
- }
-
- private void DoSearch(String var1) {
- boolean var2 = false;
- boolean var3 = false;
- if (this.m_tbtnIndex != null) {
- this.m_tbtnIndex.disactive();
- this.m_tbtnIndex.SetDrawLeft(true);
- if (!var3) {
- var3 = true;
- this.m_tbtnIndex.SetDrawRight(false);
- } else {
- this.m_tbtnIndex.SetDrawRight(true);
- }
-
- this.m_tbtnIndex.repaint(0L);
- }
-
- if (this.m_tbtnToc != null) {
- this.m_tbtnToc.disactive();
- this.m_tbtnToc.SetDrawLeft(true);
- if (!var3) {
- var3 = true;
- this.m_tbtnToc.SetDrawRight(false);
- } else {
- this.m_tbtnToc.SetDrawRight(true);
- }
-
- this.m_tbtnToc.repaint(0L);
- }
-
- if (this.m_tbtnSearch != null) {
- this.m_tbtnSearch.active();
- this.m_tbtnSearch.repaint(0L);
- }
-
- if (this.m_tbtnHelp != null) {
- this.m_tbtnHelp.disactive();
- this.m_tbtnHelp.SetDrawRight(true);
- if (!var2) {
- var2 = true;
- this.m_tbtnHelp.SetDrawLeft(false);
- } else {
- this.m_tbtnHelp.SetDrawLeft(true);
- }
-
- this.m_tbtnHelp.repaint(0L);
- }
-
- if (var1 == null) {
- ((Container)this).setLayout(new BorderLayout());
- }
-
- if (this.m_pnlNav == null) {
- this.m_clLayout = new CardLayout();
- this.m_pnlNav = new Panel();
- this.m_pnlNav.setLayout(this.m_clLayout);
- ((Container)this).add("Center", this.m_pnlNav);
- }
-
- if (var1 == null) {
- var1 = ((Applet)this).getParameter("Item1");
- }
-
- if (this.m_bSearchLoaded && this.m_strSearchFile != null && this.m_strSearchFile.equals(var1)) {
- this.m_clLayout.show(this.m_pnlNav, ResourceLib.GetRes("Search"));
- if (this.m_spSearch != null) {
- this.m_spSearch.getEditBox().requestFocus();
- }
-
- } else {
- this.m_strSearchFile = var1;
- this.m_bSearchLoaded = true;
- this.m_bMustHaveSize = true;
- this.m_ftsParser = new FTSParser(this);
- this.m_spSearch = this.m_ftsParser.getFTS();
- this.m_ftsSearcher = this.m_ftsParser.getSearcher();
- if (this.m_spSearch != null && this.m_spSearch.getList() != null) {
- this.m_spSearch.getList().clear();
- this.m_spSearch.getList().addItem(ResourceLib.GetRes("LoadingFTS"));
- }
-
- this.m_pnlNav.add(ResourceLib.GetRes("Search"), this.m_spSearch);
- this.m_clLayout.show(this.m_pnlNav, ResourceLib.GetRes("Search"));
- ((Component)this).repaint();
- this.RepaintTabs();
- ((Applet)this).showStatus(ResourceLib.GetRes("LoadingFTS"));
- ((Component)this).show();
- this.search_thread = this.m_ftsParser.parseInSeparateThread(var1, ((Applet)this).getDocumentBase());
- }
- }
-
- private void DoSplash() {
- ((Applet)this).showStatus("Loading Splash Image...");
-
- try {
- Image var1 = null;
- Object var2 = null;
-
- try {
- var1 = ((Applet)this).getImage(URLFileHandler.makeURL(((Applet)this).getDocumentBase(), ((Applet)this).getParameter("Item1"), (String)null));
- } catch (Exception var6) {
- ((Throwable)var6).printStackTrace();
- }
-
- int var3 = 2500;
-
- try {
- var3 = new Integer(((Applet)this).getParameter("Item2"));
- } catch (NumberFormatException var5) {
- ((Throwable)var5).printStackTrace();
- }
-
- SplashScreen var4 = new SplashScreen(this, var1, var3, (String)var2);
- var4.show();
- } catch (Exception var7) {
- ((Throwable)var7).printStackTrace();
- ((Container)this).add("Center", new Label(ResourceLib.GetRes("CantOpenURLorFile") + ((Throwable)var7).getMessage()));
- }
- }
-
- public void myrun() {
- try {
- System.gc();
- Runtime.getRuntime().gc();
- this.m_lnTimeCreated = System.currentTimeMillis();
- if (System.getProperty("java.vendor").startsWith("Microsoft") && System.getProperty("java.version").startsWith("1.0")) {
- this.m_bIsIE3 = true;
- }
-
- ResourceLib.InitRes();
- String var1 = ((Applet)this).getParameter("ResourceFile");
- if (var1 != null) {
- try {
- MyBufferedInputStream var2 = new MyBufferedInputStream(URLFileHandler.makeURL(((Applet)this).getDocumentBase(), var1, (String)null).openStream());
- ResourceLib.LoadResource(var2);
- var2.close();
- } catch (IOException var4) {
- }
- }
-
- String var6 = ((Applet)this).getParameter("Command");
- if (var6 == null) {
- return;
- }
-
- if (var6.equalsIgnoreCase("Contents")) {
- this.DoContents((String)null);
- } else if (var6.equalsIgnoreCase("Index")) {
- this.DoIndex((String)null);
- } else if (var6.equalsIgnoreCase("Search")) {
- this.DoSearch((String)null);
- } else if (var6.equalsIgnoreCase("Splash")) {
- this.DoSplash();
- } else if (var6.equalsIgnoreCase("Help")) {
- this.DoHelp((String)null);
- } else if (var6.equalsIgnoreCase("Related Topics")) {
- this.DoRelatedTopics(false);
- } else if (var6.equalsIgnoreCase("Related Topics,MENU")) {
- this.DoRelatedTopics(true);
- } else if (var6.equalsIgnoreCase("HH Version")) {
- this.DoHHVersion(false);
- } else if (var6.equalsIgnoreCase("AboutBox")) {
- this.DoAboutBox();
- } else if (var6.equalsIgnoreCase("NavPane")) {
- this.DoNavPane();
- } else {
- this.DoBadCommand(var6);
- }
-
- this.m_strCurrentCommand = var6;
- ((Component)this).show();
- String var3 = ((Applet)this).getParameter("SyncContentTopic");
- if (var3 != null) {
- this.DoSync(var3);
- return;
- }
- } catch (Exception var5) {
- ((Throwable)var5).printStackTrace();
- }
-
- }
-
- private void DoAboutBox() {
- String var1 = ((Applet)this).getParameter("Button");
- String var2 = ((Applet)this).getParameter("Text");
- if (var1 != null || var2 != null) {
- String var3 = var1 != null ? var1 : var2;
- String var4 = ((Applet)this).getParameter("Item1");
- Vector var5 = new Vector();
-
- String var7;
- for(int var6 = 0; (var7 = ((Applet)this).getParameter("Item" + (var6 + 2))) != null; ++var6) {
- var5.addElement(var7);
- }
-
- AboutDialogBox var8 = new AboutDialogBox(var4, var5);
- Object var9 = var1 != null ? new ButtonLauncher(var3, var8) : new LabelLauncher(var3, var8);
- ((Container)this).setLayout(new BorderLayout());
- ((Container)this).add("Center", (Component)var9);
- this.m_winFrameToShow = var8;
- }
- }
-
- private void RepaintTabs() {
- if (this.m_bShowTab) {
- if (this.m_pnlNav != null) {
- this.m_pnlNav.paintAll(this.m_pnlNav.getGraphics());
- }
-
- if (this.m_tbtnToc != null) {
- this.m_tbtnToc.paint(this.m_tbtnToc.getGraphics());
- }
-
- if (this.m_tbtnIndex != null) {
- this.m_tbtnIndex.paint(this.m_tbtnIndex.getGraphics());
- }
-
- if (this.m_tbtnSearch != null) {
- this.m_tbtnSearch.paint(this.m_tbtnSearch.getGraphics());
- }
-
- if (this.m_tbtnHelp != null) {
- this.m_tbtnHelp.paint(this.m_tbtnHelp.getGraphics());
- }
- }
-
- }
-
- private void DoIndex(String var1) {
- boolean var2 = false;
- boolean var3 = false;
- if (this.m_tbtnToc != null) {
- this.m_tbtnToc.disactive();
- this.m_tbtnToc.SetDrawLeft(true);
- if (!var3) {
- var3 = true;
- this.m_tbtnToc.SetDrawRight(false);
- } else {
- this.m_tbtnToc.SetDrawRight(true);
- }
-
- this.m_tbtnToc.repaint(0L);
- }
-
- if (this.m_tbtnIndex != null) {
- this.m_tbtnIndex.active();
- this.m_tbtnIndex.repaint(0L);
- }
-
- if (this.m_tbtnSearch != null) {
- this.m_tbtnSearch.disactive();
- this.m_tbtnSearch.SetDrawRight(true);
- if (!var2) {
- var2 = true;
- this.m_tbtnSearch.SetDrawLeft(false);
- } else {
- this.m_tbtnSearch.SetDrawLeft(true);
- }
-
- this.m_tbtnSearch.repaint(0L);
- }
-
- if (this.m_tbtnHelp != null) {
- this.m_tbtnHelp.disactive();
- this.m_tbtnHelp.SetDrawRight(true);
- if (!var2) {
- var2 = true;
- this.m_tbtnHelp.SetDrawLeft(false);
- } else {
- this.m_tbtnHelp.SetDrawLeft(true);
- }
-
- this.m_tbtnHelp.repaint(0L);
- }
-
- if (var1 == null) {
- ((Container)this).setLayout(new BorderLayout());
- }
-
- if (this.m_pnlNav == null) {
- this.m_clLayout = new CardLayout();
- this.m_pnlNav = new Panel();
- this.m_pnlNav.setLayout(this.m_clLayout);
- ((Container)this).add("Center", this.m_pnlNav);
- }
-
- if (var1 == null) {
- var1 = ((Applet)this).getParameter("Item1");
- }
-
- if (this.m_bIndexLoaded && this.m_strIndexFile != null && this.m_strIndexFile.equals(var1)) {
- this.m_clLayout.show(this.m_pnlNav, ResourceLib.GetRes("Index"));
- if (this.m_ipIndex != null) {
- this.m_ipIndex.getEditBox().requestFocus();
- }
-
- } else {
- this.m_strIndexFile = var1;
- this.m_bIndexLoaded = true;
- this.m_bMustHaveSize = true;
- SiteMapParserToIndex var4 = new SiteMapParserToIndex(this, this);
- if (this.m_ipIndex != null && this.m_ipIndex.getList() != null) {
- this.m_ipIndex.getList().clear();
- }
-
- this.m_ipIndex = var4.getIndex();
- this.m_pnlNav.add(ResourceLib.GetRes("Index"), this.m_ipIndex);
- this.m_clLayout.show(this.m_pnlNav, ResourceLib.GetRes("Index"));
- this.m_pnlNav.paintAll(this.m_pnlNav.getGraphics());
- this.RepaintTabs();
- ((Applet)this).showStatus(ResourceLib.GetRes("LoadingIndex") + "...");
- if (this.m_smpIndex != null) {
- this.m_smpIndex.closeFiles();
- }
-
- if (this.m_ipIndex != null) {
- this.m_ipIndex.getEditBox().requestFocus();
- }
-
- ((Component)this).show();
- this.m_smpIndex = new SiteMapParser(var4);
- this.parser_thread = this.m_smpIndex.parseInSeparateThread(var1, ((Applet)this).getDocumentBase(), this);
- }
- }
-
- public boolean GoNext(Object var1) {
- if (this.m_pnlTabs == null) {
- return false;
- } else {
- for(int var2 = 0; var2 < this.m_pnlTabs.getComponentCount(); ++var2) {
- if (this.m_pnlTabs.getComponent(var2) == var1) {
- if (var2 != this.m_pnlTabs.getComponentCount() - 1) {
- this.notifyButtonPushEvent(new ButtonPushEvent(this.m_pnlTabs.getComponent(var2 + 1), 0, 0));
- return true;
- }
-
- return false;
- }
- }
-
- return false;
- }
- }
-
- public void Click() {
- if (this.m_winFrameToShow != null) {
- if (this.m_bIsIE3) {
- MethodRunner var1 = new MethodRunner(this.m_winFrameToShow, "ClickThread");
- ((Thread)var1).start();
- return;
- }
-
- this.m_winFrameToShow.show();
- }
-
- }
-
- private void ShowVersion() {
- this.DoHHVersion(true);
- }
-
- private void DoSync(String var1) {
- if (this.m_strContentsFile != null) {
- this.DoContents(this.m_strContentsFile);
-
- while(this.m_smpContents == null) {
- try {
- System.out.println("Wait for try DoSYnc!");
- Thread.sleep(100L);
- } catch (InterruptedException var3) {
- ((Throwable)var3).printStackTrace();
- }
- }
-
- if (this.sync_thread != null && this.sync_thread.isAlive()) {
- this.sync_thread.stop();
- }
-
- this.sync_thread = new DoSync(this.m_smpContents, var1, "SyncThread");
- this.sync_thread.start();
- }
- }
-
- public void init() {
- System.out.println("!!!Applet Init!!!");
- if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
- this.myrun();
- }
-
- }
-
- public boolean GoPrev(Object var1) {
- if (this.m_pnlTabs == null) {
- return false;
- } else {
- for(int var2 = 0; var2 < this.m_pnlTabs.getComponentCount(); ++var2) {
- if (this.m_pnlTabs.getComponent(var2) == var1) {
- if (var2 != 0) {
- this.notifyButtonPushEvent(new ButtonPushEvent(this.m_pnlTabs.getComponent(var2 - 1), 0, 0));
- return true;
- }
-
- return false;
- }
- }
-
- return false;
- }
- }
-
- public synchronized void resizeForNS(int var1, int var2) {
- try {
- if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
- ((Component)this).getParent().reshape(0, 0, var1, var2);
- }
-
- super.reshape(0, 0, var1, var2);
- ((Container)this).validate();
- } catch (Exception var4) {
- ((Throwable)var4).printStackTrace();
- }
- }
-
- private void DoRelatedTopics(boolean var1) {
- ((Applet)this).showStatus("Loading Related Topics Button...");
- String var2 = ((Applet)this).getParameter("Button");
- String var3 = ((Applet)this).getParameter("Text");
- String var4 = ((Applet)this).getParameter("Frame");
- if (var1 && System.getProperty("os.name").startsWith("SunOS")) {
- var1 = false;
- }
-
- boolean var5 = var2 == null && var3 == null;
- String var6 = "";
- if (!var5) {
- var6 = var2 != null ? var2 : var3;
- }
-
- Vector var7 = new Vector();
- int var8 = 0;
-
- String var9;
- while((var9 = ((Applet)this).getParameter("Item" + (var8 + 1))) != null) {
- IndexSecondaryEntry var10 = new IndexSecondaryEntry();
- int var11 = var9.indexOf(59);
- if (var11 != -1 && var11 != var9.length() - 1) {
- int var12 = var9.indexOf(59, var11 + 1);
- String var13 = var9.substring(0, var11);
- String var14 = var12 == -1 ? var9.substring(var11 + 1) : var9.substring(var11 + 1, var12);
- String var15 = var12 == -1 ? null : var9.substring(var11 + 1);
- var10.name = var13;
- var10.local = var14;
- var10.url = var15;
- var10.frame = var4;
- var7.addElement(var10);
- ++var8;
- }
- }
-
- if (var8 != 0) {
- if (var1) {
- PopupMenu var17 = new PopupMenu(this, var7);
- this.m_winFrameToShow = var17;
- } else {
- IndexSecondaryDialog var18 = new IndexSecondaryDialog(this, var7, (DialogDoneTarget)null, this);
- this.m_winFrameToShow = var18;
- }
-
- if (!var5) {
- Object var16;
- if (var2 != null) {
- var16 = new ButtonLauncher(var6, this.m_winFrameToShow);
- } else {
- var16 = new LabelLauncher(var6, this.m_winFrameToShow);
- }
-
- ((Container)this).setLayout(new BorderLayout());
- ((Container)this).add("Center", (Component)var16);
- }
-
- }
- }
-
- private boolean _checkAccess() {
- if (System.getProperty("java.vendor").startsWith("Netscape") && (System.getProperty("os.name").startsWith("Windows") || System.getProperty("os.name").startsWith("Mac"))) {
- try {
- if (((Applet)this).getParameter("BrowserVersion") == null || !((Applet)this).getParameter("BrowserVersion").equalsIgnoreCase("4.6")) {
- JSObject.getWindow(this);
- this.m_bCanAccessJSObject = true;
- }
- } catch (Exception var2) {
- System.gc();
- ((Throwable)var2).printStackTrace();
- }
- }
-
- return this.m_bCanAccessJSObject;
- }
-
- private void redirect(URL var1, String var2) {
- if (this.m_bCanAccessJSObject) {
- try {
- JSObject var3 = JSObject.getWindow(this);
- var3.eval("window.open(\"" + var1.toString() + "\", \"" + var2 + "\");");
- } catch (Exception var4) {
- ((Throwable)var4).printStackTrace();
- }
- } else {
- try {
- ((Applet)this).getAppletContext().showDocument(var1, var2);
- } catch (Exception var5) {
- ((Throwable)var5).printStackTrace();
- }
- }
- }
- }
-