Changeset 38968
- Timestamp:
- 2024-05-01T17:29:55+12:00 (3 weeks ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone/applet/GsdlCollageApplet
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/applet/GsdlCollageApplet/CURL.java
r38935 r38968 674 674 } 675 675 catch (Exception e) { 676 System.err.println("**** URL: " + url); 677 System.err.println("**** url_str: " + url_str); 678 System.err.println("**** HEAD: " + head); 679 System.err.println("**** TAIL: " + tail); 676 680 e.printStackTrace(); 677 681 } -
main/trunk/greenstone3/src/java/org/greenstone/applet/GsdlCollageApplet/DisplayImages.java
r38937 r38968 368 368 public void paint(Graphics g) 369 369 { 370 370 if(isStopping()) { 371 return; 372 } 371 373 screen_graphic_.setColor(bgcolor_); 372 374 screen_graphic_.fillRect(0,0,app_x_dim_,app_y_dim_); … … 374 376 // get each image currently onscreen inturn 375 377 376 for (int i=0; i < inuse_.size() ; i++)378 for (int i=0; i < inuse_.size() && !isStopping(); i++) 377 379 { 378 380 … … 416 418 417 419 } 418 420 421 if(isStopping()) { 422 return; 423 } 419 424 420 425 finished_graphic_.drawImage(screen_buffer_,0,0,app_); … … 427 432 g.setColor(Color.white); 428 433 g.setFont(new Font("font",Font.PLAIN+Font.BOLD,30)); 429 g.drawString("Downloading" + dots[(dots_nums++)%dots.length],app_x_dim_/3-20,app_y_dim_/2-2); 434 435 if(app_.download_thread_.wasUnableToDownload()) { 436 //System.err.println("Display loop"); 437 g.drawString("Can't download.", app_x_dim_/5-20,app_y_dim_/2-20); 438 g.drawString("Stopping.", app_x_dim_/5-20,app_y_dim_/2+20); 439 // GsdlCollageApplet.start() will handle rest of termination of threads 440 } else { 441 g.drawString("Downloading" + dots[(dots_nums++)%dots.length],app_x_dim_/3-20,app_y_dim_/2-2); 442 } 430 443 } 431 444 } -
main/trunk/greenstone3/src/java/org/greenstone/applet/GsdlCollageApplet/DownloadUrls.java
r38930 r38968 47 47 */ 48 48 private boolean stop_downloading = false; 49 50 /** Set to true when unable to download perhaps because of no internet connection. */ 51 private boolean unable_to_download = false; 49 52 50 53 /** CHRIS - Holds the contents of the collection's assoc directory */ … … 601 604 602 605 else { 603 System.err.println("Unable able to download "+new_url); 606 System.err.println("Unable to download "+new_url); 607 unable_to_download = true; 604 608 } 605 609 … … 609 613 } 610 614 615 public boolean wasUnableToDownload() { return unable_to_download; } 616 611 617 612 618 /** Used in cases where the image maps to a url outside of it's original location. -
main/trunk/greenstone3/src/java/org/greenstone/applet/GsdlCollageApplet/GsdlCollageApplet.java
r38948 r38968 812 812 813 813 Thread curr_thread = Thread.currentThread(); 814 814 815 815 while (curr_thread == paint) { 816 817 repaint();816 817 repaint(); 818 818 819 819 Thread.sleep(2000); 820 if(download_thread_.wasUnableToDownload()) { 821 repaint(); 822 Thread.sleep(2000); 823 String msg = "@@@ GsdlCollageApplet is unable to download. (No internet?) Stopping."; 824 System.err.println(msg); 825 if(isWebswing) { 826 WebswingUtil.getWebswingApi().sendActionEvent("javaToWebswingJSConsoleLog", msg, null); 827 } 828 if(!isRunAsApplet) { 829 System.exit(-1); 830 } else { 831 stopRunning(); 832 return; 833 } 834 } 820 835 curr_thread = Thread.currentThread(); 821 836 }
Note:
See TracChangeset
for help on using the changeset viewer.