Changes between Version 2 and Version 3 of Ticket #15574, comment 14
- Timestamp:
- 2017-12-04T18:31:51+01:00 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #15574, comment 14
v2 v3 4 4 5 5 EDIT2: include proper checks in the event image dimensions cannot be read (because of file format or other condition), this ensures that the thread will not linger around waiting forever. if lots of such images are loaded and switched between these lingering threads may aggregate, so not waiting forever and properly let them finish is somewhat important. 6 7 EDIT3: add repaint call if reading width and height timed out and run() method returns early 6 8 {{{ 7 9 #!patch … … 57 59 } 58 60 } 59 @@ -243,19 +252,2 6@@61 @@ -243,19 +252,27 @@ 60 62 Image img = Toolkit.getDefaultToolkit().createImage(file.getPath()); 61 63 … … 80 82 + synchronized (ImageDisplay.this) { 81 83 + errorLoading = true; 84 + ImageDisplay.this.repaint(); 82 85 + return; 83 86 + } … … 91 94 } 92 95 } 93 @@ -279,24 +29 5,19 @@96 @@ -279,24 +296,19 @@ 94 97 Thread.sleep(5); 95 98 } catch (InterruptedException e) { … … 119 122 if (this.file != ImageDisplay.this.file) { 120 123 // The file has changed 121 @@ -566,10 +57 7,12 @@124 @@ -566,10 +578,12 @@ 122 125 public void mouseReleased(MouseEvent e) { 123 126 File file;


