webhelp

16:53:56.416 INFO  jd.cli.Main - Decompiling webhelp.jar
import java.util.Vector;

class CommandBuffer
{
  private Vector m_vCommand = new Vector();
  
  public synchronized void putCommand(WhCommand paramWhCommand)
  {
    m_vCommand.addElement(paramWhCommand);
  }
  
  public synchronized WhCommand getCommand()
  {
    if (m_vCommand.size() > 0)
    {
      WhCommand localWhCommand = (WhCommand)m_vCommand.elementAt(0);
      m_vCommand.removeElementAt(0);
      return localWhCommand;
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     CommandBuffer
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
import java.applet.Applet;
import netscape.javascript.JSObject;

class WebHelp$JavaScriptAccess
{
  Applet m_a;
  final WebHelp this$0;
  
  WebHelp$JavaScriptAccess(WebHelp paramWebHelp, Applet paramApplet)
  {
    (this$0 = paramWebHelp).getClass();
    m_a = paramApplet;
  }
  
  public int GetHeight(int paramInt)
  {
    try
    {
      JSObject localJSObject = JSObject.getWindow(m_a);
      Double localDouble = Double.valueOf(localJSObject.eval("innerHeight").toString());
      return localDouble.intValue();
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return paramInt;
  }
  
  public int GetWidth(int paramInt)
  {
    try
    {
      JSObject localJSObject = JSObject.getWindow(m_a);
      Double localDouble = Double.valueOf(localJSObject.eval("innerWidth").toString());
      return localDouble.intValue();
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return paramInt;
  }
}

/* Location:
 * Qualified Name:     WebHelp.JavaScriptAccess
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
import BsscXML.BsscXML;
import XMLConsumer.Consumer;
import XMLConsumer.Project;
import hhapplet.BsscHelpCommandAdapter;
import hhapplet.BsscHelpRedirector;
import hhapplet.ButtonPushEvent;
import hhapplet.ButtonPushEventListener;
import hhapplet.CanvasButton;
import hhapplet.FtsView;
import hhapplet.FtsViewSkin;
import hhapplet.GloViewSkin;
import hhapplet.GlossaryView;
import hhapplet.ImageCache;
import hhapplet.IndexView;
import hhapplet.IndexViewSkin;
import hhapplet.PaneSetting;
import hhapplet.ResourceLib;
import hhapplet.TabButton;
import hhapplet.TabManagerAdaper;
import hhapplet.TabPanel;
import hhapplet.TocView;
import hhapplet.TocViewSkin;
import hhapplet.URLFileHandler;
import java.applet.Applet;
import java.applet.AppletContext;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Event;
import java.awt.Graphics;
import java.awt.Panel;
import java.awt.Rectangle;
import java.io.PrintStream;
import java.net.URL;
import java.util.Enumeration;
import java.util.Vector;
import netscape.javascript.JSObject;

public class WebHelp
  extends Applet
  implements ButtonPushEventListener, BsscHelpCommandAdapter, TabManagerAdaper, Runnable
{
  private static final String STR_APPLET_ID = "WebHelp Applet Version 5.00.000";
  private static final String STR_COPYRIGHT = "Copyright (c) 1998-2001 eHelp Corporation. All rights reserved.";
  private boolean m_bShowTab = true;
  private String m_strProjectFile = null;
  private TocView m_tocView = null;
  private IndexView m_indexView = null;
  private FtsView m_ftsView = null;
  private GlossaryView m_gloView = null;
  private Panel m_pnlNav = null;
  private TabPanel m_pnlTabs = null;
  private CardLayout m_clLayout = null;
  private TabButton[] m_abtns;
  private CommandBuffer m_commandBuffer;
  private String m_sLangId = "";
  private boolean m_bMustHaveSize = false;
  boolean m_bCanAccessJSObject = false;
  private boolean m_bCanAccessJSObjectChecked = false;
  private Thread m_CommandThread = null;
  private Vector m_vProjects;
  private PaneSetting m_tocPaneSetting;
  private PaneSetting m_idxPaneSetting;
  private PaneSetting m_ftsPaneSetting;
  private PaneSetting m_gloPaneSetting;
  private int m_nFirstPane;
  private static final int m_nMaxPanes = 4;
  
  public void stop()
  {
    System.out.println("!!!Applet Stop!!!");
    if ((System.getProperty("java.vendor").indexOf("Netscape") != -1) && (CanQueryHeighAndWidthForNS())) {
      try
      {
        JSObject localJSObject = JSObject.getWindow(this);
        localJSObject.setMember("gbLoading", "Phase1");
      }
      catch (Exception localException1)
      {
        localException1.printStackTrace();
      }
    }
    try
    {
      if (m_CommandThread != null)
      {
        new WhCommand("Quit", null, null);
        m_CommandThread.stop();
      }
      System.gc();
      Runtime.getRuntime().gc();
      return;
    }
    catch (Exception localException2)
    {
      localException2.printStackTrace();
    }
  }
  
  public boolean gotFocus(Event paramEvent, Object paramObject)
  {
    nextFocus();
    return true;
  }
  
  public void notifyButtonPushEvent(ButtonPushEvent paramButtonPushEvent)
  {
    if ((m_tocPaneSetting != null) && (paramButtonPushEvent.getSource() == m_abtns[m_tocPaneSetting.getIndex()]))
    {
      DoContents();
      return;
    }
    if ((m_idxPaneSetting != null) && (paramButtonPushEvent.getSource() == m_abtns[m_idxPaneSetting.getIndex()]))
    {
      DoIndex();
      return;
    }
    if ((m_ftsPaneSetting != null) && (paramButtonPushEvent.getSource() == m_abtns[m_ftsPaneSetting.getIndex()]))
    {
      DoSearch("");
      return;
    }
    if ((m_gloPaneSetting != null) && (paramButtonPushEvent.getSource() == m_abtns[m_gloPaneSetting.getIndex()])) {
      DoGlossary();
    }
  }
  
  private void activeTabButton(int paramInt)
  {
    int i = 0;
    do
    {
      if (m_abtns[i] != null)
      {
        if (i != paramInt)
        {
          m_abtns[i].disactive();
          if (i == paramInt - 1) {
            m_abtns[i].SetDrawRight(false);
          } else {
            m_abtns[i].SetDrawRight(true);
          }
          if (i == paramInt + 1) {
            m_abtns[i].SetDrawLeft(false);
          } else {
            m_abtns[i].SetDrawLeft(true);
          }
        }
        else
        {
          m_abtns[i].active();
        }
        m_abtns[i].repaint(0L);
      }
      i++;
    } while (i < 4);
  }
  
  public boolean CanQueryHeighAndWidthForNS()
  {
    if (m_bCanAccessJSObjectChecked) {
      return m_bCanAccessJSObject;
    }
    m_bCanAccessJSObjectChecked = true;
    return _checkAccess();
  }
  
  public void start()
  {
    System.out.println("!!!Applet Start!!!");
    try
    {
      if (m_bMustHaveSize) {
        checkSize();
      }
      m_CommandThread = new Thread(this);
      m_CommandThread.start();
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    if (System.getProperty("java.vendor").indexOf("Netscape") == -1) {
      myrun();
    }
  }
  
  public String getAppletInfo()
  {
    return "WebHelp Applet Version 5.00.000" + "\r\n" + "Copyright (c) 1998-2001 eHelp Corporation. All rights reserved.";
  }
  
  private void DoGlossary()
  {
    if (m_gloPaneSetting != null)
    {
      activeTabButton(m_gloPaneSetting.getIndex());
      if (m_pnlNav == null)
      {
        m_clLayout = new CardLayout();
        m_pnlNav = new Panel();
        m_pnlNav.setLayout(m_clLayout);
        add("Center", m_pnlNav);
      }
      m_bMustHaveSize = true;
      if (m_gloView == null)
      {
        GloViewSkin localGloViewSkin = (GloViewSkin)m_gloPaneSetting.getViewSkin();
        m_gloView = new GlossaryView(m_vProjects, localGloViewSkin);
        m_pnlNav.add(ResourceLib.GetRes("Glossary"), m_gloView);
        showStatus(ResourceLib.GetRes("LoadingGlossary"));
      }
      m_clLayout.show(m_pnlNav, ResourceLib.GetRes("Glossary"));
      repaint();
      RepaintTabs();
      if (m_gloView != null) {
        m_gloView.requestFocus();
      }
    }
  }
  
  public void reshape(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    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 (CanQueryHeighAndWidthForNS())
        {
          WebHelp.JavaScriptAccess localJavaScriptAccess = new WebHelp.JavaScriptAccess(this);
          paramInt4 = localJavaScriptAccess.GetHeight(paramInt4);
          paramInt3 = localJavaScriptAccess.GetWidth(paramInt3);
          if (!m_bShowTab) {
            try
            {
              if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
                getParent().reshape(paramInt1, paramInt2, paramInt3, paramInt4);
              }
            }
            catch (Exception localException2)
            {
              localException2.printStackTrace();
            }
          }
          super.reshape(paramInt1, paramInt2, paramInt3, paramInt4);
          validate();
          return;
        }
        super.reshape(paramInt1, paramInt2, paramInt3, paramInt4);
        return;
      }
      super.reshape(paramInt1, paramInt2, paramInt3, paramInt4);
      validate();
      return;
    }
    catch (Exception localException1)
    {
      localException1.printStackTrace();
    }
  }
  
  private void DoNavPane()
  {
    setBackground(new Color(192, 192, 192));
    setLayout(new BorderLayout());
    m_strProjectFile = getParameter("ProjectFile");
    if ((m_strProjectFile != null) && (m_strProjectFile.length() > 0)) {
      loadProject(m_strProjectFile);
    }
    String str1 = getParameter("HideTabs");
    if ((str1 != null) && (str1.toUpperCase().compareTo("TRUE") == 0)) {
      m_bShowTab = false;
    } else {
      m_bShowTab = true;
    }
    String str2 = null;
    str2 = getParameter("ContentsTab");
    if (str2 == null) {
      str2 = ResourceLib.GetRes("Contents");
    }
    String str3 = null;
    str3 = getParameter("IndexTab");
    if (str3 == null) {
      str3 = ResourceLib.GetRes("Index");
    }
    String str4 = null;
    str4 = getParameter("SearchTab");
    if (str4 == null) {
      str4 = ResourceLib.GetRes("Search");
    }
    String str5 = null;
    str5 = getParameter("GlossaryTab");
    if (str5 == null) {
      str5 = ResourceLib.GetRes("Glossary");
    }
    m_pnlTabs = null;
    m_pnlTabs = new TabPanel();
    m_pnlTabs.setLayout(null);
    m_abtns = new TabButton[4];
    TabButton localTabButton;
    if (m_tocPaneSetting != null)
    {
      localTabButton = new TabButton(str2, this);
      localTabButton.addButtonPushEventListener(this);
      if (4 > m_tocPaneSetting.getIndex()) {
        m_abtns[m_tocPaneSetting.getIndex()] = localTabButton;
      }
    }
    if (m_idxPaneSetting != null)
    {
      localTabButton = new TabButton(str3, this);
      localTabButton.addButtonPushEventListener(this);
      if (4 > m_idxPaneSetting.getIndex()) {
        m_abtns[m_idxPaneSetting.getIndex()] = localTabButton;
      }
    }
    if (m_ftsPaneSetting != null)
    {
      localTabButton = new TabButton(str4, this);
      localTabButton.addButtonPushEventListener(this);
      if (4 > m_ftsPaneSetting.getIndex()) {
        m_abtns[m_ftsPaneSetting.getIndex()] = localTabButton;
      }
    }
    if (m_gloPaneSetting != null)
    {
      localTabButton = new TabButton(str5, this);
      localTabButton.addButtonPushEventListener(this);
      if (4 > m_gloPaneSetting.getIndex()) {
        m_abtns[m_gloPaneSetting.getIndex()] = localTabButton;
      }
    }
    int i = 0;
    do
    {
      if (m_abtns[i] != null) {
        m_pnlTabs.add(m_abtns[i]);
      }
      i++;
    } while (i < 4);
    if (m_bShowTab) {
      add("North", m_pnlTabs);
    }
    Rectangle localRectangle = bounds();
    int j = 1;
    int k = 0;
    do
    {
      if (m_abtns[k] != null)
      {
        rods_reshape(m_abtns[k], j, y, m_abtns[k].preferredSize().width, 25);
        j += m_abtns[k].bounds().width;
      }
      k++;
    } while (k < 4);
    rods_reshape(m_pnlTabs, x, y, width, 28);
    m_pnlTabs.requestFocus();
    k = 0;
    do
    {
      if (m_abtns[k] != null) {
        m_abtns[k].active();
      }
      k++;
    } while (k < 4);
    k = 0;
    do
    {
      if (m_abtns[k] != null) {
        m_abtns[k].disactive();
      }
      k++;
    } while (k < 4);
    if (m_abtns[m_nFirstPane] != null)
    {
      ButtonPushEvent localButtonPushEvent = null;
      localButtonPushEvent = new ButtonPushEvent(m_abtns[m_nFirstPane], 0, 0);
      notifyButtonPushEvent(localButtonPushEvent);
    }
  }
  
  public void Command(String paramString1, String paramString2)
  {
    Command(paramString1, paramString2, null);
  }
  
  public synchronized void Command(String paramString1, String paramString2, String paramString3)
  {
    if (m_commandBuffer != null)
    {
      WhCommand localWhCommand = new WhCommand(paramString1, paramString2, paramString3);
      m_commandBuffer.putCommand(localWhCommand);
    }
  }
  
  public void Command(String paramString)
  {
    Command(paramString, null, null);
  }
  
  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"));
      return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
  
  public void paint(Graphics paramGraphics)
  {
    System.out.println("!!!Applet paint!!!");
    super.paint(paramGraphics);
  }
  
  public void destroy()
  {
    System.out.println("!!!Applet Destroy!!!");
    try
    {
      System.gc();
      Runtime.getRuntime().gc();
      return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
  
  protected void rods_reshape(Component paramComponent, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    paramComponent.move(paramInt1, paramInt2);
    paramComponent.resize(paramInt3, paramInt4);
  }
  
  private void DoContents()
  {
    if (m_tocPaneSetting != null)
    {
      activeTabButton(m_tocPaneSetting.getIndex());
      if (m_pnlNav == null)
      {
        m_clLayout = new CardLayout();
        m_pnlNav = new Panel();
        m_pnlNav.setLayout(m_clLayout);
        add("Center", m_pnlNav);
      }
      m_bMustHaveSize = true;
      RepaintTabs();
      if (m_tocView == null)
      {
        TocViewSkin localTocViewSkin = (TocViewSkin)m_tocPaneSetting.getViewSkin();
        m_tocView = new TocView(m_vProjects, localTocViewSkin);
        m_pnlNav.add(ResourceLib.GetRes("Contents"), m_tocView);
        showStatus(ResourceLib.GetRes("LoadingContents"));
      }
      m_clLayout.show(m_pnlNav, ResourceLib.GetRes("Contents"));
      if (m_tocView != null) {
        m_tocView.requestFocus();
      }
    }
  }
  
  public void resize(int paramInt1, int paramInt2)
  {
    System.out.println("!!!Applet Resize!!!");
    if (System.getProperty("java.vendor").indexOf("Netscape") != -1)
    {
      if (CanQueryHeighAndWidthForNS()) {
        try
        {
          JSObject localJSObject1 = JSObject.getWindow(this);
          localJSObject1.setMember("gbLoading", "Phase1");
        }
        catch (Exception localException1)
        {
          localException1.printStackTrace();
        }
      }
    }
    else if ((System.getProperty("java.vendor").indexOf("Microsoft") != -1) && (System.getProperty("java.version").startsWith("1.1"))) {
      try
      {
        JSObject localJSObject2 = JSObject.getWindow(this);
        localJSObject2.setMember("gbLoading", "Phase1");
      }
      catch (Exception localException2)
      {
        localException2.printStackTrace();
      }
    }
    try
    {
      if (CanQueryHeighAndWidthForNS())
      {
        WebHelp.JavaScriptAccess localJavaScriptAccess = new WebHelp.JavaScriptAccess(this);
        paramInt2 = localJavaScriptAccess.GetHeight(paramInt2);
        paramInt1 = localJavaScriptAccess.GetWidth(paramInt1);
      }
      super.resize(paramInt1, paramInt2);
      return;
    }
    catch (Exception localException3)
    {
      localException3.printStackTrace();
    }
  }
  
  public synchronized boolean checkSize()
  {
    if ((boundswidth == 0) && (boundsheight == 0))
    {
      String str1 = getDocumentBase().toString();
      int i = str1.lastIndexOf(".");
      String str2 = str1.substring(i, str1.length());
      str1 = str1.substring(0, i);
      str1 = str1 + "f" + str2;
      try
      {
        URL localURL = new URL(str1);
        getAppletContext().showDocument(localURL, "_self");
        return false;
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
      }
    }
    return true;
  }
  
  private void DoSearch(String paramString)
  {
    if (m_ftsPaneSetting != null)
    {
      activeTabButton(m_ftsPaneSetting.getIndex());
      if (m_pnlNav == null)
      {
        m_clLayout = new CardLayout();
        m_pnlNav = new Panel();
        m_pnlNav.setLayout(m_clLayout);
        add("Center", m_pnlNav);
      }
      m_bMustHaveSize = true;
      if (m_ftsView == null)
      {
        FtsViewSkin localFtsViewSkin = (FtsViewSkin)m_ftsPaneSetting.getViewSkin();
        m_ftsView = new FtsView(m_vProjects, localFtsViewSkin);
        m_pnlNav.add(ResourceLib.GetRes("Search"), m_ftsView);
        showStatus(ResourceLib.GetRes("LoadingFTS"));
      }
      if ((paramString != null) && (paramString.length() != 0)) {
        m_ftsView.setSearchString(paramString);
      }
      m_clLayout.show(m_pnlNav, ResourceLib.GetRes("Search"));
      repaint();
      RepaintTabs();
      if (m_ftsView != null) {
        m_ftsView.requestFocus();
      }
    }
  }
  
  public void myrun()
  {
    try
    {
      System.gc();
      Runtime.getRuntime().gc();
      ImageCache.createInstance(this);
      BsscXML.setDocumentBase(getDocumentBase());
      ResourceLib.InitRes();
      String str1 = getParameter("ResourceFile");
      if (str1 != null) {
        ResourceLib.LoadResource(str1);
      }
      m_tocPaneSetting = ResourceLib.getPaneSetting("toc");
      m_idxPaneSetting = ResourceLib.getPaneSetting("index");
      m_ftsPaneSetting = ResourceLib.getPaneSetting("fts");
      m_gloPaneSetting = ResourceLib.getPaneSetting("glossary");
      m_nFirstPane = ResourceLib.getFirstShowPaneIndex();
      String str2 = getParameter("Frame");
      if (str2 == null) {
        str2 = "bsscright";
      }
      BsscHelpRedirector.initRedirector(this, str2);
      DoNavPane();
      show();
      return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
  
  private void RepaintTabs()
  {
    if (m_bShowTab)
    {
      if (m_pnlNav != null) {
        m_pnlNav.paintAll(m_pnlNav.getGraphics());
      }
      int i = 0;
      do
      {
        if (m_abtns[i] != null) {
          m_abtns[i].paint(m_abtns[i].getGraphics());
        }
        i++;
      } while (i < 4);
    }
  }
  
  private void DoIndex()
  {
    if (m_idxPaneSetting != null)
    {
      activeTabButton(m_idxPaneSetting.getIndex());
      if (m_pnlNav == null)
      {
        m_clLayout = new CardLayout();
        m_pnlNav = new Panel();
        m_pnlNav.setLayout(m_clLayout);
        add("Center", m_pnlNav);
      }
      m_bMustHaveSize = true;
      if (m_indexView == null)
      {
        IndexViewSkin localIndexViewSkin = (IndexViewSkin)m_idxPaneSetting.getViewSkin();
        m_indexView = new IndexView(m_vProjects, localIndexViewSkin);
        m_pnlNav.add(ResourceLib.GetRes("Index"), m_indexView);
        showStatus(ResourceLib.GetRes("LoadingIndex"));
      }
      m_clLayout.show(m_pnlNav, ResourceLib.GetRes("Index"));
      m_pnlNav.paintAll(m_pnlNav.getGraphics());
      RepaintTabs();
      if (m_indexView != null) {
        m_indexView.requestFocus();
      }
    }
  }
  
  public boolean GoNext(Object paramObject)
  {
    if (m_pnlTabs == null) {
      return false;
    }
    for (int i = 0; i < m_pnlTabs.getComponentCount(); i++) {
      if (m_pnlTabs.getComponent(i) == paramObject)
      {
        if (i != m_pnlTabs.getComponentCount() - 1)
        {
          Component localComponent = m_pnlTabs.getComponent(i + 1);
          localComponent.requestFocus();
          notifyButtonPushEvent(new ButtonPushEvent(localComponent, 0, 0));
          return true;
        }
        return false;
      }
    }
    return false;
  }
  
  private void DoSync(String paramString1, String paramString2)
  {
    if (m_tocView != null) {
      m_tocView.sync(paramString1, paramString2);
    }
  }
  
  public void run()
  {
    for (;;)
    {
      try
      {
        WhCommand localWhCommand = null;
        continue;
        Thread.currentThread();
        Thread.sleep(100L);
        if ((localWhCommand = m_commandBuffer.getCommand()) != null)
        {
          String str1 = localWhCommand.getName();
          String str2 = localWhCommand.getParam0();
          String str3 = localWhCommand.getParam1();
          if (str1.equalsIgnoreCase("SyncToc")) {
            DoSync(str2, str3);
          } else if (str1.equalsIgnoreCase("Contents")) {
            DoContents();
          } else if (str1.equalsIgnoreCase("Index")) {
            DoIndex();
          } else if (str1.equalsIgnoreCase("Search")) {
            DoSearch(str2);
          } else if (str1.equalsIgnoreCase("Glossary")) {
            DoGlossary();
          } else if (str1.equalsIgnoreCase("Quit")) {
            return;
          }
        }
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
      }
    }
  }
  
  public void init()
  {
    m_commandBuffer = new CommandBuffer();
    System.out.println("!!!Applet Init!!!");
    if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
      myrun();
    }
  }
  
  public boolean GoPrev(Object paramObject)
  {
    if (m_pnlTabs == null) {
      return false;
    }
    for (int i = 0; i < m_pnlTabs.getComponentCount(); i++) {
      if (m_pnlTabs.getComponent(i) == paramObject)
      {
        if (i != 0)
        {
          Component localComponent = m_pnlTabs.getComponent(i - 1);
          localComponent.requestFocus();
          notifyButtonPushEvent(new ButtonPushEvent(localComponent, 0, 0));
          return true;
        }
        return false;
      }
    }
    return false;
  }
  
  public synchronized void resizeForNS(int paramInt1, int paramInt2)
  {
    try
    {
      if (System.getProperty("java.vendor").indexOf("Netscape") != -1) {
        getParent().reshape(0, 0, paramInt1, paramInt2);
      }
      super.reshape(0, 0, paramInt1, paramInt2);
      validate();
      return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
  
  private boolean _checkAccess()
  {
    if ((System.getProperty("java.vendor").startsWith("Netscape")) && ((System.getProperty("os.name").startsWith("Windows")) || (System.getProperty("os.name").startsWith("Mac")))) {
      try
      {
        if ((getParameter("BrowserVersion") == null) || (!getParameter("BrowserVersion").equalsIgnoreCase("4.6")))
        {
          JSObject.getWindow(this);
          m_bCanAccessJSObject = true;
        }
      }
      catch (Exception localException)
      {
        System.gc();
        localException.printStackTrace();
      }
    }
    return m_bCanAccessJSObject;
  }
  
  public void loadProject(String paramString)
  {
    try
    {
      Project.setFileName(paramString);
      m_vProjects = new Vector();
      URL localURL1 = URLFileHandler.makeURL(BsscXML.getDocumentBase(), paramString, null);
      m_vProjects.addElement(new Project(localURL1));
      int i = 0;
      do
      {
        Project localProject = (Project)m_vProjects.elementAt(i);
        try
        {
          localProject.process();
          if (i == 0)
          {
            m_sLangId = localProject.getLangId();
          }
          else
          {
            localObject1 = localProject.getLangId();
            if ((((String)localObject1).length() != 0) && (!m_sLangId.equals(localObject1))) {
              System.out.println("The Project:" + localProject.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");
            }
          }
          Object localObject1 = localProject.getURL();
          Vector localVector = localProject.getRemoteProject();
          Enumeration localEnumeration1 = localVector.elements();
          while (localEnumeration1.hasMoreElements())
          {
            Object localObject2 = localEnumeration1.nextElement();
            if ((localObject2 instanceof String))
            {
              URL localURL2 = URLFileHandler.makeURL((URL)localObject1, (String)localObject2 + paramString, null);
              int j = 0;
              Enumeration localEnumeration2 = m_vProjects.elements();
              while (localEnumeration2.hasMoreElements())
              {
                Object localObject3 = localEnumeration2.nextElement();
                if (((localObject3 instanceof Project)) && (((Project)localObject3).getURL().equals(localURL2)))
                {
                  j = 1;
                  break;
                }
              }
              if (j == 0) {
                m_vProjects.addElement(new Project(localURL2));
              }
            }
          }
          i++;
        }
        catch (Exception localException2)
        {
          m_vProjects.removeElementAt(i);
          localException2.printStackTrace();
        }
      } while (i < m_vProjects.size());
      System.out.println("Well done!");
      return;
    }
    catch (Exception localException1)
    {
      localException1.printStackTrace();
    }
  }
  
  class JavaScriptAccess
  {
    Applet m_a;
    final WebHelp this$0;
    
    JavaScriptAccess(Applet paramApplet)
    {
      (this$0 = this$1).getClass();
      m_a = paramApplet;
    }
    
    public int GetHeight(int paramInt)
    {
      try
      {
        JSObject localJSObject = JSObject.getWindow(m_a);
        Double localDouble = Double.valueOf(localJSObject.eval("innerHeight").toString());
        return localDouble.intValue();
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
      }
      return paramInt;
    }
    
    public int GetWidth(int paramInt)
    {
      try
      {
        JSObject localJSObject = JSObject.getWindow(m_a);
        Double localDouble = Double.valueOf(localJSObject.eval("innerWidth").toString());
        return localDouble.intValue();
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
      }
      return paramInt;
    }
  }
}

/* Location:
 * Qualified Name:     WebHelp
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
class WhCommand
{
  private String m_sName;
  private String m_sParam0;
  private String m_sParam1;
  
  public String getParam0()
  {
    return m_sParam0;
  }
  
  public WhCommand(String paramString1, String paramString2, String paramString3)
  {
    m_sName = paramString1;
    m_sParam0 = paramString2;
    m_sParam1 = paramString3;
  }
  
  public String getParam1()
  {
    return m_sParam1;
  }
  
  public String getName()
  {
    return m_sName;
  }
}

/* Location:
 * Qualified Name:     WhCommand
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package BsscXML;

import hhapplet.URLFileHandler;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.zip.ZipInputStream;

public class BsscXML
{
  public static URL m_url = null;
  
  public static IBsscXMLElementBuilder createElement(String paramString)
  {
    return new BsscXMLElement(paramString);
  }
  
  public static URL getDocumentBase()
  {
    return m_url;
  }
  
  public static void setDocumentBase(URL paramURL)
  {
    m_url = paramURL;
  }
  
  public static boolean isSameURL(String paramString1, String paramString2)
  {
    URL localURL1;
    URL localURL2;
    try
    {
      localURL1 = URLFileHandler.makeURL(m_url, paramString1, null);
      localURL2 = URLFileHandler.makeURL(m_url, paramString2, null);
    }
    catch (MalformedURLException localMalformedURLException)
    {
      return false;
    }
    return localURL1.equals(localURL2);
  }
  
  public static void parseXML(IBsscXMLConsumer paramIBsscXMLConsumer, URL paramURL, boolean paramBoolean)
  {
    try
    {
      Object localObject1;
      if (paramURL.toString().endsWith(".zip"))
      {
        localObject2 = paramURL.openStream();
        localObject1 = new ZipInputStream((InputStream)localObject2);
      }
      else
      {
        localObject1 = paramURL.openStream();
      }
      Object localObject2 = new InputStreamReader((InputStream)localObject1);
      BufferedReader localBufferedReader = new BufferedReader((Reader)localObject2);
      BsscXMLParser localBsscXMLParser = new BsscXMLParser(paramIBsscXMLConsumer);
      localBsscXMLParser.setSource(localBufferedReader);
      if (paramBoolean)
      {
        localBsscXMLParser.parse();
        return;
      }
      Thread localThread = new Thread(localBsscXMLParser);
      localThread.start();
      return;
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
    }
  }
}

/* Location:
 * Qualified Name:     BsscXML.BsscXML
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package BsscXML;

import java.util.Enumeration;
import java.util.Vector;

public class BsscXMLConsumerChain
  implements IBsscXMLConsumer
{
  private Vector m_vecConsumer = null;
  
  public BsscXMLConsumerChain()
  {
    m_vecConsumer.removeAllElements();
  }
  
  public boolean add(IBsscXMLConsumer paramIBsscXMLConsumer)
  {
    m_vecConsumer.addElement(paramIBsscXMLConsumer);
    return true;
  }
  
  public void consume(IBsscXMLElementReader paramIBsscXMLElementReader)
  {
    Enumeration localEnumeration = m_vecConsumer.elements();
    while (localEnumeration.hasMoreElements())
    {
      Object localObject = localEnumeration.nextElement();
      if ((localObject instanceof IBsscXMLConsumer)) {
        ((IBsscXMLConsumer)localObject).consume(paramIBsscXMLElementReader);
      }
    }
  }
  
  public boolean remove(IBsscXMLConsumer paramIBsscXMLConsumer)
  {
    return m_vecConsumer.removeElement(paramIBsscXMLConsumer);
  }
}

/* Location:
 * Qualified Name:     BsscXML.BsscXMLConsumerChain
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package BsscXML;

public class BsscXMLDocument
  implements IBsscXMLDocumentBuilder, IBsscXMLDocumentReader
{
  BsscXMLElement m_root = null;
  BsscXMLConsumerChain m_ConsumerChain = null;
  
  public void setRoot(IBsscXMLElementBuilder paramIBsscXMLElementBuilder)
    throws BsscXMLException
  {
    if (m_root == null)
    {
      if ((paramIBsscXMLElementBuilder instanceof BsscXMLElement))
      {
        m_root = ((BsscXMLElement)paramIBsscXMLElementBuilder);
        return;
      }
      throw new BsscXMLException("Type Mismatch!");
    }
    throw new BsscXMLException("Only one Root element is allowed!");
  }
  
  public IBsscXMLElementReader getRoot()
  {
    return m_root;
  }
  
  public void setReady(boolean paramBoolean)
  {
    if (m_ConsumerChain != null) {
      m_ConsumerChain.consume(m_root);
    }
  }
  
  public void removeConsumer(IBsscXMLConsumer paramIBsscXMLConsumer)
  {
    if (m_ConsumerChain != null) {
      m_ConsumerChain.remove(paramIBsscXMLConsumer);
    }
  }
  
  public void addConsumer(IBsscXMLConsumer paramIBsscXMLConsumer)
  {
    if (m_ConsumerChain == null) {
      m_ConsumerChain = new BsscXMLConsumerChain();
    }
    m_ConsumerChain.add(paramIBsscXMLConsumer);
  }
}

/* Location:
 * Qualified Name:     BsscXML.BsscXMLDocument
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package BsscXML;

import java.util.Hashtable;
import java.util.Vector;

public class BsscXMLElement
  implements IBsscXMLElementBuilder, IBsscXMLElementReader
{
  private BsscXMLElement m_oParent = null;
  private Vector m_vChildren = null;
  private Hashtable m_hAttr = null;
  private String m_sValue = null;
  private String m_sName = null;
  
  public int findChild(IBsscXMLElementReader paramIBsscXMLElementReader)
  {
    if ((paramIBsscXMLElementReader instanceof BsscXMLElement)) {
      return m_vChildren.indexOf((BsscXMLElement)paramIBsscXMLElementReader);
    }
    return -1;
  }
  
  public IBsscXMLElementReader getChild(int paramInt)
  {
    IBsscXMLElementReader localIBsscXMLElementReader = null;
    try
    {
      localIBsscXMLElementReader = (IBsscXMLElementReader)m_vChildren.elementAt(paramInt);
    }
    catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) {}
    return localIBsscXMLElementReader;
  }
  
  public void setAttribute(String paramString1, String paramString2)
  {
    m_hAttr.put(paramString1, paramString2);
  }
  
  public void setValue(String paramString)
  {
    m_sValue = paramString;
  }
  
  public String getValue()
  {
    return m_sValue;
  }
  
  public String getAttribute(String paramString)
  {
    return (String)m_hAttr.get(paramString);
  }
  
  public IBsscXMLElementReader getNextSibling()
  {
    if (m_oParent != null)
    {
      int i = m_oParent.findChild(this);
      if (i != -1) {
        return m_oParent.getChild(i + 1);
      }
      return null;
    }
    return null;
  }
  
  public void setParent(IBsscXMLElementBuilder paramIBsscXMLElementBuilder)
    throws BsscXMLException
  {
    if ((paramIBsscXMLElementBuilder instanceof BsscXMLElement))
    {
      if (m_oParent == null)
      {
        m_oParent = ((BsscXMLElement)paramIBsscXMLElementBuilder);
        return;
      }
      throw new BsscXMLException("Internal Error!");
    }
    throw new BsscXMLException("Type Mismatch!");
  }
  
  public IBsscXMLElementReader getParent()
  {
    return m_oParent;
  }
  
  public BsscXMLElement(String paramString)
  {
    m_sName = paramString;
    m_vChildren = new Vector();
    m_hAttr = new Hashtable();
    m_sValue = "";
  }
  
  public IBsscXMLElementReader getPrevSibling()
  {
    if (m_oParent != null)
    {
      int i = m_oParent.findChild(this);
      if (i != -1) {
        return m_oParent.getChild(i - 1);
      }
      return null;
    }
    return null;
  }
  
  public boolean checkName(String paramString)
  {
    if ((paramString == null) || (paramString.length() == 0)) {
      return true;
    }
    return paramString.equals(m_sName);
  }
  
  public void addChild(IBsscXMLElementBuilder paramIBsscXMLElementBuilder)
    throws BsscXMLException
  {
    if ((paramIBsscXMLElementBuilder instanceof BsscXMLElement))
    {
      m_vChildren.addElement((BsscXMLElement)paramIBsscXMLElementBuilder);
      return;
    }
    throw new BsscXMLException("Type Mismatch!");
  }
  
  public String getName()
  {
    return m_sName;
  }
}

/* Location:
 * Qualified Name:     BsscXML.BsscXMLElement
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package BsscXML;

public class BsscXMLException
  extends Exception
{
  static final String TYPE_MISMATCH = "Type Mismatch!";
  static final String NOT_ONE_ROOT = "Only one Root element is allowed!";
  static final String INTERNAL_ERROR = "Internal Error!";
  static final String DOCUMENTEND_INPROPERLY = "Wrong XML Format!";
  static final String BAD_XML_FORMAT = "Bad XML Format!";
  
  BsscXMLException() {}
  
  BsscXMLException(String paramString)
  {
    super(paramString);
  }
}

/* Location:
 * Qualified Name:     BsscXML.BsscXMLException
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package BsscXML;

import java.io.IOException;
import java.io.Reader;
import java.util.Stack;

public class BsscXMLParser
  implements IBsscXMLParser, Runnable
{
  private Stack m_processingElements = null;
  private IBsscXMLDocumentBuilder m_document = null;
  private boolean m_bReady;
  private Reader m_is = null;
  
  public static String xmlToText(String paramString)
  {
    StringBuffer localStringBuffer = new StringBuffer();
    int i = paramString.length();
    for (int j = 0; j < i; j++) {
      if (paramString.charAt(j) == '&')
      {
        if ((j + 3 < i) && (paramString.charAt(j + 1) == 'l') && (paramString.charAt(j + 2) == 't') && (paramString.charAt(j + 3) == ';'))
        {
          localStringBuffer.append('<');
          j += 3;
        }
        else if ((j + 3 < i) && (paramString.charAt(j + 1) == 'g') && (paramString.charAt(j + 2) == 't') && (paramString.charAt(j + 3) == ';'))
        {
          localStringBuffer.append('>');
          j += 3;
        }
        else if ((j + 5 < i) && (paramString.charAt(j + 1) == 'q') && (paramString.charAt(j + 2) == 'u') && (paramString.charAt(j + 3) == 'o') && (paramString.charAt(j + 4) == 't') && (paramString.charAt(j + 5) == ';'))
        {
          localStringBuffer.append('"');
          j += 5;
        }
        else if ((j + 4 < i) && (paramString.charAt(j + 1) == 'a') && (paramString.charAt(j + 2) == 'm') && (paramString.charAt(j + 3) == 'p') && (paramString.charAt(j + 4) == ';'))
        {
          localStringBuffer.append('&');
          j += 4;
        }
        else
        {
          localStringBuffer.append(paramString.charAt(j));
        }
      }
      else {
        localStringBuffer.append(paramString.charAt(j));
      }
    }
    return localStringBuffer.toString();
  }
  
  public void parse()
  {
    if (m_is != null) {
      parse(m_is);
    }
  }
  
  public void parse(Reader paramReader)
  {
    try
    {
      BsscXMLTokenizer localBsscXMLTokenizer = new BsscXMLTokenizer(this);
      localBsscXMLTokenizer.tokenize(paramReader);
      paramReader.close();
      return;
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
    }
  }
  
  public void beginElement(String paramString)
    throws BsscXMLException
  {
    IBsscXMLElementBuilder localIBsscXMLElementBuilder = BsscXML.createElement(paramString);
    if (!m_processingElements.empty())
    {
      Object localObject = m_processingElements.peek();
      if ((localObject instanceof IBsscXMLElementBuilder))
      {
        ((IBsscXMLElementBuilder)localObject).addChild(localIBsscXMLElementBuilder);
        localIBsscXMLElementBuilder.setParent((IBsscXMLElementBuilder)localObject);
      }
      else
      {
        throw new BsscXMLException("Type Mismatch!");
      }
    }
    else if (m_document != null)
    {
      m_document.setRoot(localIBsscXMLElementBuilder);
    }
    else
    {
      throw new BsscXMLException("Internal Error!");
    }
    m_processingElements.push(localIBsscXMLElementBuilder);
  }
  
  public void findValue(String paramString)
    throws BsscXMLException
  {
    Object localObject = m_processingElements.peek();
    if ((localObject instanceof IBsscXMLElementBuilder))
    {
      String str = xmlToText(paramString);
      ((IBsscXMLElementBuilder)localObject).setValue(str);
      return;
    }
    throw new BsscXMLException("Type Mismatch!");
  }
  
  public void be
1 2 3 4 5 6 7 8 9 10 11

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd