@Override protected GraphExecuter doInBackground() throws Exception { pm.beginTask("Processing Graph...", 10); try { executeStartTime = Calendar.getInstance().getTime(); isProcessing = true; graphEx.executeGraph(pm); } catch (Throwable e) { System.out.print(e.getMessage()); if (e.getMessage() != null && !e.getMessage().isEmpty()) statusLabel.setText(e.getMessage()); else statusLabel.setText(e.getCause().toString()); errorOccured = true; } finally { isProcessing = false; graphEx.disposeGraphContext(); // free cache SystemUtils.freeAllMemory(); pm.done(); } return graphEx; }
@Override protected Boolean doInBackground() throws Exception { pm.beginTask("Processing Graph...", 100 * graphExecuterList.size()); try { executeStartTime = Calendar.getInstance().getTime(); isProcessing = true; for (GraphExecuter graphEx : graphExecuterList) { final String desc = graphEx.getGraphDescription(); if (desc != null && !desc.isEmpty()) statusLabel.setText("Processing " + graphEx.getGraphDescription()); graphEx.InitGraph(); graphEx.executeGraph(SubProgressMonitor.create(pm, 100)); graphEx.disposeGraphContext(); } } catch (Exception e) { System.out.print(e.getMessage()); if (e.getMessage() != null && !e.getMessage().isEmpty()) statusLabel.setText(e.getMessage()); else statusLabel.setText(e.toString()); errorOccured = true; } finally { isProcessing = false; pm.done(); if (SnapApp.getDefault().getPreferences().getBoolean(GPF.BEEP_AFTER_PROCESSING_PROPERTY, false)) { Toolkit.getDefaultToolkit().beep(); } } return true; }
notifyMSG(BatchProcessListener.BatchMSG.UPDATE, statusText); graphEx.executeGraph(SubProgressMonitor.create(pm, 1));
/** * For running graphs in unit tests * * @throws Exception when failing validation */ public void testRunGraph() throws Exception { ioPanel.initProducts(); initGraphs(); if (ValidateAllNodes()) { for (GraphExecuter graphEx : graphExecuterList) { final String desc = graphEx.getGraphDescription(); if (desc != null && !desc.isEmpty()) System.out.println("Processing " + graphEx.getGraphDescription()); graphEx.InitGraph(); graphEx.executeGraph(ProgressMonitor.NULL); graphEx.disposeGraphContext(); } cleanUpTempFiles(); } else { throw new OperatorException(statusLabel.getText()); } }