Changeset 1627 for trunk/gsdl/src/phind/client/Phind.java
- Timestamp:
- 2000-10-30T15:10:28+13:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/phind/client/Phind.java
r1626 r1627 55 55 words on the screen, and handles user input from the mouse. 56 56 6. ResultItem represents a single result object (a phrase or document). 57 58 7. PhindTitle is for drawing backdrops in empty Displays. (?) 57 7. PhindTitle is for drawing backdrops in ResultDisplays. 59 58 60 59 **********************************************************************/ … … 104 103 105 104 // Do we want a background image in the applet? 105 String backdrop_address; 106 106 public boolean showImage; 107 107 public Image backgroundImage; … … 109 109 // Holders for the downloaded data 110 110 Panel resultPanel; 111 PhindTitle title;112 111 ResultDisplay firstDisplay, lastDisplay; 113 112 … … 198 197 System.out.println("Phind library: " + library_address); 199 198 199 // Should we display a background image? 200 showImage = false; 201 try { 202 backdrop_address = new String(getParameter("backdrop")); 203 URL backdrop_url = new URL(backdrop_address); 204 backgroundImage = getImage(backdrop_url); 205 showImage = true; 206 System.out.println("Phind backdrop: " + backdrop_address); 207 } catch (Exception e) { 208 System.out.println("Phind backdrop not set"); 209 } 210 200 211 // Is there a search URL for this collection? 201 212 try { … … 238 249 System.out.println("Phind phrase block size: " + phraseBlockSize); 239 250 240 // Should we display a background image?241 showImage = false;242 try {243 if (getParameter("background").toLowerCase().equals("on")) {244 showImage = true;245 System.out.println("Phind background: on");246 }247 } catch (Exception e) {248 System.out.println("Phind background: off");249 }250 251 252 251 // How large should the font be? 253 252 try { … … 271 270 // The phind applet layout manager 272 271 setLayout(new BorderLayout()); 273 274 // the Phind title window275 if (showImage) backgroundImage = getImage(getCodeBase(), "sequitur.jpg");276 title = new PhindTitle(this, true);277 272 278 273 // initialise the user interface … … 495 490 throws IOException { 496 491 497 // Set up connections (streams)498 //connection = new Socket(server, Integer.parseInt(port));499 //OutputStream out = connection.getOutputStream();500 //InputStream in = connection.getInputStream();501 502 492 // Build the query 503 493 String query = phindcgi_address + "?x=1&c=" + collection; 504 494 505 495 if (keyKnown) { 506 496 query = query + "&n=" + word; 507 497 } else { 508 query = query + "&p=" + word; 509 } 510 511 // Specify the number of results to return and the first and last results. 498 query = query + "&p=" + word; 499 } 500 501 502 // Specify the set of results to return 503 int first_e = 0; 504 int last_e = 0; 505 int first_d = 0; 506 int last_d = 0; 507 508 // the initial query 512 509 if (queryMode <= 2) { 513 query = query + "&f=0&d=" + phraseBlockSize + "&g=0&e=" + phraseBlockSize; 514 } else if (queryMode == 3) { 515 // Add phrases to an existing result set. 516 query = query + "&f=0&d=" + phraseBlockSize + "&g=0&e=" + phraseBlockSize; 517 // query = (word + " " + queryMode + " " + phraseBlockSize + " " + area.nextPhraseBlock); 518 area.nextPhraseBlock++; 519 } else if (queryMode == 4) { 520 // Add documents to existing result set. 521 query = query + "&f=0&d=" + phraseBlockSize + "&g=0&e=" + phraseBlockSize; 522 // query = (word + " " + queryMode + " " + phraseBlockSize + " " + area.nextDocumentBlock); 523 area.nextDocumentBlock++; 524 } 525 510 last_e = phraseBlockSize; 511 last_d = phraseBlockSize; 512 } 513 514 // add phrases to an existing result set 515 else if (queryMode == 3) { 516 first_e = area.nextPhraseBlock * phraseBlockSize; 517 area.nextPhraseBlock++; 518 last_e = area.nextPhraseBlock * phraseBlockSize; 519 } 520 521 // add documents to existing result set 522 else if (queryMode == 4) { 523 first_d = area.nextDocumentBlock * phraseBlockSize; 524 area.nextDocumentBlock++; 525 last_d = area.nextDocumentBlock * phraseBlockSize; 526 } 527 528 query = query + "&f=" + first_d + "&d=" + last_d 529 + "&g=" + first_e + "&e=" + last_e; 526 530 527 531 // Send the query to the phindcgi program
Note:
See TracChangeset
for help on using the changeset viewer.