home *** CD-ROM | disk | FTP | other *** search
/ Datatid 2000 #1 / Datatid-2000-01.iso / Internet / JAVA_NAVIGATOR / JAVANAVIGATOR.EXE / %MAINDIR% / files / JClass / JAVATree.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-08-31  |  19.2 KB  |  936 lines

  1. import java.applet.Applet;
  2. import java.awt.Color;
  3. import java.awt.Component;
  4. import java.awt.Container;
  5. import java.awt.Dimension;
  6. import java.awt.Event;
  7. import java.awt.Font;
  8. import java.awt.Frame;
  9. import java.awt.Graphics;
  10. import java.awt.Image;
  11. import java.awt.LayoutManager;
  12. import java.awt.MediaTracker;
  13. import java.awt.Panel;
  14. import java.io.DataInputStream;
  15. import java.io.IOException;
  16. import java.io.InputStream;
  17. import java.net.MalformedURLException;
  18. import java.net.URL;
  19. import java.util.NoSuchElementException;
  20. import java.util.StringTokenizer;
  21.  
  22. public class JAVATree extends Applet implements Runnable {
  23.    Thread thJAVATree;
  24.    String sDefMO = "1st JAVA Navigator[Tree] (c)1997-1999 AUSCOMP - World Wide (www.auscomp.com)";
  25.    String sCopyright = "AUSCOMP (www.auscomp.com)";
  26.    String[] aHref;
  27.    String[] aFrame;
  28.    String[] aHref2;
  29.    String[] aFrame2;
  30.    String[] aExpand;
  31.    String[] aMO;
  32.    int[] iLevel;
  33.    String sText = "";
  34.    String sHref = "";
  35.    String sFrame = "";
  36.    String sHref2 = "";
  37.    String sFrame2 = "";
  38.    String sExpand = "";
  39.    int[] iColor;
  40.    String sLevel = "";
  41.    String sPic1 = "";
  42.    String sPic2 = "";
  43.    String sMO = "";
  44.    int iItemCnt;
  45.    int iLoading;
  46.    Font fFont = new Font("Dialog", 0, 12);
  47.    boolean bExpand = false;
  48.    boolean bTREE_AUTOEXPAND = false;
  49.    String dblClick = "no";
  50.    Image imgBG;
  51.    private boolean m_fAllLoaded = false;
  52.    private boolean bCopyright = false;
  53.    private boolean allLoaded = false;
  54.    int intWidth = 200;
  55.    int intHeight = 250;
  56.    String sMOUSEOVERSOUND = "none";
  57.    String sMOUSECLICKSOUND = "none";
  58.    Image ImgClosed;
  59.    Image ImgOpen;
  60.    Image ImgdLeaf;
  61.    Image ImgdClosed;
  62.    Image ImgdOpen;
  63.    int iYRec;
  64.    String sLine;
  65.    TreeNode oldNode;
  66.    TreeNode newNode;
  67.    TreeNode oldMouseOverNode;
  68.    // $FF: renamed from: g1 java.awt.Graphics
  69.    Graphics field_0;
  70.    Frame frame;
  71.    int[] iColorBlack = new int[]{0, 0, 0};
  72.    int[] iColorWhite = new int[]{255, 255, 255};
  73.    int[] iColorRed = new int[]{255, 0, 0};
  74.    int[] iColorBlue = new int[]{0, 0, 255};
  75.    int[] iColorYellow = new int[]{255, 255, 231};
  76.    int[] iColorGreen = new int[]{0, 255, 0};
  77.    String[] sColorParam = new String[]{"BACKGROUND", "FOREGROUND", "SELBACKGROUND", "SELFOREGROUND", "MOUSEOVER", "LINECOLOR", "FOLDEROCOLOR", "FOLDERCCOLOR", "LEAFCOLOR", "TOOLTIPBACKCOLOR", "TOOLTIPFORECOLOR", "MOUSEOVERFRAMECOLOR"};
  78.    String[] sNormalParam = new String[]{"STYLE", "MOUSEOVERFRAME", "LINESTEP", "TOOLTIP", "BORDER", "DOUBLECLICK", "AUTOEXPAND"};
  79.    String[] sImageParam = new String[]{"FOLDER_OPEN", "FOLDER_CLOSED", "LEAF", "BACKGROUNDIMAGE"};
  80.    TreeView treeView1;
  81.    // $FF: renamed from: TN TreeNode[]
  82.    public TreeNode[] field_1;
  83.    public TreeNode[] TN1;
  84.  
  85.    void treeView1_MouseEnter(Event event) {
  86.    }
  87.  
  88.    void treeView1_KeyPress(Event event) {
  89.    }
  90.  
  91.    void treeView1_MouseMove(Event event) {
  92.       try {
  93.          if (!this.sMOUSEOVERSOUND.equals("none")) {
  94.             ((Applet)this).play(((Applet)this).getCodeBase(), this.sMOUSEOVERSOUND);
  95.          }
  96.       } catch (Exception var3) {
  97.       }
  98.  
  99.       for(int z = 0; z < this.treeView1.getCount(); ++z) {
  100.          if (this.field_1[z] == this.treeView1.getMouseOverNode()) {
  101.             this.sMO = this.aMO[z];
  102.             this.sHref = this.aHref[z];
  103.             this.newNode = this.field_1[z];
  104.             break;
  105.          }
  106.       }
  107.  
  108.       this.sMO = this.sMO.trim();
  109.       if (this.sMO.toLowerCase().equals("none") || this.sMO.toLowerCase().equals("")) {
  110.          this.sMO = this.sHref.trim();
  111.       }
  112.  
  113.       if (this.newNode != this.oldNode) {
  114.          ((Applet)this).showStatus(this.sMO);
  115.          this.oldNode = this.newNode;
  116.       }
  117.  
  118.    }
  119.  
  120.    void treeView1_MouseDown(Event event) {
  121.       try {
  122.          if (!this.sMOUSECLICKSOUND.equals("none")) {
  123.             ((Applet)this).play(((Applet)this).getCodeBase(), this.sMOUSECLICKSOUND);
  124.          }
  125.       } catch (Exception var5) {
  126.       }
  127.  
  128.       try {
  129.          for(int z = 0; z < this.treeView1.getCount(); ++z) {
  130.             if (this.field_1[z] == this.treeView1.getSelectedNode()) {
  131.                this.sHref = this.aHref[z];
  132.                this.sFrame = this.aFrame[z];
  133.                this.sHref2 = this.aHref2[z];
  134.                this.sFrame2 = this.aFrame2[z];
  135.                this.sExpand = this.aExpand[z];
  136.                this.sMO = this.aMO[z];
  137.                break;
  138.             }
  139.          }
  140.  
  141.          this.sHref = this.sHref.trim();
  142.          this.sFrame = this.sFrame.trim();
  143.          this.sHref2 = this.sHref2.trim();
  144.          this.sFrame2 = this.sFrame2.trim();
  145.          this.sExpand = this.sExpand.trim();
  146.          this.sMO = this.sMO.trim();
  147.          if (!this.sHref.toLowerCase().equals("none")) {
  148.             try {
  149.                ((Applet)this).getAppletContext().showDocument(new URL(((Applet)this).getCodeBase(), this.sHref), this.sFrame);
  150.             } catch (MalformedURLException var4) {
  151.             }
  152.          }
  153.  
  154.          if (!this.sHref2.toLowerCase().equals("none")) {
  155.             try {
  156.                ((Applet)this).getAppletContext().showDocument(new URL(((Applet)this).getCodeBase(), this.sHref2), this.sFrame2);
  157.                return;
  158.             } catch (MalformedURLException var3) {
  159.                return;
  160.             }
  161.          }
  162.       } catch (Exception var6) {
  163.       }
  164.  
  165.    }
  166.  
  167.    public void start() {
  168.       this.field_0 = ((Component)this).getGraphics();
  169.       this.paint(this.field_0);
  170.       this.thJAVATree = new Thread(this);
  171.       this.thJAVATree.start();
  172.    }
  173.  
  174.    public void run() {
  175.       if (!this.allLoaded) {
  176.          this.constructTree();
  177.          this.treeView1.show(true);
  178.       }
  179.  
  180.    }
  181.  
  182.    public void stop() {
  183.       this.thJAVATree.stop();
  184.       this.thJAVATree = null;
  185.    }
  186.  
  187.    public void paint(Graphics g) {
  188.       ++this.iLoading;
  189.       g.drawString("1st JAVA Navigator V5.0", 10, 20);
  190.       g.drawString("Loading resource No." + this.iLoading, 10, 40);
  191.       g.drawString("Please wait ...", 10, 60);
  192.    }
  193.  
  194.    public void init() {
  195.       super.init();
  196.       ((Container)this).setLayout((LayoutManager)null);
  197.  
  198.       try {
  199.          Dimension d = ((Component)this).size();
  200.          ((Panel)this).addNotify();
  201.          this.intWidth = d.width;
  202.          this.intHeight = d.height;
  203.       } catch (Exception var2) {
  204.       }
  205.  
  206.       if (this.intWidth < 20) {
  207.          this.intWidth = 200;
  208.       }
  209.  
  210.       if (this.intHeight < 50) {
  211.          this.intHeight = 250;
  212.       }
  213.  
  214.       this.treeView1 = new TreeView();
  215.       this.treeView1.reshape(0, 0, this.intWidth, this.intHeight);
  216.       this.treeView1.setFont(new Font("Dialog", 0, 12));
  217.       ((Container)this).add(this.treeView1);
  218.       this.treeView1.hide();
  219.       ((Applet)this).showStatus("...1st JAVA Navigator[Tree] loading, please wait");
  220.    }
  221.  
  222.    public void setTreeNode(String sNode, boolean bExecute) {
  223.       try {
  224.          if (sNode == null) {
  225.             return;
  226.          }
  227.  
  228.          this.treeView1.setNode(sNode);
  229.          if (this.treeView1.getSelectedText().equals(sNode) && bExecute) {
  230.             this.treeView1_MouseDown((Event)null);
  231.             return;
  232.          }
  233.       } catch (Exception var3) {
  234.       }
  235.  
  236.    }
  237.  
  238.    public String getTreeNode() {
  239.       return this.treeView1.getSelectedText() == null ? null : this.treeView1.getSelectedText();
  240.    }
  241.  
  242.    public void addTreeNode(String s1ParentNodeText, String s1NodeText, String s1Href1, String s1Target1, String s1Href2, String s1Target2, String s1Statusbar, String s1Expand) {
  243.       try {
  244.          if (s1NodeText == null) {
  245.             return;
  246.          }
  247.  
  248.          this.aHref[this.iItemCnt] = "none";
  249.          if (s1Href1 != null && !s1Href1.trim().equals("")) {
  250.             this.aHref[this.iItemCnt] = s1Href1;
  251.          }
  252.  
  253.          if (s1Target1 != null) {
  254.             this.aFrame[this.iItemCnt] = s1Target1;
  255.          } else {
  256.             this.aFrame[this.iItemCnt] = "none";
  257.          }
  258.  
  259.          this.aHref2[this.iItemCnt] = "none";
  260.          if (s1Href2 != null && !s1Href2.trim().equals("")) {
  261.             this.aHref2[this.iItemCnt] = s1Href2;
  262.          }
  263.  
  264.          if (s1Target2 != null) {
  265.             this.aFrame2[this.iItemCnt] = s1Target2;
  266.          } else {
  267.             this.aFrame2[this.iItemCnt] = "none";
  268.          }
  269.  
  270.          this.aMO[this.iItemCnt] = "";
  271.          if (s1Statusbar != null && !s1Statusbar.trim().equals("")) {
  272.             this.aMO[this.iItemCnt] = s1Statusbar;
  273.          }
  274.  
  275.          this.aExpand[this.iItemCnt] = "NO";
  276.          if (s1Expand != null && s1Expand.trim().toLowerCase().equals("yes")) {
  277.             this.aExpand[this.iItemCnt] = "YES";
  278.          }
  279.  
  280.          this.field_1[this.iItemCnt] = new TreeNode(s1NodeText, this.ImgdLeaf, this.ImgdLeaf);
  281.          this.bExpand = false;
  282.          if (this.aExpand[this.iItemCnt].toLowerCase().equals("yes")) {
  283.             this.bExpand = true;
  284.          }
  285.  
  286.          if (this.bTREE_AUTOEXPAND) {
  287.             this.bExpand = true;
  288.          }
  289.  
  290.          if (s1ParentNodeText.trim().equals("")) {
  291.             this.treeView1.append(this.field_1[this.iItemCnt], this.bExpand);
  292.          } else {
  293.             this.treeView1.setNode(s1ParentNodeText);
  294.             this.TN1[this.iItemCnt] = this.treeView1.getSelectedNode();
  295.             if (this.TN1[this.iItemCnt] != null) {
  296.                this.TN1[this.iItemCnt].setCollapsedImage(this.ImgdClosed);
  297.                this.TN1[this.iItemCnt].setExpandedImage(this.ImgdOpen);
  298.             }
  299.  
  300.             this.treeView1.insert(this.field_1[this.iItemCnt], this.TN1[this.iItemCnt], 0, this.bExpand);
  301.          }
  302.  
  303.          if (!this.bTREE_AUTOEXPAND) {
  304.             if (this.aExpand[this.iItemCnt].trim().toUpperCase().equals("YES")) {
  305.                this.bExpand = true;
  306.             } else {
  307.                this.bExpand = false;
  308.             }
  309.          }
  310.  
  311.          this.treeView1.setNode(s1NodeText);
  312.       } catch (Exception var9) {
  313.       }
  314.  
  315.       ++this.iItemCnt;
  316.       this.treeView1.redraw();
  317.    }
  318.  
  319.    public void delTreeNode(String sNode) {
  320.       try {
  321.          if (!sNode.trim().equals("(c)1997-199 Auscomp") && !sNode.trim().equals("Copyright parameter missing!") && !sNode.trim().equals("1st JAVA Navigator[Tree]") && !sNode.trim().equals("For evaluation only") && !sNode.trim().equals("-------------------------------------")) {
  322.             this.treeView1.remove(sNode);
  323.             this.treeView1.redraw();
  324.             return;
  325.          }
  326.       } catch (Exception var2) {
  327.       }
  328.  
  329.    }
  330.  
  331.    public void constructTree() {
  332.       String strBG = "";
  333.       this.iColor = new int[3];
  334.  
  335.       try {
  336.          strBG = ((Applet)this).getParameter("COPYRIGHT");
  337.          if (strBG.indexOf(this.sCopyright) > 0) {
  338.             this.bCopyright = true;
  339.          } else {
  340.             this.bCopyright = false;
  341.          }
  342.       } catch (Exception var24) {
  343.       }
  344.  
  345.       for(int x = 0; x < 12; ++x) {
  346.          switch (x) {
  347.             case 0:
  348.                this.iColor = this.iColorWhite;
  349.                break;
  350.             case 1:
  351.                this.iColor = this.iColorBlack;
  352.                break;
  353.             case 2:
  354.                this.iColor = this.iColorBlue;
  355.                break;
  356.             case 3:
  357.                this.iColor = this.iColorWhite;
  358.                break;
  359.             case 4:
  360.                this.iColor = this.iColorRed;
  361.                break;
  362.             case 5:
  363.                this.iColor = this.iColorBlack;
  364.                break;
  365.             case 6:
  366.                this.iColor = this.iColorBlack;
  367.                break;
  368.             case 7:
  369.                this.iColor = this.iColorBlack;
  370.                break;
  371.             case 8:
  372.                this.iColor = this.iColorBlack;
  373.                break;
  374.             case 9:
  375.                this.iColor = this.iColorYellow;
  376.                break;
  377.             case 10:
  378.                this.iColor = this.iColorBlack;
  379.                break;
  380.             case 11:
  381.                this.iColor = this.iColorRed;
  382.          }
  383.  
  384.          try {
  385.             strBG = ((Applet)this).getParameter(this.sColorParam[x]);
  386.             if (strBG != null) {
  387.                this.iColor[0] = this.getCOLOR(0, this.sColorParam[x], strBG);
  388.                this.iColor[1] = this.getCOLOR(1, this.sColorParam[x], strBG);
  389.                this.iColor[2] = this.getCOLOR(2, this.sColorParam[x], strBG);
  390.             }
  391.          } catch (Exception var23) {
  392.          }
  393.  
  394.          switch (x) {
  395.             case 0:
  396.                this.treeView1.setBackground(new Color(this.iColor[0], this.iColor[1], this.iColor[2]));
  397.                break;
  398.             case 1:
  399.                this.treeView1.setForeground(new Color(this.iColor[0], this.iColor[1], this.iColor[2]));
  400.                break;
  401.             case 2:
  402.                this.treeView1.setBgHilite(new Color(this.iColor[0], this.iColor[1], this.iColor[2]));
  403.                break;
  404.             case 3:
  405.                this.treeView1.setFgHilite(new Color(this.iColor[0], this.iColor[1], this.iColor[2]));
  406.                break;
  407.             case 4:
  408.                this.treeView1.setMOHilite(new Color(this.iColor[0], this.iColor[1], this.iColor[2]));
  409.                break;
  410.             case 5:
  411.                this.treeView1.setLineColor(new Color(this.iColor[0], this.iColor[1], this.iColor[2]));
  412.                break;
  413.             case 6:
  414.                this.treeView1.setFolderOColor(new Color(this.iColor[0], this.iColor[1], this.iColor[2]));
  415.                break;
  416.             case 7:
  417.                this.treeView1.setFolderCColor(new Color(this.iColor[0], this.iColor[1], this.iColor[2]));
  418.                break;
  419.             case 8:
  420.                this.treeView1.setLeafColor(new Color(this.iColor[0], this.iColor[1], this.iColor[2]));
  421.                break;
  422.             case 9:
  423.                this.treeView1.setToolTipBackColor(new Color(this.iColor[0], this.iColor[1], this.iColor[2]));
  424.                break;
  425.             case 10:
  426.                this.treeView1.setToolTipForeColor(new Color(this.iColor[0], this.iColor[1], this.iColor[2]));
  427.                break;
  428.             case 11:
  429.                this.treeView1.setMouseOverFrameColor(new Color(this.iColor[0], this.iColor[1], this.iColor[2]));
  430.          }
  431.       }
  432.  
  433.       try {
  434.          this.sMOUSEOVERSOUND = "none";
  435.          strBG = ((Applet)this).getParameter("MOUSEOVERSOUND");
  436.          if (strBG != null) {
  437.             this.sMOUSEOVERSOUND = strBG;
  438.          }
  439.       } catch (Exception var22) {
  440.       }
  441.  
  442.       try {
  443.          this.sMOUSECLICKSOUND = "none";
  444.          strBG = ((Applet)this).getParameter("MOUSECLICKSOUND");
  445.          if (strBG != null) {
  446.             this.sMOUSECLICKSOUND = strBG;
  447.          }
  448.       } catch (Exception var21) {
  449.       }
  450.  
  451.       for(int x = 0; x < 7; ++x) {
  452.          try {
  453.             strBG = ((Applet)this).getParameter(this.sNormalParam[x]);
  454.          } catch (Exception var20) {
  455.          }
  456.  
  457.          switch (x) {
  458.             case 0:
  459.                if (strBG == null) {
  460.                   strBG = "AXAA";
  461.                }
  462.  
  463.                this.treeView1.setStyle(strBG);
  464.                break;
  465.             case 1:
  466.                if (strBG == null) {
  467.                   strBG = "none";
  468.                }
  469.  
  470.                this.treeView1.setMouseOverStyle(strBG);
  471.                break;
  472.             case 2:
  473.                try {
  474.                   this.treeView1.setLineStep(Integer.parseInt(strBG));
  475.                } catch (Exception var19) {
  476.                }
  477.                break;
  478.             case 3:
  479.                try {
  480.                   if (strBG == null) {
  481.                      strBG = "Yes";
  482.                   }
  483.  
  484.                   if (strBG.trim().toLowerCase().equals("no")) {
  485.                      strBG = "No";
  486.                   }
  487.                } catch (Exception var18) {
  488.                }
  489.  
  490.                this.treeView1.setToolTip(strBG);
  491.                break;
  492.             case 4:
  493.                if (strBG == null) {
  494.                   strBG = "No";
  495.                }
  496.  
  497.                try {
  498.                   if (strBG.trim().toLowerCase().equals("yes")) {
  499.                      strBG = "Yes";
  500.                   }
  501.                } catch (Exception var17) {
  502.                }
  503.  
  504.                this.treeView1.setBorder(strBG);
  505.                break;
  506.             case 5:
  507.                if (strBG == null) {
  508.                   strBG = "No";
  509.                }
  510.  
  511.                try {
  512.                   if (strBG.trim().toLowerCase().equals("yes")) {
  513.                      strBG = "Yes";
  514.                   }
  515.                } catch (Exception var16) {
  516.                }
  517.  
  518.                this.treeView1.setDblClick(strBG);
  519.                break;
  520.             case 6:
  521.                this.bTREE_AUTOEXPAND = false;
  522.  
  523.                try {
  524.                   if (strBG.trim().toLowerCase().equals("yes")) {
  525.                      this.bTREE_AUTOEXPAND = true;
  526.                   }
  527.                } catch (Exception var15) {
  528.                }
  529.          }
  530.       }
  531.  
  532.       try {
  533.          strBG = ((Applet)this).getParameter("FONT");
  534.          String fName = "";
  535.          String fStyle = "";
  536.          String fSize = "";
  537.          int iStyle = 0;
  538.          if (strBG != null) {
  539.             StringTokenizer parser = new StringTokenizer(strBG, ";");
  540.  
  541.             try {
  542.                fName = parser.nextToken();
  543.                fStyle = parser.nextToken();
  544.                fSize = parser.nextToken();
  545.                if (fStyle.trim().toLowerCase().equals("bold")) {
  546.                   iStyle = 1;
  547.                }
  548.  
  549.                if (fStyle.trim().toLowerCase().equals("italic")) {
  550.                   iStyle = 2;
  551.                }
  552.  
  553.                this.fFont = new Font(fName, iStyle, Integer.parseInt(fSize.trim()));
  554.             } catch (NoSuchElementException var12) {
  555.                System.out.println(strBG + " Parameter Error(1)");
  556.             } catch (Exception var13) {
  557.                System.out.println(strBG + " Parameter Error(2)");
  558.             }
  559.          }
  560.  
  561.          this.treeView1.setFont(this.fFont);
  562.       } catch (Exception var14) {
  563.       }
  564.  
  565.       for(int x = 0; x < 4; ++x) {
  566.          try {
  567.             strBG = ((Applet)this).getParameter(this.sImageParam[x]);
  568.             this.imgBG = null;
  569.             if (strBG != null) {
  570.                this.imgBG = ((Applet)this).getImage(((Applet)this).getCodeBase(), strBG);
  571.                MediaTracker m = new MediaTracker(this);
  572.  
  573.                try {
  574.                   m.addImage(this.imgBG, 0);
  575.                   m.waitForAll();
  576.                } catch (InterruptedException var10) {
  577.                }
  578.             }
  579.  
  580.             switch (x) {
  581.                case 0:
  582.                   if (this.imgBG.getHeight(this) > 0) {
  583.                      this.ImgdOpen = this.imgBG;
  584.                   } else {
  585.                      System.out.println("Error - couldn't find FOLDER OPEN IMAGE - please check image URL");
  586.                   }
  587.                   break;
  588.                case 1:
  589.                   if (this.imgBG.getHeight(this) > 0) {
  590.                      this.ImgdClosed = this.imgBG;
  591.                   } else {
  592.                      System.out.println("Error - couldn't find FOLDER CLOSED IMAGE - please check image URL");
  593.                   }
  594.                   break;
  595.                case 2:
  596.                   if (this.imgBG.getHeight(this) > 0) {
  597.                      this.ImgdLeaf = this.imgBG;
  598.                   } else {
  599.                      System.out.println("Error - couldn't find FOLDER CLOSED IMAGE - please check image URL");
  600.                   }
  601.                   break;
  602.                case 3:
  603.                   if (this.imgBG.getHeight(this) > 0) {
  604.                      this.treeView1.setBGImage(this.imgBG);
  605.                      this.treeView1.repaint();
  606.                   } else {
  607.                      System.out.println("Error - couldn't find BACKGROUND IMAGE - please check image URL");
  608.                   }
  609.             }
  610.          } catch (Exception var11) {
  611.          }
  612.       }
  613.  
  614.       try {
  615.          String var27 = null;
  616.          String var28 = ((Applet)this).getParameter("CONTENT");
  617.          if (var28 == null) {
  618.             this.getParameterContent();
  619.          } else {
  620.             this.getFileContent(var28);
  621.          }
  622.       } catch (Exception var9) {
  623.       }
  624.  
  625.       this.allLoaded = true;
  626.    }
  627.  
  628.    private void getParameterContent() {
  629.       ((Component)this).repaint();
  630.  
  631.       int i;
  632.       for(i = 0; ((Applet)this).getParameter("I" + i) != null; ++i) {
  633.       }
  634.  
  635.       this.aHref = new String[2999];
  636.       this.aFrame = new String[2999];
  637.       this.aHref2 = new String[2999];
  638.       this.aFrame2 = new String[2999];
  639.       this.aExpand = new String[2999];
  640.       this.aMO = new String[2999];
  641.       this.iLevel = new int[2999];
  642.       this.field_1 = new TreeNode[2999];
  643.       this.TN1 = new TreeNode[2999];
  644.       String strBG = null;
  645.  
  646.       for(int x = 0; x < i; ++x) {
  647.          strBG = ((Applet)this).getParameter("I" + x);
  648.          if (strBG == null) {
  649.             System.out.println("I" + x + " Parameter Error");
  650.          }
  651.  
  652.          this.workParam("I" + x, strBG);
  653.       }
  654.  
  655.       this.makeTree(this.iItemCnt);
  656.    }
  657.  
  658.    private void getFileContent(String str1BG) {
  659.       ((Component)this).repaint();
  660.       this.readFile(str1BG);
  661.       this.makeTree(this.iItemCnt);
  662.    }
  663.  
  664.    public boolean handleEvent(Event event) {
  665.       try {
  666.          if (this.treeView1.getMouseOverNode() != null && event.target == this.treeView1 && event.id == 501) {
  667.             this.treeView1_MouseDown(event);
  668.             return true;
  669.          }
  670.       } catch (Exception var3) {
  671.       }
  672.  
  673.       if (event.target == this.treeView1 && event.id == 504) {
  674.          this.treeView1_MouseEnter(event);
  675.          return true;
  676.       } else {
  677.          try {
  678.             if (this.oldMouseOverNode != this.treeView1.getMouseOverNode() && this.treeView1.getMouseOverNode() != null && event.target == this.treeView1 && event.id == 503) {
  679.                this.treeView1_MouseMove(event);
  680.                this.oldMouseOverNode = this.treeView1.getMouseOverNode();
  681.                return true;
  682.             }
  683.          } catch (Exception var2) {
  684.          }
  685.  
  686.          if (event.target == this.treeView1 && event.id == 401) {
  687.             this.treeView1_KeyPress(event);
  688.             return true;
  689.          } else {
  690.             return super.handleEvent(event);
  691.          }
  692.       }
  693.    }
  694.  
  695.    private int getCOLOR(int iColor, String sWhat, String sPBG) {
  696.       int iRed = 255;
  697.       int iBlue = 255;
  698.       int iGreen = 255;
  699.       StringTokenizer parser = new StringTokenizer(sPBG, ",");
  700.  
  701.       try {
  702.          String sRed = parser.nextToken();
  703.          String sGreen = parser.nextToken();
  704.          String sBlue = parser.nextToken();
  705.          iRed = Integer.parseInt(sRed);
  706.          iGreen = Integer.parseInt(sGreen);
  707.          iBlue = Integer.parseInt(sBlue);
  708.       } catch (NoSuchElementException var11) {
  709.          System.out.println(sWhat + " Parameter Error(1)");
  710.       } catch (Exception var12) {
  711.          System.out.println(sWhat + " Parameter Error(2)");
  712.       }
  713.  
  714.       switch (iColor) {
  715.          case 0:
  716.             return iRed;
  717.          case 1:
  718.             return iGreen;
  719.          case 2:
  720.             return iBlue;
  721.          default:
  722.             return 255;
  723.       }
  724.    }
  725.  
  726.    private void makeNode(int iNCnt, String sT, String sP1, String sP2) {
  727.       this.ImgClosed = this.ImgdLeaf;
  728.       this.ImgOpen = this.ImgdLeaf;
  729.       if (!sP1.trim().toLowerCase().equals("none") && !sP1.trim().toLowerCase().equals("") && !sP1.trim().toLowerCase().equals("leaf")) {
  730.          if (sP1.trim().toLowerCase().equals("folder")) {
  731.             this.ImgClosed = this.ImgdClosed;
  732.             this.ImgOpen = this.ImgdOpen;
  733.          } else {
  734.             this.ImgClosed = ((Applet)this).getImage(((Applet)this).getCodeBase(), sP1);
  735.             this.ImgOpen = ((Applet)this).getImage(((Applet)this).getCodeBase(), sP2);
  736.             MediaTracker m = new MediaTracker(this);
  737.  
  738.             try {
  739.                m.addImage(this.ImgClosed, 0);
  740.                m.addImage(this.ImgOpen, 1);
  741.                m.waitForAll();
  742.                this.m_fAllLoaded = !m.isErrorAny();
  743.             } catch (InterruptedException var6) {
  744.             }
  745.  
  746.             if (!this.m_fAllLoaded) {
  747.                this.ImgClosed = this.ImgdLeaf;
  748.                this.ImgOpen = this.ImgdLeaf;
  749.             }
  750.          }
  751.       }
  752.  
  753.       this.field_1[iNCnt] = new TreeNode(sT, this.ImgClosed, this.ImgOpen);
  754.    }
  755.  
  756.    private void makeTree(int iNodeCnt) {
  757.       this.bExpand = false;
  758.  
  759.       for(int y = 0; y < iNodeCnt; ++y) {
  760.          if (this.bTREE_AUTOEXPAND) {
  761.             this.bExpand = true;
  762.          }
  763.  
  764.          if (this.iLevel[y] == 0) {
  765.             this.treeView1.append(this.field_1[y], this.bExpand);
  766.          } else {
  767.             this.treeView1.insert(this.field_1[y], this.TN1[this.iLevel[y] - 1], 0, this.bExpand);
  768.          }
  769.  
  770.          this.TN1[this.iLevel[y]] = this.field_1[y];
  771.          if (!this.bTREE_AUTOEXPAND) {
  772.             if (this.aExpand[y].trim().toUpperCase().equals("YES")) {
  773.                this.bExpand = true;
  774.             } else {
  775.                this.bExpand = false;
  776.             }
  777.          }
  778.       }
  779.  
  780.       this.treeView1.redraw();
  781.    }
  782.  
  783.    private void workParam(String sItem, String sP) {
  784.       if (this.bCopyright) {
  785.          this.sHref2 = "None";
  786.          this.sFrame2 = "None";
  787.          this.sMO = "None";
  788.          this.sExpand = "NO";
  789.          if (sP.substring(0, 3).equals("***")) {
  790.             this.sHref = "None";
  791.             this.sFrame = "None";
  792.             this.sMO = this.sDefMO;
  793.          } else {
  794.             StringTokenizer parser = new StringTokenizer(sP, ";");
  795.             int iCnt = parser.countTokens() - 10;
  796.             if (iCnt != 0) {
  797.                System.out.println("*** Warning in parameter '" + sItem + "' - Item count is ( " + parser.countTokens() + " ) instead of ( 10 ) *** ");
  798.             }
  799.  
  800.             try {
  801.                this.sText = parser.nextToken();
  802.                this.sHref = parser.nextToken();
  803.                this.sFrame = parser.nextToken();
  804.                this.sLevel = parser.nextToken();
  805.                this.sPic1 = parser.nextToken();
  806.                this.sPic2 = parser.nextToken();
  807.                this.sMO = parser.nextToken();
  808.                this.sHref2 = parser.nextToken();
  809.                this.sFrame2 = parser.nextToken();
  810.                this.sExpand = parser.nextToken();
  811.             } catch (NoSuchElementException var6) {
  812.             } catch (Exception var7) {
  813.                System.out.println(sItem + " Parameter Error(3)");
  814.             }
  815.  
  816.             if (this.iItemCnt == 0) {
  817.                this.makeNode(this.iItemCnt, "(c)1997-1999 Auscomp", "SLauscomp.gif", "SLauscomp.gif");
  818.                this.iLevel[this.iItemCnt] = 0;
  819.                this.aHref[this.iItemCnt] = "http://www.auscomp.com";
  820.                this.aFrame[this.iItemCnt] = "_blank";
  821.                this.aHref2[this.iItemCnt] = "none";
  822.                this.aFrame2[this.iItemCnt] = "none";
  823.                this.aExpand[this.iItemCnt] = "NO";
  824.                this.aMO[this.iItemCnt] = "1st JAVA Navigator[Tree] (C)1997-1999 Auscomp - World Wide.";
  825.                ++this.iItemCnt;
  826.                this.makeNode(this.iItemCnt, "1st JAVA Navigator[Tree]", "none", "none");
  827.                this.iLevel[this.iItemCnt] = 0;
  828.                this.aHref[this.iItemCnt] = "http://www.auscomp.com";
  829.                this.aFrame[this.iItemCnt] = "_blank";
  830.                this.aHref2[this.iItemCnt] = "none";
  831.                this.aFrame2[this.iItemCnt] = "none";
  832.                this.aExpand[this.iItemCnt] = "NO";
  833.                this.aMO[this.iItemCnt] = "1st JAVA Navigator[Tree] for evaluation purposes only.";
  834.                ++this.iItemCnt;
  835.                this.makeNode(this.iItemCnt, "For evaluation only", "none", "none");
  836.                this.iLevel[this.iItemCnt] = 0;
  837.                this.aHref[this.iItemCnt] = "http://www.auscomp.com/buy_online.html";
  838.                this.aFrame[this.iItemCnt] = "_blank";
  839.                this.aHref2[this.iItemCnt] = "none";
  840.                this.aFrame2[this.iItemCnt] = "none";
  841.                this.aExpand[this.iItemCnt] = "NO";
  842.                this.aMO[this.iItemCnt] = "Click to buy on-line.";
  843.                ++this.iItemCnt;
  844.                this.makeNode(this.iItemCnt, "-------------------------------------", "none", "none");
  845.                this.iLevel[this.iItemCnt] = 0;
  846.                this.aHref[this.iItemCnt] = "http://www.auscomp.com/buy_online.html";
  847.                this.aFrame[this.iItemCnt] = "_blank";
  848.                this.aHref2[this.iItemCnt] = "none";
  849.                this.aFrame2[this.iItemCnt] = "none";
  850.                this.aExpand[this.iItemCnt] = "NO";
  851.                this.aMO[this.iItemCnt] = "Click to buy on-line.";
  852.                ++this.iItemCnt;
  853.             }
  854.  
  855.             this.sLevel = this.sLevel.trim();
  856.             this.iLevel[this.iItemCnt] = 0;
  857.  
  858.             try {
  859.                this.iLevel[this.iItemCnt] = Integer.parseInt(this.sLevel);
  860.             } catch (Exception var5) {
  861.             }
  862.  
  863.             this.aHref[this.iItemCnt] = this.sHref;
  864.             this.aFrame[this.iItemCnt] = this.sFrame;
  865.             this.aHref2[this.iItemCnt] = this.sHref2;
  866.             this.aFrame2[this.iItemCnt] = this.sFrame2;
  867.             this.aExpand[this.iItemCnt] = this.sExpand;
  868.             this.aMO[this.iItemCnt] = this.sMO;
  869.             this.makeNode(this.iItemCnt, this.sText, this.sPic1, this.sPic2);
  870.             ++this.iItemCnt;
  871.          }
  872.       } else {
  873.          if (this.iItemCnt == 0) {
  874.             this.makeNode(this.iItemCnt, "(c) 1997 Auscomp - World Wide", "SLauscomp.gif", "SLauscomp.gif");
  875.             this.iLevel[this.iItemCnt] = 0;
  876.             this.aHref[this.iItemCnt] = "http://www.auscomp.com";
  877.             this.aFrame[this.iItemCnt] = "_blank";
  878.             this.aHref2[this.iItemCnt] = "none";
  879.             this.aFrame2[this.iItemCnt] = "none";
  880.             this.aExpand[this.iItemCnt] = "NO";
  881.             this.aMO[this.iItemCnt] = "1st Navigator (Tree) Copyright 1998 Auscomp - World Wide.";
  882.             ++this.iItemCnt;
  883.             this.makeNode(this.iItemCnt, "Copyright parameter missing!", "none", "none");
  884.             this.iLevel[this.iItemCnt] = 0;
  885.             this.aHref[this.iItemCnt] = "http://www.auscomp.com";
  886.             this.aFrame[this.iItemCnt] = "main";
  887.             this.aHref2[this.iItemCnt] = "none";
  888.             this.aFrame2[this.iItemCnt] = "none";
  889.             this.aExpand[this.iItemCnt] = "NO";
  890.             this.aMO[this.iItemCnt] = "Copyright parameter missing!";
  891.             ++this.iItemCnt;
  892.          }
  893.  
  894.       }
  895.    }
  896.  
  897.    public String getAppletInfo() {
  898.       return "1st JAVA Navigator[Tree] 5.0 (c)1997-1999 Auscomp - World Wide (www.auscomp.com)";
  899.    }
  900.  
  901.    private void readFile(String tFile) {
  902.       this.aHref = new String[2999];
  903.       this.aFrame = new String[2999];
  904.       this.aHref2 = new String[2999];
  905.       this.aFrame2 = new String[2999];
  906.       this.aExpand = new String[2999];
  907.       this.aMO = new String[2999];
  908.       this.iLevel = new int[2999];
  909.       this.field_1 = new TreeNode[2999];
  910.       this.TN1 = new TreeNode[2999];
  911.       this.sLine = "";
  912.       this.iYRec = 0;
  913.  
  914.       try {
  915.          URL u = new URL(((Applet)this).getCodeBase(), tFile);
  916.          u.openConnection();
  917.          u.getContent();
  918.          InputStream in = u.openStream();
  919.          DataInputStream datainStream = new DataInputStream(in);
  920.  
  921.          while((this.sLine = datainStream.readLine()) != null) {
  922.             if (!this.sLine.trim().equalsIgnoreCase("")) {
  923.                this.workParam("Line: " + this.iYRec, this.sLine);
  924.                ++this.iYRec;
  925.             }
  926.          }
  927.  
  928.       } catch (MalformedURLException var5) {
  929.          System.err.println("URL Error");
  930.       } catch (IOException e) {
  931.          System.out.println("Error - File not found (" + ((Applet)this).getCodeBase() + tFile + ")");
  932.          ((Throwable)e).printStackTrace();
  933.       }
  934.    }
  935. }
  936.