Examples of WaitingDialog


Examples of com.compomics.util.gui.waiting.waitinghandlers.WaitingDialog

                    // Do something here?
                }

                PeptideShakerGUI peptideShakerGUI = new PeptideShakerGUI(); // dummy object to get at the version and tips
                peptideShakerGUI.setUpLogFile(false); // redirect the error stream to the PeptideShaker log file
                waitingHandler = new WaitingDialog(new DummyFrame("PeptideShaker " + PeptideShaker.getVersion(), "/icons/peptide-shaker.gif"),
                        Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")),
                        Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker-orange.gif")),
                        false, tips, "Importing Data", "PeptideShaker", PeptideShaker.getVersion(), true);
                ((WaitingDialog) waitingHandler).setCloseDialogWhenImportCompletes(false, false);
                ((WaitingDialog) waitingHandler).setLocationRelativeTo(null);
View Full Code Here

Examples of com.compomics.util.gui.waiting.waitinghandlers.WaitingDialog

            } catch (Exception e) {
                tips = new ArrayList<String>();
                // Do something here?
            }

            WaitingDialog waitingDialog = new WaitingDialog(peptideShakerGUI,
                    Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")),
                    Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker-orange.gif")),
                    true, tips, "Importing Data", "PeptideShaker", PeptideShaker.getVersion(), true);
            waitingDialog.setCloseDialogWhenImportCompletes(true, true);

            int progressCounter = idFiles.size() + spectrumFiles.size();

            progressCounter++; // establishing the database connection
            progressCounter++; // the FASTA file
            progressCounter++; // the peptide to protein map
            progressCounter += 6; // computing probabilities etc
            progressCounter += 2; // resolving protein inference
            progressCounter += 4; // Correcting protein probabilities, Validating identifications at 1% FDR, Scoring PTMs in peptides, Scoring PTMs in proteins.
            progressCounter += 3; // Scoring PTMs in PSMs. Estimating PTM FLR. Resolving peptide inference issues.

            // add one more just to not start at 0%
            progressCounter++;

            waitingDialog.setMaxPrimaryProgressCounter(progressCounter);
            waitingDialog.increasePrimaryProgressCounter(); // just to not start at 0%

            boolean needDialog = false;

            // load the identification files
            if (idFiles.size() > 0
                    || searchParameters != null
                    || searchParameters.getFastaFile() != null
                    || spectrumFiles.size() > 0) {
                needDialog = true;
                importIdentificationFiles(waitingDialog);
            }

            if (needDialog) {
                try {
                    waitingDialog.setVisible(true);
                } catch (IndexOutOfBoundsException e) {
                    // ignore
                }
                this.dispose();
            }

            if (!needDialog || !waitingDialog.isRunCanceled()) {

                // show the warnings
                Iterator<String> iterator = peptideShaker.getWarnings().keySet().iterator();
                int counter = 0;
                while (iterator.hasNext()) {
                    FeedBack warning = peptideShaker.getWarnings().get(iterator.next());
                    if (warning.getType() == FeedBack.FeedBackType.WARNING) {
                        peptideShakerGUI.addNote("<b>" + ++counter + " " + warning.getTitle() + "</b><br><br>" + warning.getMessage()); // @TODO: better interaction between notes and feedback objetcs...
                    }
                }

                peptideShakerGUI.setProcessingPreferences(processingPreferences);
                peptideShakerGUI.setPtmScoringPreferences(ptmScoringPreferences);
                peptideShakerGUI.setIdFilter(idFilter);
                peptideShakerGUI.updateAnnotationPreferencesFromSearchSettings();
                peptideShakerGUI.setProject(experiment, sample, replicateNumber);
                peptideShakerGUI.setMetrics(peptideShaker.getMetrics());
                peptideShakerGUI.setIdentificationFeaturesGenerator(peptideShaker.getIdentificationFeaturesGenerator());
                peptideShakerGUI.setCache(peptideShaker.getCache());
                peptideShakerGUI.setUpInitialFilters();
                peptideShakerGUI.displayResults();
                peptideShakerGUI.initiateDisplay(); // display the overview tab
                peptideShakerGUI.getProjectDetails().setReport(waitingDialog.getReport(null));
                this.dispose();
            } else if (waitingDialog.isRunCanceled()) {

                // close the database
                try {
                    ProteomicAnalysis proteomicAnalysis = experiment.getAnalysisSet(sample).getProteomicAnalysis(replicateNumber);
                    Identification identification = proteomicAnalysis.getIdentification(IdentificationMethod.MS2_IDENTIFICATION);
View Full Code Here

Examples of org.rioproject.tools.ui.progresspanel.WaitingDialog

                dialog.setVisible(true);
                final String name = u.getSelectedOpStringName();
                if(name==null)
                    return;
                final GraphNode node = graphView.getOpStringNode(name);
                final JDialog waitDialog = new WaitingDialog(frame, "Undeploying "+name+"...", 500);
                org.rioproject.tools.ui.util.SwingWorker worker = new org.rioproject.tools.ui.util.SwingWorker() {
                    public Object construct() {
                        try {
                            DeployAdmin dAdmin = (DeployAdmin)node.getProvisionMonitor().getAdmin();
                            dAdmin.undeploy(name);
                        } catch(OperationalStringException e) {
                            graphView.removeOpString(name);
                        } catch(Exception e) {
                            System.err.println("OUCH");
                            e.printStackTrace();
                        }
                        return null;
                    }

                    @Override
                    public void finished() {
                        waitDialog.dispose();
                    }
                };
                worker.start();
            }
        });
