()
| 772 | } |
| 773 | |
| 774 | protected void redraw() { |
| 775 | boolean wasShrinkWrapped = isShrinkWrapped(pixmapWidth, pixmapHeight); |
| 776 | |
| 777 | if (pixmap != null) { |
| 778 | pixmapWidth = pixmap.getWidth(); |
| 779 | pixmapHeight = pixmap.getHeight(); |
| 780 | BufferedImage image = new BufferedImage(pixmapWidth, pixmapHeight, BufferedImage.TYPE_3BYTE_BGR); |
| 781 | image.setRGB(0, 0, pixmapWidth, pixmapHeight, pixmap.getPixels(), 0, pixmapWidth); |
| 782 | pageCanvas.setPage(image, showLinks ? links : null, hits); |
| 783 | } else { |
| 784 | pixmapWidth = 0; |
| 785 | pixmapHeight = 0; |
| 786 | pageCanvas.setPage(null, null, null); |
| 787 | } |
| 788 | |
| 789 | if (wasShrinkWrapped) |
| 790 | shrinkWrap(); |
| 791 | |
| 792 | pageCanvas.invalidate(); |
| 793 | validate(); |
| 794 | } |
| 795 | |
| 796 | protected static String paperSizeName(int w, int h) |
| 797 | { |
no test coverage detected