/** if running terminate first */
thumbnails.terminateDrawing();
commonValues.setProcessing(true);
SwingWorker worker = new SwingWorker() {
public Object construct() {
try {
currentGUI.updateStatusMessage(Messages.getMessage("PdfViewerDecoding.page"));
if (img != null)
addImage(img);
PdfPageData page_data = decode_pdf.getPdfPageData();
if (img != null)
page_data.setMediaBox(new float[]{0,0,img.getWidth(),img.getHeight()});
page_data.checkSizeSet(1);
currentGUI.resetRotationBox();
/**
* make sure screen fits display nicely
*/
if ((resizePanel) && (thumbnails.isShownOnscreen()))
currentGUI.zoom(false);
if (Thread.interrupted())
throw new InterruptedException();
currentGUI.setPageNumber();
currentGUI.setViewerTitle(null); // restore title
} catch (Exception e) {
currentGUI.setViewerTitle(null); //restore title
}
currentGUI.setStatusProgress(100);
//reanable user changing scaling
currentGUI.resetComboBoxes(true);
//ensure drawn
decode_pdf.repaint();
openingTransferedFile=false;
return null;
}
};
worker.start();
}