public final void handleUnknownException(Throwable e) { Debug.trace(e); String message; if (e == null) { message = "An unknown error occurred."; /*I18N*/ } else if (e.getMessage() == null) { message = "An exception occurred:\n" + " Type: " + e.getClass().getName() + "\n" + " No message text available."; /*I18N*/ } else { message = "An exception occurred:\n" + " Type: " + e.getClass().getName() + "\n" + " Message: " + e.getMessage(); /*I18N*/ } getMainFrame().setCursor(Cursor.getDefaultCursor()); setStatusBarMessage("Error."); logger.log(Level.SEVERE, message, e); showErrorDialog("Error", message); clearStatusBarMessage(); }
pm.beginTask(message, view.isRGB() ? 4 : 3); visatApp.setStatusBarMessage(message); visatApp.getMainFrame().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); final Dimension dimension = new Dimension(view.getProduct().getSceneRasterWidth(), view.getProduct().getSceneRasterHeight()); visatApp.handleUnknownException(e); } finally { visatApp.getMainFrame().setCursor(Cursor.getDefaultCursor()); visatApp.clearStatusBarMessage(); pm.done();
pm.beginTask(message, 1); visatApp.setStatusBarMessage(message); visatApp.getMainFrame().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); RenderedImage image = createImage(imageFormat, view); visatApp.handleUnknownException(e); } finally { visatApp.getMainFrame().setCursor(Cursor.getDefaultCursor()); visatApp.clearStatusBarMessage(); pm.done();
private Product readProductNodes(final File file) { Product product = null; VisatApp visatApp = VisatApp.getApp(); try { visatApp.setStatusBarMessage("Reading from '" + file + "'..."); /*I18N*/ visatApp.getMainFrame().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); if (readerPlugIn.getDecodeQualification(file) != DecodeQualification.UNABLE) { final ProductReader reader = readerPlugIn.createReaderInstance(); product = reader.readProductNodes(file, null); } else { visatApp.showWarningDialog("Cannot decode the selected product file\n" + "'" + file.getPath() + "'"); } visatApp.getMainFrame().setCursor(Cursor.getDefaultCursor()); visatApp.clearStatusBarMessage(); } catch (Exception e) { visatApp.handleUnknownException(e); } return product; }
@Override protected void done() { visatApp.getMainFrame().setCursor(Cursor.getDefaultCursor()); try { ProductSceneView productSceneView = new ProductSceneView(get()); productSceneView.setLayerProperties(visatApp.getPreferences()); openInternalFrame(productSceneView); } catch (OutOfMemoryError e) { visatApp.showOutOfMemoryErrorDialog("The RGB image view could not be created."); /*I18N*/ return; } catch (Exception e) { visatApp.handleUnknownException(e); return; } visatApp.clearStatusBarMessage(); } };