(ImagePlus imp)
| 540 | } |
| 541 | |
| 542 | public void updateImage(ImagePlus imp) { |
| 543 | if (imp!=this.imp) |
| 544 | throw new IllegalArgumentException("imp!=this.imp"); |
| 545 | this.imp = imp; |
| 546 | ic.updateImage(imp); |
| 547 | setLocationAndSize(true); |
| 548 | if (this instanceof StackWindow) { |
| 549 | StackWindow sw = (StackWindow)this; |
| 550 | int stackSize = imp.getStackSize(); |
| 551 | int nScrollbars = sw.getNScrollbars(); |
| 552 | if (stackSize==1 && nScrollbars>0) |
| 553 | sw.removeScrollbars(); |
| 554 | else if (stackSize>1 && nScrollbars==0) |
| 555 | sw.addScrollbars(imp); |
| 556 | } |
| 557 | pack(); |
| 558 | repaint(); |
| 559 | maxBounds = getMaximumBounds(); |
| 560 | setMaximizedBounds(maxBounds); |
| 561 | setMaxBoundsTime = System.currentTimeMillis(); |
| 562 | } |
| 563 | |
| 564 | public ImageCanvas getCanvas() { |
| 565 | return ic; |
no test coverage detected