www.pudn.com > searchhtml.zip > Search.java


 
import java.applet.Applet; 
import java.applet.AppletContext; 
import java.awt.*; 
import java.io.*; 
import java.net.MalformedURLException; 
import java.net.URL; 
import java.util.*; 
 
public class Search extends Applet 
    implements Runnable 
{ 
 
    public Search() 
    { 
        criteria = "or"; 
        nofollow = false; 
        linksonly = false; 
        forwardonly = false; 
    } 
 
    public void stop() 
    { 
        if(th != null) 
        { 
            try 
            { 
                th.stop(); 
            } 
            catch(Exception _ex) { } 
            th = null; 
        } 
    } 
 
    public void destroy() 
    { 
        th = null; 
    } 
 
    public void init() 
    { 
        getAllParameters(); 
        try 
        { 
            firsturl = new URL(getDocumentBase(), indexpage); 
            baseurl = getBase(firsturl.toString()); 
        } 
        catch(Exception _ex) { } 
        allUrls = new Vector(); 
        urls = new Vector(); 
        paired = new Hashtable(); 
        entitys = new Hashtable(htmlEntitys.length * 2); 
        loadEntitys(htmlEntitys, entitys); 
        label1 = new Label(); 
        label2 = new Label(); 
        checkbox1 = new Checkbox(); 
        checkbox2 = new Checkbox(); 
        checkbox3 = new Checkbox(); 
        textField1 = new TextField(); 
        button1 = new Button(); 
        list1 = new List(); 
        p = new Panel(); 
        p.setLayout(new BorderLayout()); 
        setLayout(null); 
        setBackground(new Color(appletbg)); 
        textField1.setBackground(new Color(textfieldbg)); 
        textField1.setForeground(new Color(textfieldfg)); 
        label1.setForeground(new Color(labelfg)); 
        label1.setBackground(new Color(labelbg)); 
        label1.setFont(new Font(labelfont, 1, labelfontsize)); 
        label1.setText(labeltext.trim() + " - [10 day Trial]"); 
        label2.setBackground(new Color(checkboxbg)); 
        label2.setForeground(new Color(checkboxfg)); 
        label2.setFont(new Font(appletfont, 0, appletfontsize)); 
        label2.setText(checkboxtext1); 
        checkbox1.setBackground(new Color(checkboxbg)); 
        checkbox1.setForeground(new Color(checkboxfg)); 
        checkbox1.setFont(new Font(appletfont, 0, appletfontsize)); 
        checkbox1.setLabel(checkboxtext2); 
        checkbox1.setState(true); 
        checkbox2.setBackground(new Color(checkboxbg)); 
        checkbox2.setForeground(new Color(checkboxfg)); 
        checkbox2.setFont(new Font(appletfont, 0, appletfontsize)); 
        checkbox2.setLabel(checkboxtext3); 
        checkbox3.setBackground(new Color(checkboxbg)); 
        checkbox3.setForeground(new Color(checkboxfg)); 
        checkbox3.setFont(new Font(appletfont, 0, appletfontsize)); 
        checkbox3.setLabel(checkboxtext4); 
        button1.setBackground(new Color(buttonbg)); 
        button1.setForeground(new Color(buttonfg)); 
        button1.setLabel(buttontext1); 
        list1.setForeground(new Color(listfg)); 
        list1.setBackground(new Color(listbg)); 
        label1.reshape(labelx, labely, labelwidth, labelheight); 
        label2.reshape(chbox1x, chbox1y, chbox1width, chbox1height); 
        checkbox1.reshape(chbox2x, chbox2y, chbox2width, chbox2height); 
        checkbox2.reshape(chbox3x, chbox3y, chbox3width, chbox3height); 
        checkbox3.reshape(chbox4x, chbox4y, chbox4width, chbox4height); 
        textField1.reshape(txtfieldx, txtfieldy, txtfieldwidth, txtfieldheight); 
        button1.reshape(buttonx, buttony, buttonwidth, buttonheight); 
        p.reshape(listx, listy, listwidth, listheight); 
        list1.resize(listwidth, listheight); 
        p.add("Center", list1); 
        add(label1); 
        add(textField1); 
        add(label2); 
        add(checkbox1); 
        add(checkbox2); 
        add(checkbox3); 
        add(button1); 
        add(p); 
        try 
        { 
            System.out.println("\n\nLundin site Search Applet v 1.2.2,\nCopyright (c) 1998 Patrik Lundin,\nplundin@kagi.com\n"); 
            System.out.println("This Applet is Licensed to: TRIAL VERSION\nLicenstype: 10 DAY TRIAL\nLicensnumber: 980625-TRIAL\n"); 
            return; 
        } 
        catch(Exception _ex) 
        { 
            return; 
        } 
    } 
 
    void getAllParameters() 
    { 
        try 
        { 
            indexpage = getStringParameter("firstpage", "index.html"); 
            targetName = getStringParameter("targetname", "_top"); 
            labeltext = getStringParameter("labeltext_XSWQ123sde", " Site Search Applet"); 
            checkboxtext1 = getStringParameter("checkboxtext1", "Criteria "); 
            checkboxtext2 = getStringParameter("checkboxtext2", "Or"); 
            checkboxtext3 = getStringParameter("checkboxtext3", "And"); 
            checkboxtext4 = getStringParameter("checkboxtext4", "Phrases"); 
            buttontext1 = getStringParameter("buttontext1", "Search"); 
            buttontext2 = getStringParameter("buttontext2", "Stop"); 
            completedtext = getStringParameter("completedtext", "Search completed, double click on a link"); 
            notfoundtext = getStringParameter("notfoundtext", "No hits found"); 
            parsingtext = getStringParameter("parsingtext", "Parsing links: "); 
            searchingtext = getStringParameter("searchingtext", "Searching in: "); 
            readingtext = getStringParameter("readingtext", "Reading file: "); 
            labelfont = getStringParameter("labelfont", "Dialog"); 
            appletfont = getStringParameter("appletfont", "Dialog"); 
            maxhits = getIntParameter("maxhits", "30", 10); 
            truncate = getIntParameter("truncate", "50", 10); 
            labelfontsize = getIntParameter("labelfontsize", "11", 10); 
            appletfontsize = getIntParameter("appletfontsize", "10", 10); 
            labelfg = getIntParameter("labelfg", "FFFFFF", 16); 
            labelbg = getIntParameter("labelbg", "000080", 16); 
            appletbg = getIntParameter("appletbg_XSWQ123sde", "008080", 16); 
            textfieldbg = getIntParameter("textfieldbg", "00A880", 16); 
            checkboxbg = getIntParameter("checkboxbg", "008080", 16); 
            checkboxfg = getIntParameter("checkboxfg", "000000", 16); 
            buttonbg = getIntParameter("buttonbg", "CCCCCC", 16); 
            buttonfg = getIntParameter("buttonfg", "0000FF", 16); 
            listbg = getIntParameter("listbg", "CCCCCC", 16); 
            listfg = getIntParameter("listfg", "0000FF", 16); 
            textfieldfg = getIntParameter("textfieldfg", "000000", 16); 
            labelx = getIntParameter("labelx", "0", 10); 
            labely = getIntParameter("labely", "0", 10); 
            labelwidth = getIntParameter("labelwidth", "360", 10); 
            labelheight = getIntParameter("labelheight", "24", 10); 
            chbox1x = getIntParameter("chbox1x", "6", 10); 
            chbox1y = getIntParameter("chbox1y", "30", 10); 
            chbox1width = getIntParameter("chbox1width", "40", 10); 
            chbox1height = getIntParameter("chbox1height", "11", 10); 
            chbox2x = getIntParameter("chbox2x", "55", 10); 
            chbox2y = getIntParameter("chbox2y", "30", 10); 
            chbox2width = getIntParameter("chbox2width", "54", 10); 
            chbox2height = getIntParameter("chbox2height", "11", 10); 
            chbox3x = getIntParameter("chbox3x", "110", 10); 
            chbox3y = getIntParameter("chbox3y", "30", 10); 
            chbox3width = getIntParameter("chbox3width", "56", 10); 
            chbox3height = getIntParameter("chbox3height", "11", 10); 
            chbox4x = getIntParameter("chbox4x", "168", 10); 
            chbox4y = getIntParameter("chbox4y", "30", 10); 
            chbox4width = getIntParameter("chbox4width", "65", 10); 
            chbox4height = getIntParameter("chbox4height", "11", 10); 
            txtfieldx = getIntParameter("txtfieldx", "6", 10); 
            txtfieldy = getIntParameter("txtfieldy", "50", 10); 
            txtfieldwidth = getIntParameter("txtfieldwidth", "251", 10); 
            txtfieldheight = getIntParameter("txtfieldheight", "28", 10); 
            buttonx = getIntParameter("buttonx", "265", 10); 
            buttony = getIntParameter("buttony", "52", 10); 
            buttonwidth = getIntParameter("buttonwidth", "48", 10); 
            buttonheight = getIntParameter("buttonheight", "25", 10); 
            listx = getIntParameter("listx", "6", 10); 
            listy = getIntParameter("listy", "84", 10); 
            listwidth = getIntParameter("listwidth", "307", 10); 
            listheight = getIntParameter("listheight", "77", 10); 
            nofollow = getStringParameter("nofollow", "false").equalsIgnoreCase("true"); 
            linksonly = getStringParameter("linksonly", "false").equalsIgnoreCase("true"); 
            forwardonly = getStringParameter("forwardonly", "false").equalsIgnoreCase("true"); 
            if(buttontext1.equalsIgnoreCase(buttontext2)) 
            { 
                buttontext1 = "Search"; 
                buttontext2 = "Stop"; 
                return; 
            } 
        } 
        catch(Exception _ex) { } 
    } 
 
    public String getStringParameter(String s, String s1) 
    { 
        if(getParameter(s) != null) 
            return getParameter(s); 
        else 
            return s1; 
    } 
 
    public int getIntParameter(String s, String s1, int i) 
    { 
        int j; 
        try 
        { 
            String s2 = getParameter(s); 
            if(s2 != null) 
                j = Integer.parseInt(s2, i); 
            else 
                j = Integer.parseInt(s1, i); 
        } 
        catch(Exception _ex) 
        { 
            j = Integer.parseInt(s1, i); 
        } 
        return j; 
    } 
 
    String getBase(String s) 
    { 
        int i = s.lastIndexOf("/"); 
        if(i != -1) 
            return s.substring(0, i + 1); 
        else 
            return s; 
    } 
 
    void loadEntitys(String as[], Hashtable hashtable) 
    { 
        int i = 0; 
        try 
        { 
            while(i < as.length)  
            { 
                String s = as[i]; 
                i++; 
                String s1 = as[i]; 
                i++; 
                String s2 = as[i]; 
                hashtable.put(s1, s); 
                hashtable.put(s2, s); 
                i++; 
            } 
 
            return; 
        } 
        catch(ArrayIndexOutOfBoundsException _ex) 
        { 
            return; 
        } 
    } 
 
    void startThread() 
    { 
        if(th != null) 
        { 
            th.stop(); 
            th = null; 
        } 
        th = new Thread(this); 
        th.start(); 
    } 
 
    void stopThread() 
    { 
        button1.setLabel(buttontext1); 
        if(hits > 0) 
            labelMsg(completedtext + " - [10 day Trial]"); 
        else 
            labelMsg(notfoundtext + " - [10 day Trial]"); 
        if(th != null) 
        { 
            try 
            { 
                th.stop(); 
            } 
            catch(Exception _ex) { } 
            th = null; 
        } 
    } 
 
    public void run() 
    { 
        register(firsturl.toString()); 
        Search(textField1.getText(), criteria, firsturl); 
        stopThread(); 
    } 
 
    void Search(String s, String s1, URL url) 
    { 
        String s2 = ""; 
        String s3 = null; 
        String s4 = ""; 
        Enumeration enumeration = null; 
        try 
        { 
            s2 = readURL(url); 
        } 
        catch(Exception _ex) 
        { 
            return; 
        } 
        labelMsg(searchingtext + url.toString()); 
        if(!nofollow) 
            enumeration = getLinks(s2, url); 
        else 
        if(nofollow && url.toString().equalsIgnoreCase(firsturl.toString())) 
            enumeration = getLinks(s2, url); 
        s2 = translateEntitys(s2); 
        if(!linksonly) 
            s3 = getTitle(s2); 
        else 
            s3 = null; 
        s2 = removeHTML(s2); 
        s4 = url.toString(); 
        if(paired.containsKey(s4)) 
            s4 = (String)paired.get(s4); 
        if(s1.equalsIgnoreCase("or") && matchAny(s, s2)) 
            report(s4, s3); 
        else 
        if(s1.equalsIgnoreCase("and") && matchAll(s, s2)) 
            report(s4, s3); 
        else 
        if(s1.equalsIgnoreCase("phrases") && matchPhrase(s, s2)) 
            report(s4, s3); 
        for(; enumeration != null && enumeration.hasMoreElements(); Search(s, s1, (URL)enumeration.nextElement())); 
    } 
 
    boolean matchAny(String s, String s1) 
    { 
        String s2 = s.toLowerCase(); 
        String s3 = s1.toLowerCase(); 
        for(StringTokenizer stringtokenizer = new StringTokenizer(s2, ", ", false); stringtokenizer.hasMoreTokens();) 
            if(s3.indexOf(stringtokenizer.nextToken()) != -1) 
                return true; 
 
        return false; 
    } 
 
    boolean matchAll(String s, String s1) 
    { 
        String s2 = s.toLowerCase(); 
        String s3 = s1.toLowerCase(); 
        StringTokenizer stringtokenizer = new StringTokenizer(s2, ", ", false); 
        int i = stringtokenizer.countTokens(); 
        while(stringtokenizer.hasMoreTokens())  
            if(s3.indexOf(stringtokenizer.nextToken()) != -1) 
                i--; 
 
        return i == 0; 
    } 
 
    boolean matchPhrase(String s, String s1) 
    { 
        String s2 = s.toLowerCase().trim(); 
        String s3 = s1.toLowerCase(); 
        StringTokenizer stringtokenizer = new StringTokenizer(s2, ",", false); 
        stringtokenizer.countTokens(); 
        while(stringtokenizer.hasMoreTokens())  
            if(s3.indexOf(stringtokenizer.nextToken().trim()) != -1) 
                return true; 
 
        return false; 
    } 
 
    String getTitle(String s) 
    { 
        String s1 = "title"; 
        int i = truncate; 
        String s2 = s.toLowerCase(); 
        int j = s2.indexOf(s1); 
        int k = s2.indexOf("<", j + s1.length()); 
        String s3 = ""; 
        j = s2.indexOf(">", j); 
        if(j >= 0 && k > 0 && j < k) 
        { 
            s3 = s.substring(j + 1, k); 
            if(s3.length() > i) 
                s3 = s3.substring(0, i) + "..."; 
            s3 = s3.replace('\n', ' '); 
            s3 = s3.trim(); 
        } 
        if(!s3.equals("")) 
            return s3; 
        else 
            return null; 
    } 
 
    void report(String s, String s1) 
    { 
        if(s1 != null) 
            list1.addItem(s1); 
        else 
            list1.addItem(s.toString()); 
        urls.addElement(s.toString()); 
        hits++; 
        if(hits >= maxhits) 
            stopThread(); 
    } 
 
    Enumeration getLinks(String s, URL url) 
    { 
        Vector vector = new Vector(); 
        parseLinks(s, "href", url, vector, null); 
        parseLinks(s, "src", url, vector, paired); 
        return vector.elements(); 
    } 
 
    void parseLinks(String s, String s1, URL url, Vector vector, Hashtable hashtable) 
    { 
        String s2 = s.toLowerCase(); 
        String s3 = ""; 
        Object obj = null; 
        int j; 
        boolean flag = false; j = 0; 
        try 
        { 
            int i; 
            for(; (j = s2.indexOf(s1, j)) != -1; j = i) 
            { 
                for(i = j + s1.length(); (s2.charAt(i) == ' ' || s2.charAt(i) == '=' || s2.charAt(i) == '"') && i < s2.length(); i++); 
                int k = s.indexOf(" ", i); 
                int l = s.indexOf("\"", i); 
                int i1 = s.indexOf(">", i); 
                int j1 = s.indexOf("\n", i); 
                if(k < 0) 
                    k = s.length(); 
                if(l < 0) 
                    l = s.length(); 
                if(i1 < 0) 
                    i1 = s.length(); 
                if(j1 < 0) 
                    j1 = s.length(); 
                int k1 = minimum(s.length(), k, l, i1, j1); 
                String s4 = s.substring(i, k1); 
                try 
                { 
                    URL url1 = new URL(url, s4); 
                    if(checkURL(url1)) 
                    { 
                        labelMsg(parsingtext + url1.toString()); 
                        vector.addElement(url1); 
                        if(hashtable != null) 
                            hashtable.put(url1.toString(), url.toString()); 
                    } 
                } 
                catch(MalformedURLException _ex) { } 
            } 
 
            return; 
        } 
        catch(StringIndexOutOfBoundsException _ex) 
        { 
            return; 
        } 
    } 
 
    int minimum(int i, int j, int k, int l, int i1) 
    { 
        return Math.min(Math.min(Math.min(j, i), Math.min(k, i)), Math.min(Math.min(l, i), Math.min(i1, i))); 
    } 
 
    void labelMsg(String s) 
    { 
        label1.setText(s); 
    } 
 
    boolean checkURL(URL url) 
    { 
        String s = url.toString(); 
        if(isRegistred(s)) 
            return false; 
        if(forwardonly && !s.startsWith(baseurl)) 
            return false; 
        if(!url.getHost().equalsIgnoreCase(firsturl.getHost())) 
            return false; 
        if(!checkSuffix(s)) 
        { 
            return false; 
        } 
        else 
        { 
            register(s); 
            return true; 
        } 
    } 
 
    void register(String s) 
    { 
        if(s.indexOf("#") != -1) 
            allUrls.addElement(cleanLink(s)); 
        allUrls.addElement(s); 
    } 
 
    boolean isRegistred(String s) 
    { 
        return allUrls.contains(cleanLink(s)); 
    } 
 
    boolean checkSuffix(String s) 
    { 
        String s1 = ""; 
        if(s.indexOf("#") != -1 || s.indexOf("?") != -1) 
            s1 = cleanLink(s); 
        else 
            s1 = s; 
        s1 = s1.toLowerCase(); 
        if(s1.startsWith("file:")) 
        { 
            if(!s1.endsWith(".html") && !s1.endsWith(".htm") && !s1.endsWith(".txt") && !s1.endsWith(".java") && !s1.endsWith(".pdf")) 
                return false; 
        } 
        else 
        if(!s1.endsWith(".html") && !s1.endsWith(".htm") && !s1.endsWith(".txt") && !s1.endsWith(".java") && !s1.endsWith(".asp") && !s1.endsWith(".pl") && !s1.endsWith(".cgi") && !s1.endsWith(".shtml") && !s1.endsWith(".pdf")) 
            return false; 
        return true; 
    } 
 
    String cleanLink(String s) 
    { 
        if(s.indexOf("#") != -1) 
            return s.substring(0, s.indexOf("#")); 
        if(s.indexOf("?") != -1) 
            return s.substring(0, s.indexOf("?")); 
        else 
            return s; 
    } 
 
    String removeHTML(String s) 
    { 
        boolean flag = false; 
        String s1 = ""; 
        String s2 = ""; 
        for(StringTokenizer stringtokenizer = new StringTokenizer(s, "<"); stringtokenizer.hasMoreTokens();) 
        { 
            String s3 = stringtokenizer.nextToken(); 
            int i = s3.indexOf(">"); 
            if(i != -1) 
                s1 = s1 + s3.substring(i + 1, s3.length()); 
            else 
                s1 = s1 + s3; 
        } 
 
        return s1; 
    } 
 
    String translateEntitys(String s) 
    { 
        boolean flag = false; 
        String s1 = ""; 
        String s2 = ""; 
        String s3 = ""; 
        StringTokenizer stringtokenizer = new StringTokenizer(s, "&", false); 
        byte byte0 = 8; 
        while(stringtokenizer.hasMoreTokens())  
        { 
            String s4 = stringtokenizer.nextToken(); 
            int i = s4.indexOf(";"); 
            if(i != -1 && i < byte0) 
                s2 = s4.substring(0, i + 1); 
            if(i != -1 && i < byte0 && entitys.containsKey(s2)) 
            { 
                String s5 = (String)entitys.get(s2); 
                s1 = s1 + s5 + s4.substring(i + 1, s4.length()); 
            } 
            else 
            { 
                s1 = s1 + s4; 
            } 
        } 
 
        return s1; 
    } 
 
    String readURL(URL url) 
        throws Exception 
    { 
        DataInputStream datainputstream = null; 
        String s = ""; 
        String s1 = ""; 
        datainputstream = new DataInputStream(new BufferedInputStream(url.openStream())); 
        labelMsg(readingtext + url.toString()); 
        do 
        { 
            String s2 = datainputstream.readLine(); 
            if(s2 != null) 
            { 
                s = s + s2 + "\n"; 
            } 
            else 
            { 
                datainputstream.close(); 
                return s; 
            } 
        } 
        while(true); 
    } 
 
    String skipspace(String s) 
    { 
        int i = 0; 
        StringBuffer stringbuffer = new StringBuffer(); 
        for(; i < s.length(); i++) 
            if(s.charAt(i) != ' ') 
                stringbuffer.append(s.charAt(i)); 
 
        return stringbuffer.toString(); 
    } 
 
    public boolean action(Event event, Object obj) 
    { 
        if(event.target == checkbox1) 
        { 
            checkbox2.setState(false); 
            checkbox3.setState(false); 
            criteria = "or"; 
            return true; 
        } 
        if(event.target == checkbox2) 
        { 
            checkbox1.setState(false); 
            checkbox3.setState(false); 
            criteria = "and"; 
            return true; 
        } 
        if(event.target == checkbox3) 
        { 
            checkbox1.setState(false); 
            checkbox2.setState(false); 
            criteria = "phrases"; 
            return true; 
        } 
        if(event.target == button1) 
        { 
            button1_actionPerformed(); 
            return true; 
        } 
        if(event.target == list1) 
        { 
            list1_actionPerformed(); 
            return true; 
        } 
        else 
        { 
            return super.action(event, obj); 
        } 
    } 
 
    void resetAll() 
    { 
        hits = 0; 
        list1.clear(); 
        allUrls.removeAllElements(); 
        urls.removeAllElements(); 
        paired.clear(); 
        button1.setLabel(buttontext2); 
    } 
 
    void button1_actionPerformed() 
    { 
        if(button1.getLabel().equalsIgnoreCase(buttontext1)) 
        { 
            if(skipspace(textField1.getText()).equals("")) 
            { 
                return; 
            } 
            else 
            { 
                resetAll(); 
                startThread(); 
                return; 
            } 
        } 
        else 
        { 
            stopThread(); 
            return; 
        } 
    } 
 
    void list1_actionPerformed() 
    { 
        try 
        { 
            getAppletContext().showDocument(new URL((String)urls.elementAt(list1.getSelectedIndex())), targetName); 
            return; 
        } 
        catch(Exception _ex) 
        { 
            return; 
        } 
    } 
 
    private final String licensedto = "TRIAL VERSION"; 
    private final String licenstype = "10 DAY TRIAL"; 
    private final String licensnumber = "980625-TRIAL"; 
    private final String nagscreen = " - [10 day Trial]"; 
    private final String filter = "_XSWQ123sde"; 
    private final String def_firstpage = "index.html"; 
    private final String def_targetname = "_top"; 
    private final String def_maxhits = "30"; 
    private final String def_labelfg = "FFFFFF"; 
    private final String def_labelbg = "000080"; 
    private final String def_appletbg = "008080"; 
    private final String def_textfieldbg = "00A880"; 
    private final String def_textfieldfg = "000000"; 
    private final String def_checkboxbg = "008080"; 
    private final String def_checkboxfg = "000000"; 
    private final String def_buttonbg = "CCCCCC"; 
    private final String def_buttonfg = "0000FF"; 
    private final String def_listbg = "CCCCCC"; 
    private final String def_listfg = "0000FF"; 
    private final String def_nofollow = "false"; 
    private final String def_linksonly = "false"; 
    private final String def_forwardonly = "false"; 
    private final String def_truncate = "50"; 
    private final String def_labelfont = "Dialog"; 
    private final String def_appletfont = "Dialog"; 
    private final String def_labelfontsize = "11"; 
    private final String def_appletfontsize = "10"; 
    private final String def_startcriteria = "or"; 
    private final String def_checkboxtext1 = "Criteria "; 
    private final String def_checkboxtext2 = "Or"; 
    private final String def_checkboxtext3 = "And"; 
    private final String def_checkboxtext4 = "Phrases"; 
    private final String def_buttontext1 = "Search"; 
    private final String def_buttontext2 = "Stop"; 
    private final String def_completedtext = "Search completed, double click on a link"; 
    private final String def_notfoundtext = "No hits found"; 
    private final String def_parsingtext = "Parsing links: "; 
    private final String def_readingtext = "Reading file: "; 
    private final String def_searchingtext = "Searching in: "; 
    private final String def_labeltext = " Site Search Applet"; 
    private final String def_labelx = "0"; 
    private final String def_labely = "0"; 
    private final String def_labelwidth = "360"; 
    private final String def_labelheight = "24"; 
    private final String def_chbox1x = "6"; 
    private final String def_chbox1y = "30"; 
    private final String def_chbox1width = "40"; 
    private final String def_chbox1height = "11"; 
    private final String def_chbox2x = "55"; 
    private final String def_chbox2y = "30"; 
    private final String def_chbox2width = "54"; 
    private final String def_chbox2height = "11"; 
    private final String def_chbox3x = "110"; 
    private final String def_chbox3y = "30"; 
    private final String def_chbox3width = "56"; 
    private final String def_chbox3height = "11"; 
    private final String def_chbox4x = "168"; 
    private final String def_chbox4y = "30"; 
    private final String def_chbox4width = "65"; 
    private final String def_chbox4height = "11"; 
    private final String def_txtfieldx = "6"; 
    private final String def_txtfieldy = "50"; 
    private final String def_txtfieldwidth = "251"; 
    private final String def_txtfieldheight = "28"; 
    private final String def_buttonx = "265"; 
    private final String def_buttony = "52"; 
    private final String def_buttonwidth = "48"; 
    private final String def_buttonheight = "25"; 
    private final String def_listx = "6"; 
    private final String def_listy = "84"; 
    private final String def_listwidth = "307"; 
    private final String def_listheight = "77"; 
    private final String htmlEntitys[] = { 
        " ", "nbsp;", "", "\302", "Acirc;", "#194;", "\303", "Atilde;", "#195;", "\304",  
        "Auml;", "#196;", "\305", "Aring;", "#197;", "\310", "Egrave;", "#200;", "\311", "Eacute;",  
        "#201;", "\312", "Ecirc;", "#202;", "\313", "Euml;", "#203;", "\314", "Igrave;", "#204;",  
        "\315", "Iacute;", "#205;", "\316", "Icirc;", "#206;", "\317", "Iuml;", "#207;", "\322",  
        "Ograve;", "#210;", "\323", "Oacute;", "#211;", "\324", "Ocirc;", "#212;", "\326", "Ouml;",  
        "#214;", "\330", "Oslash;", "#216;", "\331", "Ugrave;", "#217;", "\332", "Uacute;", "#218;",  
        "\333", "Ucirc;", "#219;", "\334", "Uuml;", "#220;", "\335", "Yacute;", "#221;", "\340",  
        "agrave;", "#224;", "\341", "aacute;", "#225;", "\342", "acirc;", "#226;", "\343", "atilde;",  
        "#227;", "\344", "auml;", "#228;", "\345", "aring;", "#229;", "\350", "egrave;", "#232;",  
        "\351", "eacute;", "#233;", "\352", "ecirc;", "#234;", "\353", "euml;", "#235;", "\354",  
        "igrave;", "#236;", "\355", "iacute;", "#237;", "\356", "icirc;", "#238;", "\357", "iuml;",  
        "#239;", "\362", "ograve;", "#242;", "\363", "oacute;", "#243;", "\364", "ocirc;", "#244;",  
        "\365", "otilde;", "#245;", "\366", "ouml;", "#246;", "\370", "oslash;", "#248;", "\371",  
        "ugrave;", "#249;", "\372", "uacute;", "#250;", "\373", "ucirc;", "#219;", "\374", "uuml;",  
        "#252;", "\375", "yacute;", "#253;", "\377", "yuml;", "#255;" 
    }; 
    int hits; 
    int maxhits; 
    int labelfg; 
    int labelbg; 
    int appletbg; 
    int labelfontsize; 
    int textfieldbg; 
    int checkboxbg; 
    int appletfontsize; 
    int checkboxfg; 
    int buttonbg; 
    int buttonfg; 
    int listbg; 
    int listfg; 
    int textfieldfg; 
    int truncate; 
    int labelx; 
    int labely; 
    int labelwidth; 
    int labelheight; 
    int chbox1x; 
    int chbox1y; 
    int chbox1width; 
    int chbox1height; 
    int chbox2x; 
    int chbox2y; 
    int chbox2width; 
    int chbox2height; 
    int chbox3x; 
    int chbox3y; 
    int chbox3width; 
    int chbox3height; 
    int chbox4x; 
    int chbox4y; 
    int chbox4width; 
    int chbox4height; 
    int txtfieldx; 
    int txtfieldy; 
    int txtfieldwidth; 
    int txtfieldheight; 
    int buttonx; 
    int buttony; 
    int buttonwidth; 
    int buttonheight; 
    int listx; 
    int listy; 
    int listwidth; 
    int listheight; 
    String indexpage; 
    String targetName; 
    String labeltext; 
    String checkboxtext1; 
    String checkboxtext2; 
    String checkboxtext3; 
    String checkboxtext4; 
    String readingtext; 
    String buttontext1; 
    String buttontext2; 
    String completedtext; 
    String labelfont; 
    String parsingtext; 
    String searchingtext; 
    String appletfont; 
    String notfoundtext; 
    String criteria; 
    String baseurl; 
    boolean nofollow; 
    boolean linksonly; 
    boolean forwardonly; 
    URL firsturl; 
    Thread th; 
    Vector allUrls; 
    Vector urls; 
    Hashtable paired; 
    Hashtable entitys; 
    Label label1; 
    Label label2; 
    Checkbox checkbox1; 
    Checkbox checkbox2; 
    Checkbox checkbox3; 
    TextField textField1; 
    Button button1; 
    List list1; 
    Panel p; 
}