View Full Code Here

Examples of org.rioproject.tools.ui.progresspanel.WaitingDialog

        for(OperationalString opString : opstrings) {
            if(opstringNames.length()>0)
                opstringNames.append(", ");
            opstringNames.append(opString.getName());
        }
        final JDialog dialog = new WaitingDialog(frame,
                                                 "Deploying "+opstringNames.toString()+"...",
                                                 500);
        SwingWorker worker = new SwingWorker() {
            public Object construct() {
                try {
                    ProvisionMonitor monitor = (ProvisionMonitor) item.service;
                    DeployAdmin dAdmin = (DeployAdmin) monitor.getAdmin();
                    for (OperationalString opString : opstrings) {
                        if (dAdmin.hasDeployed(opString.getName())) {
                            int result = JOptionPane.showConfirmDialog(frame,
                                                                       "The [" + opString.getName() + "] " +
                                                                       "is already deployed, " +
                                                                       "update the deployment?",
                                                                       "Update Deployed Application",
                                                                       JOptionPane.YES_NO_OPTION);
                            if (result == JOptionPane.YES_OPTION) {
                                dAdmin.getOperationalStringManager(opString.getName()).update(opString);
                            }
                        } else {
                            dAdmin.deploy(opString);
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    Util.showError(e, frame, "Failure trying to deploy " + deployName);
                }
                return null;
            }

            @Override
            public void finished() {
                dialog.dispose();
            }
        };
        worker.start();
    }
View Full Code Here

Examples of org.rioproject.tools.ui.progresspanel.WaitingDialog

     * @param frame The UI's frame, used as the JOptionPane's parent if a confirm dialog or an error needs to be shown
     */
    public static void deploy(final String artifact,
                              final ServiceItem item,
                              final JFrame frame) {
        final JDialog dialog = new WaitingDialog(frame, "Deploying "+artifact+"...", 500);

        SwingWorker worker = new SwingWorker() {
            public Object construct() {
                try {
                    ProvisionMonitor monitor = (ProvisionMonitor) item.service;
                    DeployAdmin dAdmin = (DeployAdmin) monitor.getAdmin();
                    dAdmin.deploy(artifact);
                } catch (Exception e) {
                    e.printStackTrace();
                    Throwable cause = e.getCause();
                    if(cause != null) {
                        Throwable nested = cause.getCause();
                        Util.showError((nested==null?cause:nested),
                                       frame,
                                       "Failure trying to deploy artifact" + artifact);
                    } else {
                        Util.showError(e, frame, "Failure trying to deploy artifact" + artifact);
                    }
                }
                return null;
            }

            @Override
            public void finished() {
                dialog.dispose();
            }
        };
        worker.start();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.