(Image image)
| 315 | } |
| 316 | |
| 317 | private void waitForImage(Image image) { |
| 318 | if (comp==null) { |
| 319 | comp = IJ.getInstance(); |
| 320 | if (comp==null) |
| 321 | comp = new Canvas(); |
| 322 | } |
| 323 | imageLoaded = false; |
| 324 | if (!comp.prepareImage(image, this)) { |
| 325 | double progress; |
| 326 | waitStart = System.currentTimeMillis(); |
| 327 | while (!imageLoaded && !errorLoadingImage) { |
| 328 | IJ.wait(30); |
| 329 | if (imageUpdateW>1) { |
| 330 | progress = (double)imageUpdateY/imageUpdateW; |
| 331 | if (!(progress<1.0)) { |
| 332 | progress = 1.0 - (progress-1.0); |
| 333 | if (progress<0.0) progress = 0.9; |
| 334 | } |
| 335 | showProgress(progress); |
| 336 | } |
| 337 | } |
| 338 | showProgress(1.0); |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | long waitStart; |
| 343 | private void showProgress(double percent) { |
no test coverage detected