Changeset 3444 for trunk/gsdl3


Ignore:
Timestamp:
2002-10-04T13:46:20+12:00 (22 years ago)
Author:
kjdon
Message:

tried to get the applet working on Mozilla, Netscape, and IE. It works fine on all apart from the buttons. All buttons work in Netscape. Search works in IE, but not Mozilla. Previous and Next dont work in IE or Mozilla.
Had to compile with 1.3 instead of 1.4. Have also removed all the deprecated method calls.
phindcgi variable now prepends the library variable (assumes will always use it through greenstone)

Location:
trunk/gsdl3/src/java/org/greenstone/applet/phind
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/applet/phind/Makefile

    r3391 r3444  
    1414
    1515#name/location of java compiler
    16 JAVAC=/usr/local/share/j2sdk1.4.0/bin/javac
    17 JAVAH=/usr/local/share/j2sdk1.4.0/bin/javah
    18 JAVA=/usr/local/share/j2sdk1.4.0/bin/java
    19 JAVADOC=/usr/local/share/j2sdk1.4.0/bin/javadoc
     16#JAVAC=/usr/local/share/j2sdk1.4.0/bin/javac
     17#JAVAH=/usr/local/share/j2sdk1.4.0/bin/javah
     18#JAVA=/usr/local/share/j2sdk1.4.0/bin/java
     19#JAVADOC=/usr/local/share/j2sdk1.4.0/bin/javadoc
    2020
    21 #JAVACOPTIONS= -deprecation -g -O
    22 JAVACOPTIONS=  -g -O
     21JAVAC=/usr/local/share/jdk1.3.1/bin/javac
     22JAVACOPTIONS= -deprecation -g -O
     23#JAVACOPTIONS=  -g -O
    2324
    24 JAVACLASSPATH=$(JAVACLASSDIR):$(CLASSPATH)
     25JAVACLASSPATH=/usr/local/share/jdk1.3.1/bin:$(JAVACLASSDIR):$(CLASSPATH)
    2526
    2627all: compile
  • trunk/gsdl3/src/java/org/greenstone/applet/phind/Phind.java

    r3391 r3444  
    7777import java.awt.Component;
    7878import java.awt.Dimension;
    79 import java.awt.Event;
     79import java.awt.event.ActionEvent;
    8080import java.awt.FlowLayout;
    8181import java.awt.Font;
     
    8585import java.awt.Panel;
    8686import java.awt.TextField;
    87 
     87import java.awt.event.ActionListener;
    8888import java.net.URL;
    8989import java.io.DataInputStream;
     
    9999import org.w3c.dom.Element;
    100100import org.w3c.dom.Document;
    101 import org.greenstone.gsdl3.util.*;
    102 import javax.xml.parsers.*;
     101//import org.greenstone.gsdl3.util.*;
     102//import javax.xml.parsers.*;
    103103import org.xml.sax.InputSource;
     104import org.apache.xerces.parsers.DOMParser;
    104105
    105106//import org.nzdl.gsdl.Phind.URLUTF8Encoder;
    106107
    107 public class Phind extends java.applet.Applet {
     108public class Phind extends java.applet.Applet
     109    implements ActionListener {
    108110   
    109111    // What is the collection called?
     
    264266
    265267    // The user performs an action in the interface
    266     public boolean action(Event evt, Object arg) {
     268    /*   public boolean action(Event evt, Object arg) {
    267269
    268270    if (evt.target == searchButton) {
     271        System.out.println("evt.target==searchButton");
    269272        searchForWord(getSearchTerm());
    270273    } else if (evt.target == wordField) {
     274        System.out.println("evt.target==wordField");
    271275        searchForWord(getSearchTerm());
    272276    } else if (evt.target == prevButton) {
     
    281285    }
    282286
     287    */
     288
     289    public void actionPerformed(ActionEvent evt) {
     290   
     291    Component target = (Component)evt.getSource();
     292    if (target==searchButton) {
     293        System.out.println("search button pressed");
     294        searchForWord(getSearchTerm());
     295    } else if (target == wordField)  {
     296        System.out.println("word field entered");
     297        searchForWord(getSearchTerm());
     298    } else if (target == prevButton) {
     299        System.out.println("prev button pressed");
     300        shiftPrevious();
     301    }else if (target == nextButton) {
     302        System.out.println("prev button pressed");
     303        shiftNext();
     304    } else {
     305        System.out.println("unknown action: " + evt.toString() );
     306       
     307    }
     308    }
    283309
    284310    // Search for a word
     
    289315    void searchForWord(String searchWord) {
    290316
     317    System.err.println("in searchforword!!");
    291318    if (mode == idleMode) {
    292319       
     
    311338        // display the result
    312339        result.display = firstDisplay.display(result);
    313         result.resize(result.display.size());
     340        result.setSize(result.display.getSize());
    314341        result.paintAll(result.getGraphics());
    315342        }
     
    347374        if (queryMode <= 2) {
    348375        result.display = lastDisplay.display(result);
    349         result.resize(result.display.size());
     376        result.setSize(result.display.getSize());
    350377        result.paintAll(result.getGraphics());
    351378        }
     
    481508        }
    482509        */
    483         DocumentBuilderFactory doc_build_fact = DocumentBuilderFactory.newInstance();
     510        /*  DocumentBuilderFactory doc_build_fact = DocumentBuilderFactory.newInstance();
    484511        DocumentBuilder doc_builder = doc_build_fact.newDocumentBuilder();
    485         Document data_doc = doc_builder.parse(new InputSource(in));
     512        Document data_doc = doc_builder.parse(new InputSource(in));*/
     513       
     514        DOMParser parser = new DOMParser();
     515        parser.parse(new InputSource(in));
     516        Document data_doc = parser.getDocument();
    486517        Element data_elem = data_doc.getDocumentElement();
    487518       
     
    573604    System.out.println("Phind classifier: " + classifier);
    574605
    575     // Where is the phind CGI script
    576     phindcgi_address = parameterValue("phindcgi");
    577     phindcgi_address = tidy_URL(phindcgi_address, true);
    578     System.out.println("Phind phindcgi: " + phindcgi_address);
    579 
    580606    // Where is the Greenstone library
    581607    library_address = parameterValue("library");
    582608    library_address = tidy_URL(library_address, true);
    583609    System.out.println("Phind library: " + library_address);
     610
     611    // Where is the phind CGI script
     612    // we assume this is relative to the greenstone library
     613    phindcgi_address = parameterValue("library")+parameterValue("phindcgi");
     614    phindcgi_address = tidy_URL(phindcgi_address, true);
     615    System.out.println("Phind phindcgi: " + phindcgi_address);
     616
    584617   
    585618    // Is there a default search term?
     
    786819        searchButton = new Button("Search");
    787820        searchButton.setFont(boldFont);
     821        //searchButton.setEnabled(true);
     822        searchButton.addActionListener(this);
    788823        p1.add(searchButton);
    789824       
     
    794829        wordField = new TextField(12);
    795830        wordField.setFont(boldFont);
     831        wordField.addActionListener(this);
    796832        p1.add(wordField);
    797833       
     
    801837        prevButton = new Button("Previous");
    802838        prevButton.setFont(boldFont);
    803         prevButton.disable();
     839        prevButton.addActionListener(this);
     840        prevButton.setEnabled(false);
    804841       
    805842        p1.add(prevButton);
     
    807844        nextButton = new Button("  Next  ");
    808845        nextButton.setFont(boldFont);
    809         nextButton.disable();
     846        nextButton.addActionListener(this);
     847        nextButton.setEnabled(false);
    810848        p1.add(nextButton);
    811849       
     
    818856    void enableSearchButton() {
    819857    if (showControlPanel) {
    820         searchButton.enable();
     858        searchButton.setEnabled(true);
    821859    }
    822860    }
    823861    void disableSearchButton() {
    824862    if (showControlPanel) {
    825         searchButton.disable();
     863        searchButton.setEnabled(false);
    826864    }
    827865    }
     
    847885        if (c.getClass().getName().endsWith("ResultBox")) {
    848886        if (((ResultBox) c).prevBoxExists()) {
    849             prevButton.enable();
     887            prevButton.setEnabled(true);
    850888        } else {
    851             prevButton.disable();
     889            prevButton.setEnabled(false);
    852890        }
    853891        }
     
    856894        if (c.getClass().getName().endsWith("ResultBox")) {
    857895        if (((ResultBox) c).nextBoxExists()) {
    858             nextButton.enable();
     896            nextButton.setEnabled(true);
    859897        } else {
    860             nextButton.disable();
     898            nextButton.setEnabled(false);
    861899        }
    862900        }
     
    882920        for (int i = 1 ; ((i <= depth) && (b != null)); i++) {
    883921            lastDisplay.display(b);
    884             b.resize(b.display.size());
     922            b.setSize(b.display.getSize());
    885923            b.paintAll(b.getGraphics());
    886924            b = b.next;
     
    913951        for (int i = 1 ; ((i <= depth) && (b != null)); i++) {
    914952            lastDisplay.display(b);
    915             b.resize(b.display.size());
     953            b.setSize(b.display.getSize());
    916954            b.paintAll(b.getGraphics());
    917955            b = b.next;
  • trunk/gsdl3/src/java/org/greenstone/applet/phind/PhindTitle.java

    r3391 r3444  
    5757
    5858    public void paint(Graphics g) {
    59     Dimension canvasSize = size();
     59    Dimension canvasSize = getSize();
    6060
    6161    Color fore = phind.panel_fg;
  • trunk/gsdl3/src/java/org/greenstone/applet/phind/ResultBox.java

    r3391 r3444  
    4545
    4646import java.awt.Label;
    47 import java.awt.Event;
    48 
     47import java.awt.AWTEvent;
     48import java.awt.event.AdjustmentListener;
     49import java.awt.event.AdjustmentEvent;
    4950import java.net.*;
    5051import java.applet.*;
     
    5758import org.greenstone.gsdl3.util.*;
    5859
    59 public class ResultBox extends Panel {
     60public class ResultBox extends Panel
     61    implements AdjustmentListener {
    6062   
    6163    // Objects at a "higher" level than this one
     
    137139    s = new Scrollbar(Scrollbar.VERTICAL);
    138140    disableScrollbar();
     141    s.addAdjustmentListener(this);
    139142    add("East", s);
    140143
     
    183186    if (s.isEnabled()) {
    184187        s.setValues(0, 1, 0, 1);
    185         s.setLineIncrement(1);
    186         s.setPageIncrement(1);
    187         s.disable();
     188        s.setUnitIncrement(1);
     189        s.setBlockIncrement(1);
     190        s.setEnabled(false);
    188191    }
    189192    }
     
    207210    }
    208211
    209     public boolean handleEvent(Event event) {
     212    /*   public void processEvent(AWTEvent event) {
    210213    //    System.out.println("event: " + event.toString());
    211214    if ( (event.target == s) &&
     
    216219           (event.id == Event.SCROLL_PAGE_UP) ) ) {
    217220        c.repaint();
    218         return true;
     221       
    219222    } else {
    220         return super.handleEvent(event);
    221     }
    222     }   
     223        super.processEvent(event);
     224    }
     225    } */ 
     226
     227    public void adjustmentValueChanged(AdjustmentEvent evt) {
     228    c.repaint();
     229    }
    223230
    224231    void parseXML(Element data) {
    225232
    226     System.out.println("phinddata:"+data.toString());
     233    //System.out.println("phinddata:"+data.toString());
    227234
    228235    //String id="", phrase="";
     
    271278        e = (Element)e.getNextSibling();
    272279    }
    273 
     280    // finished parsing, update the getMoreDocs markers
     281    c.updateMarkers();
    274282    }
    275283
  • trunk/gsdl3/src/java/org/greenstone/applet/phind/ResultCanvas.java

    r3391 r3444  
    5252import java.util.Vector;
    5353import java.awt.Image;
    54 import java.awt.Event;
    55 
     54//import java.awt.Event;
     55import java.awt.event.MouseListener;
     56import java.awt.event.MouseEvent;
     57import java.awt.event.MouseAdapter;
    5658import java.net.URL;
    5759import java.applet.Applet;
     
    5961
    6062public class ResultCanvas extends Canvas {
     63   
    6164
    6265    // Other objects associated with this
     
    100103        backgroundImage = p.phind.backgroundImage;
    101104    }
     105
     106    // add a mouse listener for the mouse clicks. we only want to override
     107    // one method, so we use the adaptor class
     108    addMouseListener(new MouseAdapter() {
     109        public void mouseClicked(MouseEvent evt) {
     110            ResultCanvas.this.mouseClicked(evt);
     111        }
     112        });
     113   
    102114
    103115    }
     
    142154    void updateMorePhrasesMarker() {
    143155   
    144     // System.out.println("updateMorePhrasesMarker() ");
    145 
     156    System.out.println("updateMorePhrasesMarker() ");
     157     System.out.println("expansions retrieved = "+parent.expansionsRetrieved +" num expansions = "+parent.numberOfExpansions);
    146158    // look for a marker
    147159    boolean found = false;
     
    250262   
    251263    // Note: the size() method is deprecated, but getSize fails in NetScape 4
    252     // Dimension canvasSize = getSize();
    253     Dimension canvasSize = size();
    254 
     264    Dimension canvasSize = getSize();
     265   
    255266    g.setFont(areaPlain);
    256267    int space = g.getFontMetrics().stringWidth(" ");
     
    454465        // setBlockIncrement(), but the latter doesn't work on some
    455466        // browsers.  Damn.
    456         // scrollbar.setBlockIncrement(visible - 1);
    457         scrollbar.setPageIncrement(visible - 1);
     467        scrollbar.setBlockIncrement(visible - 1);
     468        //scrollbar.setPageIncrement(visible - 1);
    458469        // Deprecated - more nonsense: enable() has been replaced by
    459470        // setEnabled(true), but this doesn't work on some browsers.
    460         //scrollbar.setEnabled(true);
    461         scrollbar.enable();
     471        scrollbar.setEnabled(true);
     472        //scrollbar.enable();
    462473    }
    463474
     
    469480    }
    470481    }
     482
     483    // handle mouse clicks in the new way. just copy gordons thing for now
     484    public void mouseClicked(MouseEvent event) {
     485
     486    // ignore actions that occur within 1 second of the last
     487    Date now = new Date();
     488    // System.out.println("Click time: " + now.toString());
     489    if (now.getTime() < (phind.lastQueryEndTime.getTime() + 1000)) {
     490        System.out.println("Ignoring click - too close to last query.");
     491        return;
     492    }
     493
     494    // which Item is selected?
     495    int rowSelected = event.getY() / lineSpacing;
     496    itemSelected = rowSelected + firstItemDisplayed;
     497    ResultItem item = (ResultItem) items.elementAt(itemSelected);
     498
     499    if (itemSelected <= numberOfItems) {
     500       
     501        //User clicks on a phrase
     502        if (item.isPhrase()) {
     503        itemSelected = itemSelected;
     504        update(getGraphics());
     505        parent.lookupPhrase(item.hiddenText(), item.toString(), 2);
     506       
     507        // If meta key is held down, send query to search engine
     508        /*if (event.metaDown() && !phind.library_address.equals("")) {
     509            String address = phind.library_address 
     510            + "a=q&sa=text&c=" + phind.collection
     511            + "&q=%22" + item.toString().replace(' ', '+') + "%22";
     512            phind.displayWebPage(address, phind.searchWindowName);
     513            }*/
     514        }
     515       
     516        // Click on a thesaurus link
     517        else if (item.isLink()) {
     518        itemSelected = itemSelected;
     519        update(getGraphics());
     520        parent.lookupPhrase(item.hiddenText(), item.toString(), 2);
     521       
     522        // If meta key is held down, send query to search engine
     523        /*if (event.metaDown() && !phind.library_address.equals("")) {
     524            String address = phind.library_address 
     525            + "a=q&sa=text&c=" + phind.collection
     526            + "&q=%22" + item.toString().replace(' ', '+') + "%22";
     527            phind.displayWebPage(address, phind.searchWindowName);
     528            }*/
     529        }
     530       
     531        // The user clicks on a URL; display it.
     532        else if (item.isDocument()) {
     533        itemSelected = itemSelected;
     534        update(getGraphics());
     535       
     536        String address = phind.library_address
     537            + "a=r&c=" + phind.collection
     538            + "&r=" + item.hiddenText()
     539            + "&q=" + parent.searchPhrase.replace(' ', '+');
     540       
     541        phind.displayWebPage(address, phind.documentWindowName);
     542        }
     543       
     544        // When the user clicks on "get more phrases" or other marker,
     545        // we have to send a new query to the host
     546        else if (item.isMorePhrases()){
     547        parent.lookupPhrase(parent.searchKey, parent.searchPhrase, 3);
     548        } else if (item.isMoreDocuments()){
     549        parent.lookupPhrase(parent.searchKey, parent.searchPhrase, 4);
     550        } else if (item.isMoreLinks()){
     551        parent.lookupPhrase(parent.searchKey, parent.searchPhrase, 5);
     552       
     553       
     554        }
     555        repaint();
     556    }
     557    }
     558   
    471559
    472560    // User interaction
     
    475563    // is handles in this method.  Note we ignore clicks that follow
    476564    // another too closely to avoid problems with slow connections.
    477     public boolean handleEvent(Event event) {
     565    /*  public boolean processEvent(Event event) {
    478566   
    479567    if (event.id == Event.MOUSE_UP) {
     
    552640    }
    553641    return true;
    554     }    
     642    } */   
    555643 
    556644}
  • trunk/gsdl3/src/java/org/greenstone/applet/phind/ResultTitle.java

    r3391 r3444  
    4747
    4848public class ResultTitle extends Canvas {
     49   
     50    // Other objects associated with this
     51    Phind phind;
     52    ResultBox parent;
     53    ResultCanvas canvas;
    4954
    50   // Other objects associated with this
    51   Phind phind;
    52   ResultBox parent;
    53   ResultCanvas canvas;
    54 
    55   // fonts and font spacings to use
    56   Font plain, bold;
    57   Graphics g;
    58 
    59   // Create a ResultTitle from the ResultBox which is its parent.
    60   ResultTitle(ResultBox p) {
    61 
    62     parent = p;
    63     phind = p.phind;
    64     canvas = p.c;
    65     g = getGraphics();
    66 
    67     plain = phind.plainFont;
    68     bold  = phind.boldFont;
     55    // fonts and font spacings to use
     56    Font plain, bold;
     57    Graphics g;
    6958   
    70     // Note: the size() and resize() methods are deprecated, but the newer
    71     // getSize() and setSize() methods fail in NetScape 4
    72     //Dimension d = getSize();
    73     Dimension d = size();
    74     d.height = phind.fontSize + 10;
    75     //setSize(d);
    76     resize(d);
     59    // Create a ResultTitle from the ResultBox which is its parent.
     60    ResultTitle(ResultBox p) {
     61   
     62    parent = p;
     63    phind = p.phind;
     64    canvas = p.c;
     65    g = getGraphics();
     66   
     67    plain = phind.plainFont;
     68    bold  = phind.boldFont;
     69   
     70    // Note: the size() and resize() methods are deprecated, but the newer
     71    // getSize() and setSize() methods fail in NetScape 4
     72    Dimension d = getSize();
     73    d.height = phind.fontSize + 10;
     74    setSize(d);
     75   
     76   
     77    }
    7778   
    78   }
    79 
    80   public void update(Graphics g) {
    81     paint(g);
    82   }
    83 
    84   public void paint(Graphics g) {
    85 
    86     // calculate the canvas size, margins, and spacing
    87     Dimension canvasSize = size();
     79    public void update(Graphics g) {
     80    paint(g);
     81    }
    8882   
    89     g.setFont(plain);
    90     int margin = g.getFontMetrics().stringWidth(" 8888 ");
    91     int y = phind.fontSize + 5;
    92 
    93     int rightMargin = canvas.size().width;
    94     int secondColumn = rightMargin - margin;
    95     int firstColumn = secondColumn - margin;
    96 
    97     g.setColor(Color.white);
    98     g.fillRect(0, 0, canvasSize.width, canvasSize.height);
    99     g.setColor(Color.black);
    100 
    101 
    102     // What is the phrase we are searching for?
    103     String phrase = parent.searchPhrase.replace('+', ' ');
    104  
    105     // Construct the description phrase
    106     String links = "";
    107     if (parent.numberOfThesaurusLinks <= 0) {
    108     links = "";
    109     } else if (parent.numberOfThesaurusLinks == 1) {
    110     links = "1 link";
    111     } else if (parent.thesaurusLinksRetrieved == parent.numberOfThesaurusLinks) {
    112     links = parent.numberOfThesaurusLinks + " links";
    113     } else {
    114     links = parent.thesaurusLinksRetrieved + " of "
    115         + parent.numberOfThesaurusLinks + " links";
     83    public void paint(Graphics g) {
     84   
     85    // calculate the canvas size, margins, and spacing
     86    Dimension canvasSize = getSize();
     87   
     88    g.setFont(plain);
     89    int margin = g.getFontMetrics().stringWidth(" 8888 ");
     90    int y = phind.fontSize + 5;
     91   
     92    int rightMargin = canvas.getSize().width;
     93    int secondColumn = rightMargin - margin;
     94    int firstColumn = secondColumn - margin;
     95   
     96    g.setColor(Color.white);
     97    g.fillRect(0, 0, canvasSize.width, canvasSize.height);
     98    g.setColor(Color.black);
     99   
     100   
     101    // What is the phrase we are searching for?
     102    String phrase = parent.searchPhrase.replace('+', ' ');
     103   
     104    // Construct the description phrase
     105    String links = "";
     106    if (parent.numberOfThesaurusLinks <= 0) {
     107        links = "";
     108    } else if (parent.numberOfThesaurusLinks == 1) {
     109        links = "1 link";
     110    } else if (parent.thesaurusLinksRetrieved == parent.numberOfThesaurusLinks) {
     111        links = parent.numberOfThesaurusLinks + " links";
     112    } else {
     113        links = parent.thesaurusLinksRetrieved + " of "
     114        + parent.numberOfThesaurusLinks + " links";
     115    }
     116   
     117    String expansions = "";
     118    if (parent.numberOfExpansions <= 0) {
     119        expansions = "no phrases";
     120    } else if (parent.numberOfExpansions == 1) {
     121        expansions = "1 phrase";
     122    } else if (parent.expansionsRetrieved == parent.numberOfExpansions) {
     123        expansions = parent.numberOfExpansions + " phrases";
     124    } else {
     125        expansions = parent.expansionsRetrieved + " of "
     126        + parent.numberOfExpansions + " phrases";
     127    }
     128   
     129    String documents = "";
     130    if (parent.numberOfDocuments <= 0) {
     131        documents = "no documents";
     132    } else if (parent.documentsRetrieved == 1) {
     133        documents = "1 document";
     134    } else if (parent.documentsRetrieved == parent.numberOfDocuments) {
     135        documents = parent.numberOfDocuments + " documents";
     136    } else {
     137        documents = parent.documentsRetrieved + " of "
     138        + parent.numberOfDocuments + " documents";
     139    }
     140   
     141    String status = "(";
     142    if (parent.numberOfThesaurusLinks > 0) {
     143        status = status + links + ", ";
     144    }
     145    status = status + expansions + ", " + documents + ")";
     146   
     147   
     148    // Draw the text
     149    g.setFont(bold);
     150    g.drawString(phrase, 0, y);
     151    int tab = g.getFontMetrics().stringWidth(phrase + "  ");
     152   
     153    g.setFont(plain);
     154    g.drawString(status, tab, y);
     155    tab = tab + g.getFontMetrics().stringWidth(status);
     156   
     157    if (tab < firstColumn) {
     158        g.drawString("docs", firstColumn, y);
     159        g.drawString("freq", secondColumn, y);
     160    }
    116161    }
    117 
    118     String expansions = "";
    119     if (parent.numberOfExpansions <= 0) {
    120     expansions = "no phrases";
    121     } else if (parent.numberOfExpansions == 1) {
    122     expansions = "1 phrase";
    123     } else if (parent.expansionsRetrieved == parent.numberOfExpansions) {
    124     expansions = parent.numberOfExpansions + " phrases";
    125     } else {
    126     expansions = parent.expansionsRetrieved + " of "
    127         + parent.numberOfExpansions + " phrases";
    128     }
    129 
    130     String documents = "";
    131     if (parent.numberOfDocuments <= 0) {
    132     documents = "no documents";
    133     } else if (parent.documentsRetrieved == 1) {
    134     documents = "1 document";
    135     } else if (parent.documentsRetrieved == parent.numberOfDocuments) {
    136     documents = parent.numberOfDocuments + " documents";
    137     } else {
    138     documents = parent.documentsRetrieved + " of "
    139         + parent.numberOfDocuments + " documents";
    140     }
    141 
    142     String status = "(";
    143     if (parent.numberOfThesaurusLinks > 0) {
    144     status = status + links + ", ";
    145     }
    146     status = status + expansions + ", " + documents + ")";
    147 
    148 
    149     // Draw the text
    150     g.setFont(bold);
    151     g.drawString(phrase, 0, y);
    152     int tab = g.getFontMetrics().stringWidth(phrase + "  ");
    153 
    154     g.setFont(plain);
    155     g.drawString(status, tab, y);
    156     tab = tab + g.getFontMetrics().stringWidth(status);
    157    
    158     if (tab < firstColumn) {
    159       g.drawString("docs", firstColumn, y);
    160       g.drawString("freq", secondColumn, y);
    161     }
    162   }
    163162}
Note: See TracChangeset for help on using the changeset viewer.