home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1996 October / PCO_10.ISO / filesbbs / clearweb.arj / CVIEW.CMP / APPLET.ZIP / CWebView.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-08-15  |  18.4 KB  |  623 lines

  1. import java.applet.Applet;
  2. import java.applet.AppletContext;
  3. import java.awt.Button;
  4. import java.awt.Color;
  5. import java.awt.Component;
  6. import java.awt.Container;
  7. import java.awt.Event;
  8. import java.awt.Font;
  9. import java.awt.GridBagConstraints;
  10. import java.awt.GridBagLayout;
  11. import java.awt.Image;
  12. import java.awt.MediaTracker;
  13. import java.awt.TextArea;
  14. import java.awt.TextComponent;
  15. import java.awt.TextField;
  16. import java.io.DataInput;
  17. import java.io.DataInputStream;
  18. import java.io.IOException;
  19. import java.net.MalformedURLException;
  20. import java.net.URL;
  21.  
  22. public class CWebView extends Applet implements OutlineOwner, Runnable {
  23.    private static final boolean DEMO_VERSION = true;
  24.    private static final int DEMO_MAX_NODES = 10000;
  25.    private static boolean IS_WINDOWS_SYSTEM = true;
  26.    public static final int ICON_NUMBER = 19;
  27.    public static final int ICON_HEIGHT = 13;
  28.    public static final int ICON_WIDTH = 13;
  29.    public static final int SCROLL_DELAY_TIME = 80;
  30.    public static final Color warningBack;
  31.    public static final Color warningFore;
  32.    public static final String copyright = "CLEARweb Java Applet. Copyright Clear Software Inc 1996. www.clearsoft.com/clearweb ";
  33.    private static final String[][] ParameterInfo;
  34.    String sourceURL;
  35.    boolean useIcons = false;
  36.    String helpURL = "http://www.clearsoft.com/applet/help.html";
  37.    boolean gotoFrame;
  38.    String frameName;
  39.    boolean showToolbar = true;
  40.    boolean showFrameSwitch = true;
  41.    boolean showDesc = true;
  42.    int descRows = 2;
  43.    boolean showAddress = true;
  44.    String sDnloadText = "D";
  45.    String sHelpText = "?";
  46.    String sFrameText = "[|]";
  47.    String sNoFrameText = "[]";
  48.    String sSearchText = "S";
  49.    String sGotoText = "G";
  50.    String textFont = "Courier";
  51.    int textFontSize = 12;
  52.    Color backColor = new Color(-1);
  53.    Color foreColor = new Color(-16777216);
  54.    Color backSelColor = new Color(-16776961);
  55.    Color foreSelColor = new Color(-1);
  56.    Color foreVisColor = new Color(-65536);
  57.    String loadMapText = "Loading CLEARweb Map";
  58.    String loadURLText1 = "Loading:";
  59.    String loadURLText2 = "  Please wait...";
  60.    String loadURLError1 = "Error: this node has no address";
  61.    String loadURLError2 = "Error: this node has invalid address";
  62.    boolean useFrames = true;
  63.    Outline olBookmarks;
  64.    Button bSearchTitle;
  65.    Button bHelp;
  66.    Button bDnload;
  67.    Button bFrameSwitch;
  68.    Button bGoto;
  69.    TextArea taDescription;
  70.    TextField tfSearchTitle;
  71.    TextField tfAddress;
  72.    TextField tfBanner;
  73.    Image[] iconArray = new Image[19];
  74.    Thread loader;
  75.    boolean loading = true;
  76.  
  77.    public CWebView() {
  78.       if (System.getProperty("os.name").indexOf("indows") != -1) {
  79.          IS_WINDOWS_SYSTEM = true;
  80.       } else {
  81.          IS_WINDOWS_SYSTEM = false;
  82.       }
  83.    }
  84.  
  85.    public void stop() {
  86.       this.stopScrollingBanner();
  87.    }
  88.  
  89.    public void init() {
  90.       this.parseParameters();
  91.       this.setupInterface();
  92.       this.loader = new Thread(this);
  93.       this.loader.start();
  94.       if (!IS_WINDOWS_SYSTEM) {
  95.          this.loader = null;
  96.       }
  97.  
  98.    }
  99.  
  100.    private void parseParameters() {
  101.       this.sourceURL = this.getStringParameter("Source", "");
  102.       this.useIcons = this.getBooleanParameter("ShowIcons", this.useIcons);
  103.       if (((Applet)this).getParameter("UseFrame") != null) {
  104.          this.gotoFrame = true;
  105.          this.frameName = new String(((Applet)this).getParameter("UseFrame"));
  106.       } else {
  107.          this.gotoFrame = false;
  108.       }
  109.  
  110.       if (((Applet)this).getParameter("ShowToolbar") != null) {
  111.          try {
  112.             int toolbarFormat = Integer.parseInt(((Applet)this).getParameter("ShowToolbar"));
  113.             if (toolbarFormat < 0) {
  114.                toolbarFormat = 0;
  115.             }
  116.  
  117.             if (toolbarFormat > 2) {
  118.                toolbarFormat = 2;
  119.             }
  120.  
  121.             if (toolbarFormat > 0) {
  122.                this.showToolbar = true;
  123.             }
  124.  
  125.             if (toolbarFormat > 1) {
  126.                this.showFrameSwitch = true;
  127.             } else {
  128.                this.showFrameSwitch = false;
  129.             }
  130.          } catch (NumberFormatException var9) {
  131.          }
  132.       }
  133.  
  134.       try {
  135.          if (((Applet)this).getParameter("ShowDescription") != null) {
  136.             this.descRows = Integer.parseInt(((Applet)this).getParameter("ShowDescription"));
  137.          }
  138.  
  139.          if (this.descRows <= 0) {
  140.             this.showDesc = false;
  141.          } else {
  142.             this.showDesc = true;
  143.          }
  144.       } catch (NumberFormatException var8) {
  145.       }
  146.  
  147.       this.sDnloadText = this.getStringParameter("DnloadButtonText", this.sDnloadText);
  148.       this.sHelpText = this.getStringParameter("HelpButtonText", this.sHelpText);
  149.       this.sFrameText = this.getStringParameter("FrameButtonTextSplit", this.sFrameText);
  150.       this.sNoFrameText = this.getStringParameter("FrameButtonTextFull", this.sNoFrameText);
  151.       this.sSearchText = this.getStringParameter("SearchButtonText", this.sSearchText);
  152.       this.sGotoText = this.getStringParameter("GotoButtonText", this.sGotoText);
  153.       this.textFont = this.getStringParameter("Font", this.textFont);
  154.  
  155.       try {
  156.          if (((Applet)this).getParameter("FontSize") != null) {
  157.             this.textFontSize = Integer.parseInt(((Applet)this).getParameter("FontSize"));
  158.          }
  159.       } catch (NumberFormatException var7) {
  160.       }
  161.  
  162.       try {
  163.          if (((Applet)this).getParameter("BackColor") != null) {
  164.             this.backColor = new Color(Integer.parseInt(((Applet)this).getParameter("BackColor"), 16));
  165.          }
  166.       } catch (NumberFormatException var6) {
  167.       }
  168.  
  169.       try {
  170.          if (((Applet)this).getParameter("ForeColor") != null) {
  171.             this.foreColor = new Color(Integer.parseInt(((Applet)this).getParameter("ForeColor"), 16));
  172.          }
  173.       } catch (NumberFormatException var5) {
  174.       }
  175.  
  176.       try {
  177.          if (((Applet)this).getParameter("SelectedBackColor") != null) {
  178.             this.backSelColor = new Color(Integer.parseInt(((Applet)this).getParameter("SelectedBackColor"), 16));
  179.          }
  180.       } catch (NumberFormatException var4) {
  181.       }
  182.  
  183.       try {
  184.          if (((Applet)this).getParameter("SelectedForeColor") != null) {
  185.             this.foreSelColor = new Color(Integer.parseInt(((Applet)this).getParameter("SelectedForeColor"), 16));
  186.          }
  187.       } catch (NumberFormatException var3) {
  188.       }
  189.  
  190.       try {
  191.          if (((Applet)this).getParameter("VisitedForeColor") != null) {
  192.             this.foreVisColor = new Color(Integer.parseInt(((Applet)this).getParameter("VisistedForeColor"), 16));
  193.          }
  194.       } catch (NumberFormatException var2) {
  195.       }
  196.  
  197.       this.loadMapText = this.getStringParameter("LoadMapText", this.loadMapText);
  198.       this.loadURLText1 = this.getStringParameter("LoadURLText1", this.loadURLText1);
  199.       this.loadURLText2 = this.getStringParameter("LoadURLText2", this.loadURLText2);
  200.       this.loadURLError1 = this.getStringParameter("LoadURLError1", this.loadURLError1);
  201.       this.loadURLError2 = this.getStringParameter("LoadURLError2", this.loadURLError2);
  202.    }
  203.  
  204.    private void setupInterface() {
  205.       GridBagLayout gbl = new GridBagLayout();
  206.       ((Container)this).setLayout(gbl);
  207.       int nextX = 0;
  208.       int nextY = 0;
  209.       this.tfBanner = new TextField();
  210.       this.tfBanner.setBackground(Color.red);
  211.       this.tfBanner.setForeground(Color.white);
  212.       this.addControl(this.tfBanner, gbl, 0, 0, nextX, 1, 100, 0, 2);
  213.       this.tfBanner.setEditable(false);
  214.       ++nextY;
  215.       if (this.showToolbar) {
  216.          this.bDnload = new Button(this.sDnloadText);
  217.          this.addControl(this.bDnload, gbl, nextX, nextY, 1, 1, 0, 0, 0);
  218.          ++nextX;
  219.          this.bHelp = new Button(this.sHelpText);
  220.          this.addControl(this.bHelp, gbl, nextX, nextY, 1, 1, 0, 0, 0);
  221.          ++nextX;
  222.          if (this.showFrameSwitch) {
  223.             this.bFrameSwitch = new Button(this.sFrameText);
  224.             this.addControl(this.bFrameSwitch, gbl, nextX, nextY, 1, 1, 0, 0, 0);
  225.             ++nextX;
  226.          }
  227.  
  228.          this.tfSearchTitle = new TextField();
  229.          this.addControl(this.tfSearchTitle, gbl, nextX, nextY, 1, 1, 100, 0, 2);
  230.          ++nextX;
  231.          this.bSearchTitle = new Button(this.sSearchText);
  232.          this.addControl(this.bSearchTitle, gbl, nextX, nextY, 1, 1, 0, 0, 0);
  233.          ++nextX;
  234.          ++nextY;
  235.       }
  236.  
  237.       this.olBookmarks = new Outline(this);
  238.       this.olBookmarks.setColors(this.backColor, this.foreColor, this.backSelColor, this.foreSelColor, this.foreVisColor);
  239.       this.olBookmarks.setFont(this.textFont, this.textFontSize);
  240.       this.addControl(this.olBookmarks, gbl, 0, nextY, nextX, 1, 100, 100, 1);
  241.       ++nextY;
  242.       if (this.showAddress) {
  243.          this.tfAddress = new TextField();
  244.          this.addControl(this.tfAddress, gbl, 0, nextY, nextX - 1, 1, 100, 0, 2);
  245.          this.tfAddress.setEditable(false);
  246.          this.bGoto = new Button(this.sGotoText);
  247.          this.addControl(this.bGoto, gbl, nextX - 1, nextY, 1, 1, 0, 0, 0);
  248.          ++nextY;
  249.       }
  250.  
  251.       if (this.showDesc) {
  252.          this.taDescription = new TextArea(this.descRows, 20);
  253.          this.addControl(this.taDescription, gbl, 0, nextY, nextX, this.descRows, 100, 0, 2);
  254.          this.taDescription.setEditable(false);
  255.          ++nextY;
  256.       }
  257.  
  258.    }
  259.  
  260.    public void run() {
  261.       MediaTracker tracker = null;
  262.       this.loading = true;
  263.       if (this.useIcons) {
  264.          tracker = new MediaTracker(this);
  265.  
  266.          for(int i = 0; i < 19; ++i) {
  267.             this.iconArray[i] = ((Applet)this).getImage(((Applet)this).getCodeBase(), "icons/icon" + i + ".gif");
  268.             tracker.addImage(this.iconArray[i], 0);
  269.          }
  270.  
  271.          tracker.statusAll(true);
  272.       } else {
  273.          for(int i = 0; i < 19; ++i) {
  274.             this.iconArray[i] = null;
  275.          }
  276.       }
  277.  
  278.       this.olBookmarks.setUpdating(false);
  279.       this.olBookmarks.disable();
  280.  
  281.       try {
  282.          URL url = new URL(((Applet)this).getDocumentBase(), this.sourceURL);
  283.          this.createOutlineFromStream(new DataInputStream(url.openStream()));
  284.          this.tfAddress.setText(this.loadMapText);
  285.          if (this.useIcons) {
  286.             try {
  287.                tracker.waitForAll();
  288.             } catch (InterruptedException var5) {
  289.             }
  290.          }
  291.  
  292.          if (this.useIcons && (tracker.statusAll(true) & 8) == 0) {
  293.             System.out.println("Error creating icons, quitting");
  294.             ((Applet)this).getAppletContext().showStatus("Error creating icons, quitting");
  295.          } else {
  296.             this.olBookmarks.expandWholeOutline();
  297.             this.olBookmarks.setCurrentNode(0);
  298.             this.olBookmarks.enable();
  299.             this.olBookmarks.setUpdating(true);
  300.             this.loading = false;
  301.             this.scrollLineOnTextField(this.tfBanner, "CLEARweb Java Applet. Copyright Clear Software Inc 1996. www.clearsoft.com/clearweb ", -1);
  302.          }
  303.       } catch (IOException e) {
  304.          System.out.println("Error " + e);
  305.       }
  306.    }
  307.  
  308.    private boolean getBooleanParameter(String name, boolean def) {
  309.       if (((Applet)this).getParameter(name) == null) {
  310.          return def;
  311.       } else {
  312.          try {
  313.             return Integer.parseInt(((Applet)this).getParameter(name)) != 0;
  314.          } catch (NumberFormatException var3) {
  315.             return def;
  316.          }
  317.       }
  318.    }
  319.  
  320.    private String getStringParameter(String name, String def) {
  321.       return ((Applet)this).getParameter(name) == null ? def : new String(((Applet)this).getParameter(name));
  322.    }
  323.  
  324.    private void scrollLineOnTextField(TextField field, String line, int times) {
  325.       if (line != null) {
  326.          if (field != null) {
  327.             if (!IS_WINDOWS_SYSTEM) {
  328.                ((TextComponent)field).setText(line);
  329.             } else {
  330.                String fillerLine = "";
  331.                String anim = fillerLine + line;
  332.  
  333.                while(times > 0 || times == -1) {
  334.                   ((TextComponent)field).setText(anim);
  335.                   anim = anim.substring(1);
  336.  
  337.                   try {
  338.                      Thread.sleep(80L);
  339.                   } catch (InterruptedException var6) {
  340.                      break;
  341.                   }
  342.  
  343.                   if (anim.length() == 0) {
  344.                      if (times > 0) {
  345.                         --times;
  346.                      }
  347.  
  348.                      anim = fillerLine + line;
  349.                   }
  350.                }
  351.  
  352.                ((TextComponent)field).setText("");
  353.             }
  354.          }
  355.       }
  356.    }
  357.  
  358.    private void stopScrollingBanner() {
  359.       if (!this.loading && this.loader != null) {
  360.          this.loader.stop();
  361.          this.loader = null;
  362.          this.tfBanner.setText("CLEARweb Java Applet. Copyright Clear Software Inc 1996. www.clearsoft.com/clearweb ");
  363.       }
  364.  
  365.    }
  366.  
  367.    public void nodeSelected(Outline otl, int idx) {
  368.       BookmarkNode nd = (BookmarkNode)otl.getNodeData(idx);
  369.       if (this.showAddress) {
  370.          this.tfAddress.setText(nd.NodeURL());
  371.       }
  372.  
  373.       if (this.showDesc) {
  374.          this.taDescription.setText(nd.NodeDesc());
  375.       }
  376.  
  377.       this.stopScrollingBanner();
  378.    }
  379.  
  380.    public void nodeDoubleClicked(Outline otl, int idx, int where) {
  381.       this.gotoItem(idx);
  382.    }
  383.  
  384.    public void nodeExpanded(Outline otl, int idx) {
  385.    }
  386.  
  387.    public void nodeCollapsed(Outline otl, int idx) {
  388.    }
  389.  
  390.    public boolean handleEvent(Event evt) {
  391.       if (evt.id == 402 && evt.target == this.tfSearchTitle && evt.key == 10) {
  392.          this.findItem(this.tfSearchTitle.getText());
  393.       }
  394.  
  395.       return super.handleEvent(evt);
  396.    }
  397.  
  398.    public boolean action(Event evt, Object arg) {
  399.       this.stopScrollingBanner();
  400.       if (this.bFrameSwitch != null && arg.equals(this.bFrameSwitch.getLabel())) {
  401.          this.useFrames = !this.useFrames;
  402.          if (this.useFrames) {
  403.             this.bFrameSwitch.setLabel(this.sFrameText);
  404.          } else {
  405.             this.bFrameSwitch.setLabel(this.sNoFrameText);
  406.          }
  407.  
  408.          ((Container)this).layout();
  409.       } else if (this.bDnload != null && arg.equals(this.bDnload.getLabel())) {
  410.          try {
  411.             this.gotoPage((new URL(((Applet)this).getDocumentBase(), this.sourceURL)).toString());
  412.          } catch (MalformedURLException var3) {
  413.          }
  414.       } else if (this.bHelp != null && arg.equals(this.bHelp.getLabel())) {
  415.          this.gotoPage(this.helpURL);
  416.       } else if (this.bSearchTitle != null && arg.equals(this.bSearchTitle.getLabel())) {
  417.          this.findItem(this.tfSearchTitle.getText());
  418.       } else {
  419.          if (this.bGoto == null || !arg.equals(this.bGoto.getLabel())) {
  420.             return false;
  421.          }
  422.  
  423.          this.gotoItem(this.olBookmarks.getCurrentNode());
  424.       }
  425.  
  426.       return true;
  427.    }
  428.  
  429.    private void findItem(String str) {
  430.       int idx = this.olBookmarks.getCurrentNode();
  431.  
  432.       for(int i = idx + 1; i < this.olBookmarks.getNodes(); ++i) {
  433.          BookmarkNode bnd = (BookmarkNode)this.olBookmarks.getNodeData(i);
  434.          if (bnd.NodeTitle().toUpperCase().indexOf(str.toUpperCase()) != -1) {
  435.             this.olBookmarks.setCurrentNode(i);
  436.             return;
  437.          }
  438.       }
  439.  
  440.    }
  441.  
  442.    private void gotoItem(int idx) {
  443.       if (idx < this.olBookmarks.getNodes() && idx >= 0) {
  444.          this.olBookmarks.setCurrentNode(idx);
  445.          BookmarkNode nd = (BookmarkNode)this.olBookmarks.getNodeData(idx);
  446.          this.gotoPage(nd.NodeURL());
  447.          nd.setSecondary(true);
  448.          this.tfAddress.setText(nd.NodeURL());
  449.       }
  450.    }
  451.  
  452.    private void gotoPage(String urlStr) {
  453.       Color back = Color.red;
  454.       Color fore = Color.red;
  455.       if (urlStr.equals("")) {
  456.          if (this.showAddress) {
  457.             this.tfAddress.setText(this.loadURLError2);
  458.          }
  459.  
  460.       } else {
  461.          try {
  462.             this.olBookmarks.disable();
  463.             if (urlStr.startsWith("www.")) {
  464.                urlStr = "http://" + urlStr;
  465.             }
  466.  
  467.             URL url = new URL(urlStr);
  468.             AppletContext ac = ((Applet)this).getAppletContext();
  469.             if (!this.useFrames) {
  470.                ac.showDocument(url, "_top");
  471.             } else if (this.gotoFrame) {
  472.                ac.showDocument(url, this.frameName);
  473.             } else {
  474.                ac.showDocument(url, "_top");
  475.             }
  476.  
  477.             if (this.showAddress && IS_WINDOWS_SYSTEM) {
  478.                fore = this.tfAddress.getForeground();
  479.                back = this.tfAddress.getBackground();
  480.                Font font = this.tfAddress.getFont();
  481.                this.tfAddress.setBackground(warningBack);
  482.                this.tfAddress.setForeground(warningFore);
  483.                this.tfAddress.setFont(new Font(font.getName(), 1, font.getSize()));
  484.                String anim = "          " + this.loadURLText1 + " " + urlStr + "  " + this.loadURLText2;
  485.                this.scrollLineOnTextField(this.tfAddress, anim, 1);
  486.                this.tfAddress.setBackground(back);
  487.                this.tfAddress.setForeground(fore);
  488.                this.tfAddress.setFont(font);
  489.             }
  490.          } catch (MalformedURLException var12) {
  491.             if (this.showAddress) {
  492.                this.tfAddress.setText(this.loadURLError2);
  493.             }
  494.          } finally {
  495.             this.olBookmarks.enable();
  496.             this.olBookmarks.requestFocus();
  497.          }
  498.  
  499.       }
  500.    }
  501.  
  502.    private int getTitleURL(String str, StringBuffer title, StringBuffer url) {
  503.       String testString = str.toUpperCase();
  504.       title.setLength(0);
  505.       url.setLength(0);
  506.       if (!testString.startsWith("<A")) {
  507.          title.append(str);
  508.       } else {
  509.          int sp = str.indexOf(">");
  510.          int lp = str.indexOf(60, sp);
  511.          title.append(str.substring(sp + 1, lp));
  512.          sp = testString.indexOf("HREF=\"");
  513.          sp += 5;
  514.          lp = str.indexOf(34, sp + 1);
  515.          url.append(str.substring(sp + 1, lp));
  516.       }
  517.  
  518.       String ts = title.toString();
  519.       int sp = ts.lastIndexOf("{*S");
  520.       int lp = ts.lastIndexOf("}");
  521.  
  522.       int id;
  523.       try {
  524.          id = Integer.parseInt(ts.substring(sp + 3, lp));
  525.          title.setLength(sp);
  526.       } catch (NumberFormatException var9) {
  527.          id = 1;
  528.       }
  529.  
  530.       String var15 = null;
  531.       return id;
  532.    }
  533.  
  534.    private void addControl(Component cp, GridBagLayout gbl, int x, int y, int w, int h, int wx, int wy, int fill) {
  535.       GridBagConstraints gbc = new GridBagConstraints();
  536.       gbc.gridx = x;
  537.       gbc.gridy = y;
  538.       gbc.gridwidth = w;
  539.       gbc.gridheight = h;
  540.       gbc.weightx = (double)wx;
  541.       gbc.weighty = (double)wy;
  542.       gbc.fill = fill;
  543.       gbl.setConstraints(cp, gbc);
  544.       ((Container)this).add(cp);
  545.    }
  546.  
  547.    private void createOutlineFromStream(DataInput inp) {
  548.       new String("");
  549.       new String("");
  550.       StringBuffer title = new StringBuffer();
  551.       StringBuffer url = new StringBuffer();
  552.       StringBuffer desc = new StringBuffer();
  553.       int currentNode = -1;
  554.       this.olBookmarks.clearOutline();
  555.       int addMethod = 1;
  556.  
  557.       try {
  558.          String currentLine = inp.readLine();
  559.  
  560.          while(currentLine != null) {
  561.             currentLine = currentLine.trim();
  562.             if (currentLine.indexOf("</DL>") != -1) {
  563.                if (addMethod == 1) {
  564.                   currentNode = this.olBookmarks.getParent(currentNode);
  565.                } else {
  566.                   currentNode = this.olBookmarks.getParent(this.olBookmarks.getParent(currentNode));
  567.                }
  568.  
  569.                addMethod = 1;
  570.             } else if (currentLine.indexOf("<DL>") != -1) {
  571.                addMethod = 1;
  572.             } else if (currentLine.indexOf("<DT>") != -1) {
  573.                int id = this.getTitleURL(currentLine.substring(currentLine.indexOf("<DT>") + 4), title, url);
  574.                currentLine = inp.readLine();
  575.                desc.setLength(0);
  576.                int sp = currentLine.indexOf("<DD>");
  577.                if (sp != -1) {
  578.                   desc.append(currentLine.substring(sp + 4));
  579.  
  580.                   for(currentLine = inp.readLine(); currentLine.indexOf(60) == -1; currentLine = inp.readLine()) {
  581.                      currentLine.trim();
  582.                      desc.append(" " + currentLine.trim());
  583.                   }
  584.                }
  585.  
  586.                BookmarkNode bnd = new BookmarkNode(title.toString(), url.toString(), desc.toString());
  587.                if (id < 0) {
  588.                   id = 1;
  589.                }
  590.  
  591.                if (id >= 19) {
  592.                   id = 1;
  593.                }
  594.  
  595.                bnd.setIcon(this.iconArray[id]);
  596.                this.olBookmarks.addNode(currentNode, addMethod, bnd);
  597.                currentNode = this.olBookmarks.getNodes() - 1;
  598.                addMethod = 3;
  599.                if (currentNode == 9999) {
  600.                   return;
  601.                }
  602.                continue;
  603.             }
  604.  
  605.             currentLine = inp.readLine();
  606.          }
  607.  
  608.       } catch (Exception e) {
  609.          System.out.println("Error " + e);
  610.       }
  611.    }
  612.  
  613.    public String[][] getParameterInfo() {
  614.       return ParameterInfo;
  615.    }
  616.  
  617.    static {
  618.       warningBack = Color.red;
  619.       warningFore = Color.white;
  620.       ParameterInfo = new String[][]{{"Source\t\t", "url\t\t", "URL of the source CWO relative to document"}, {"ShowIcons\t\t", "boolean(1/0)\t", "Use icons in the outline, default false(0)"}, {"HelpURL\t\t", "url\t\t", "The URL which should be shown when help button is pressed"}, {"UseFrame\t\t", "string\t\t", "The name of the content frame default \"\""}, {"ShowToolbar\t", "integer value(0/1/2)\t", "0-none, 1-without frame switch button, 2-full, default 2"}, {"ShowDescription\t", "integer value\t", "The number of rows in the description field(0 if none), default 2"}, {"DnloadButtonText\t", "string\t\t", "Text on the download button, default \"D\""}, {"HelpButtonText\t", "string\t\t", "Text on the help button, default \"?\""}, {"FrameButtonTextSplit\t", "string\t\t", "Text on the frame switch, when using other frame, default \"[|]\""}, {"FrameButtonTextFull\t", "string\t\t", "Text on the frame switch, when using same frame, default \"[]\""}, {"SearchButtonText\t", "string\t\t", "Text on the Search button, default \"S\""}, {"GotoButtonText\t", "string\t\t", "Text on the Goto button, default \"G\""}, {"Font\t\t", "string\t\t", "The name of the font to be used in the outline, default \"Courier\""}, {"FontSize\t\t", "integer value\t", "Size of the font to be used in the outline, default 12"}, {"BackColor\t\t", "hexadecimal value\t", "Color of the background of the outline, default FFFFFF"}, {"ForeColor\t\t", "hexadecimal value\t", "Color of the outline text, default 000000"}, {"SelectedBackColor\t", "hexadecimal value\t", "Color of the background of the selected node, default 0000FF"}, {"SelectedForeColor\t", "hexadecimal value\t", "Color of the foreground of the selected node, default FFFFFF"}, {"VisitedForeColor\t", "hexadecimal value\t", "Color of the foreground of the visited node, default FF0000"}, {"LoadMapText\t", "string\t\t", "The text which appears when loading data, default \"Loading CLEARweb Map\""}, {"LoadURLText1\t", "string\t\t", "The address line prefix for goto, default \"Loading\""}, {"LoadURLText2\t", "string\t\t", "The address line suffix for goto, default \"    Please wait...\""}, {"LoadURLError1\t", "string\t\t", "There is no address error, default \"This item has no address\""}, {"LoadURLError2\t", "string\t\t", "Invalid address error, default \"Error: This item has invalid address\""}};
  621.    }
  622. }
  623.