@Override public void run() { UIUtils.setRootFrameWaitCursor(app.getMainFrame()); try { openProductImpl(app, productFilepath); } finally { UIUtils.setRootFrameDefaultCursor(app.getMainFrame()); } } });
private Product readProductNodes(final File file) { final ProductReader reader = _readerPlugIn.createReaderInstance(); Product product = null; Cursor cursor = UIUtils.setRootFrameWaitCursor(this); try { product = reader.readProductNodes(file, null); UIUtils.setRootFrameCursor(this, cursor); } catch (IOException e) { UIUtils.setRootFrameCursor(this, cursor); JOptionPane.showMessageDialog(getWindow(), "Product I/O Error:\n" + "'" + e.getMessage() + "'", "Product I/O Error", JOptionPane.ERROR_MESSAGE); } return product; } }
UIUtils.setRootFrameWaitCursor(VisatApp.getApp().getMainFrame()); swingWorker.execute();
UIUtils.setRootFrameWaitCursor(getMainFrame()); setStatusBarMessage("Closing product '" + product.getDisplayName() + "'..."); closeAllAssociatedFrames(product);
@Override protected Object doInBackground(ProgressMonitor pm) throws Exception { UIUtils.setRootFrameWaitCursor(ImageInfoEditor2.this); final ProductSceneView view = parentForm.getProductSceneView(); if (view != null) { final RasterDataNode[] rasters = view.getRasters(); try { pm.beginTask("Computing statistics", rasters.length); for (RasterDataNode raster : rasters) { raster.getStx(true, SubProgressMonitor.create(pm, 1)); } } finally { pm.done(); } } return null; }
private void openProductImpl(final File file) { File[] selectedFiles; FileFilter selectedFileFilter = null; if (file == null || !file.exists()) { JFileChooser fileChooser = showOpenFileDialog(); if (fileChooser == null) { return; } selectedFiles = fileChooser.getSelectedFiles(); selectedFileFilter = fileChooser.getFileFilter(); } else { selectedFiles = new File[]{file}; } Cursor oldCursor = getMainFrame().getCursor(); String formatName = null; if (selectedFileFilter instanceof BeamFileFilter) { formatName = ((BeamFileFilter) selectedFileFilter).getFormatName(); } UIUtils.setRootFrameWaitCursor(getMainFrame()); SwingWorker openProductSwingWorker = new OpenProductSwingWorker(selectedFiles, formatName, oldCursor); openProductSwingWorker.execute(); }
UIUtils.setRootFrameWaitCursor(VisatApp.getApp().getMainFrame());
UIUtils.setRootFrameWaitCursor(visatApp.getMainFrame()); worker.execute();
UIUtils.setRootFrameWaitCursor(mainFrame); swingWorker.executeWithBlocking();
UIUtils.setRootFrameWaitCursor(VisatApp.getApp().getMainFrame());
public void openProductSceneView(final RasterDataNode selectedProductNode) { VisatApp.getApp().setStatusBarMessage("Opening image view..."); UIUtils.setRootFrameWaitCursor(VisatApp.getApp().getMainFrame());
UIUtils.setRootFrameWaitCursor(VisatApp.getApp().getMainFrame());
final P p; try { UIUtils.setRootFrameWaitCursor(getEditorComponent()); p = getSelectedProduct(paramProperties); } catch (IOException e) {
/** * Performs the actual "Export Mask Pixels" command. */ private void exportVectorDataNode() { final VisatApp app = VisatApp.getApp(); final ProductNode productNode = app.getSelectedProductNode(); final VectorDataNode vectorDataNode = (VectorDataNode) productNode; if (vectorDataNode.getFeatureCollection().isEmpty()) { app.showInfoDialog(DLG_TITLE, "The selected geometry is empty. Nothing to export.", null); return; } final File file = promptForFile(app, vectorDataNode.getName()); if (file == null) { return; } final SwingWorker<Exception, Object> swingWorker = new ExportVectorNodeSwingWorker(app, vectorDataNode, file); UIUtils.setRootFrameWaitCursor(VisatApp.getApp().getMainFrame()); VisatApp.getApp().setStatusBarMessage("Exporting Geometry..."); swingWorker.execute(); }