Changeset 38813 for main/trunk/greenstone3/src/java
- Timestamp:
- 2024-03-02T20:04:36+13:00 (3 months ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone/applet/phind
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/applet/phind/JPhind.java
r38800 r38813 34 34 as an application too due to the inclusion of the main() method. 35 35 36 To run as an applet, ensure PhindPhraseBrowse.java refers to JPhind.class 37 (not the old Phind.class Applet), then run in commandline: 38 39 appletviewer "http://localhost:8383/greenstone3/gs2-library?a=a&rt=d&s=PhindApplet&c=tudor" 40 36 41 To run this applet as an application, for which purpose this class has a main() method, run as: 37 42 … … 338 343 339 344 // status bar that applet has, but we want one also if we run JPhind as application 340 if(!isRunAsApplet) { 345 // And in fact, when webswing runs our applet, we never get a status bar. So we 346 // create a custom status bar now even if we're running as an applet. 347 // When this applet is run through the appletviewer we might end up with 2 status bars. 348 //if(!isRunAsApplet) { 341 349 statusBar = new JLabel(); 342 350 this.add(statusBar, BorderLayout.SOUTH); 343 } 351 Dimension d = statusBar.getSize(); 352 d.height = fontSize + 10; 353 statusBar.setPreferredSize(d); 354 //} 344 355 345 356 // Create ResultDisplays and place into the interface … … 371 382 searchForWord(initialSearch); 372 383 } 384 373 385 } 374 386 … … 621 633 622 634 public void showStatus(String msg) { 623 if(!isRunAsApplet) { 624 this.statusBar.setText(msg); 625 } else { 635 // Either firefox doesn't provide a status bar window for applets any more or webswing 636 // doesn't provide a status window, so we don't see Applet.showStatus() output appear 637 // in webswing-phind and in fact don't even see any Applet statusBar in webswing. 638 // However, since we print useful and interesting information to the status bar, 639 // we'll now always show and print to our manually added statusBar now 640 // not only if(!isRunAsApplet) when we needed to manually create a statusBar. 641 this.statusBar.setText(msg); 642 if(isRunAsApplet) { 626 643 super.showStatus(msg); 627 644 } … … 636 653 } 637 654 } 638 639 /*640 public URL getDocumentBase(String url) {641 int index = url.indexOf("?"); // base URL is string before the query parameters642 if(index == -1) {643 return new URL(url);644 } else {645 return new URL(url.substring(index));646 }647 }*/648 655 649 656 // Tidy up URLs -
main/trunk/greenstone3/src/java/org/greenstone/applet/phind/Phind.java
r38794 r38813 37 37 38 38 /********************************************************************* 39 To test run this Applet, ensure PhindPhraseBrowse.java refers to this awt Applet Phind.class 40 (not the new JPhind.class JApplet), then run in commandline: 41 42 appletviewer "http://localhost:8383/greenstone3/gs2-library?a=a&rt=d&s=PhindApplet&c=tudo"r 39 43 40 44 To use the applet, you'll need to embed it in a web page like this:
Note:
See TracChangeset
for help on using the changeset viewer.