Example usage for javax.swing JProgressBar setIndeterminate

List of usage examples for javax.swing JProgressBar setIndeterminate

Introduction

In this page you can find the example usage for javax.swing JProgressBar setIndeterminate.

Prototype

public void setIndeterminate(boolean newValue) 

Source Link

Document

Sets the indeterminate property of the progress bar, which determines whether the progress bar is in determinate or indeterminate mode.

Usage

From source file:eu.ggnet.saft.runtime.HiddenMonitorDisplayTask.java

/**
 * Constructor./* w  ww  .j  a v a 2 s. co m*/
 * <p/>
 * @param key         the key identifing this progress
 * @param progressBar the progress bar
 * @param messageBar  the message bar
 * @param keys        a concurent safe set used by all monitors to inform, that one has finished.
 */
public HiddenMonitorDisplayTask(int key, SortedSet<Integer> keys, final JProgressBar progressBar,
        final JLabel messageBar) {
    this.key = key;
    this.keys = keys;
    this.progressBar = progressBar;
    this.messageBar = messageBar;
    progressBar.setIndeterminate(true);
}

From source file:com.moss.appprocs.swing.ProgressMonitorBean.java

private void update() {
    if (log.isDebugEnabled())
        log.debug("Updating " + process.name());

    ProgressReport report = process.progressReport();

    super.getLabelTaskname().setText(process.name());
    super.getLabelDescription().setText(process.description());

    final JProgressBar pBar = getProgressBar();

    String string = report.accept(new ProgressReportVisitor<String>() {
        public String visit(BasicProgressReport r) {
            getCommandButton().setEnabled(false);
            pBar.setIndeterminate(true);
            return r.describe() + "...";
        }/* ww w .ja va2  s .co  m*/

        public String visit(TrackableProgressReport t) {
            pBar.setIndeterminate(false);
            pBar.setMinimum(0);
            pBar.setMaximum((int) t.length());
            pBar.setValue((int) t.progress());
            return t.describe();
        }
    });

    if (process.state() == State.STOPPABLE) {
        stopButton().setEnabled(true);
    } else {
        stopButton().setEnabled(false);
    }

    pBar.setString(string);
}

From source file:Import.pnl_import_vcf.java

public void progressBar() {
    JProgressBar progressBar = new JProgressBar();
    TitledBorder border = BorderFactory.createTitledBorder("Importing...");
    progressBar.setBorder(border);//  w ww.  j  a v  a 2s.  c o m
    progressBar.setIndeterminate(true);
    JDialog dialog = new JDialog();
}

From source file:ca.sqlpower.architect.swingui.enterprise.SecurityPanel.java

public SecurityPanel(SPServerInfo serverInfo, Action closeAction, Dialog d, ArchitectSession session) {
    this.closeAction = closeAction;

    splitpane = new JSplitPane();
    panel = new JPanel();

    ArchitectClientSideSession clientSideSession = ArchitectClientSideSession.getSecuritySessions()
            .get(serverInfo.getServerAddress());

    //Displaying an indeterminate progress bar in place of the split pane
    //until the security session has loaded fully.
    if (clientSideSession.getUpdater().getRevision() <= 0) {
        JLabel messageLabel = new JLabel("Opening");
        JProgressBar progressBar = new JProgressBar();
        progressBar.setIndeterminate(true);

        DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout("pref:grow, 5dlu, pref"));
        builder.setDefaultDialogBorder();
        builder.append(messageLabel, 3);
        builder.nextLine();/*  ww  w.j a  va2  s .  c  om*/
        builder.append(progressBar, 3);

        UpdateListener l = new UpdateListener() {

            @Override
            public void workspaceDeleted() {
                //do nothing
            }

            @Override
            public boolean updatePerformed(AbstractNetworkConflictResolver resolver) {
                panel.removeAll();
                panel.add(splitpane);
                dialog.pack();
                refreshTree();
                return true;
            }

            @Override
            public boolean updateException(AbstractNetworkConflictResolver resolver, Throwable t) {
                //do nothing, the error will be handled elsewhere
                return true;
            }

            @Override
            public void preUpdatePerformed(AbstractNetworkConflictResolver resolver) {
                //do nothing
            }
        };

        clientSideSession.getUpdater().addListener(l);
        panel.add(builder.getPanel());
    }
    this.securityWorkspace = clientSideSession.getWorkspace();
    this.username = serverInfo.getUsername();
    this.dialog = d;
    this.session = session;

    try {
        digester = MessageDigest.getInstance("SHA-256");
    } catch (NoSuchAlgorithmException e) {
        throw new RuntimeException(e);
    }

    rootNode.add(usersNode);
    rootNode.add(groupsNode);

    rightSidePanel = new JPanel();

    tree = new JTree(rootNode);
    tree.addTreeSelectionListener(treeListener);
    tree.setRootVisible(false);
    tree.setShowsRootHandles(true);
    tree.setCellRenderer(new DefaultTreeCellRenderer() {
        public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded,
                boolean leaf, int row, boolean hasFocus) {
            super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
            Object userObject = ((DefaultMutableTreeNode) value).getUserObject();
            if (userObject instanceof User) {
                setIcon(USER_ICON);
            } else if (userObject instanceof Group) {
                setIcon(GROUP_ICON);
            }
            return this;
        }
    });

    treePane = new JScrollPane(tree);
    treePane.setPreferredSize(new Dimension(200, treePane.getPreferredSize().height));

    tree.addMouseListener(popupListener);

    splitpane.setRightComponent(rightSidePanel);
    splitpane.setLeftComponent(treePane);

    if (clientSideSession.getUpdater().getRevision() > 0) {
        panel.removeAll();
        panel.add(splitpane);
    }

    refreshTree();

    try {
        tree.setSelectionPath(new TreePath(usersNode.getFirstChild()));
    } catch (NoSuchElementException e) {
    } // This just means that the node has no children, so we cannot expand the path.
}

From source file:gov.nih.nci.nbia.StandaloneDMV3.java

JFrame showProgress(String message) {
    JFrame f = new JFrame("Info");
    f = new JFrame("Info");
    f.setUndecorated(true);/*w ww . j ava  2s  .  c om*/

    JPanel p = new JPanel();
    Border margin = new EmptyBorder(30, 20, 20, 20);
    p.setBorder(new TitledBorder(
            new TitledBorder(margin, "", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)),
            message, TitledBorder.LEADING, TitledBorder.TOP, null, null));
    p.setLayout(new BorderLayout(30, 30));
    JProgressBar progressBar = new JProgressBar();
    progressBar.setIndeterminate(true);
    p.add(progressBar, BorderLayout.CENTER);

    f.getContentPane().add(p);
    f.setSize(360, 80);
    f.setLocationRelativeTo(null);
    f.setVisible(true);
    return f;
}

From source file:net.sf.jabref.openoffice.AutoDetectPaths.java

public JDialog showProgressDialog(JDialog progressParent, String title, String message,
        boolean includeCancelButton) {
    fileSearchCancelled = false;// w  w  w. ja v  a2s .com
    JProgressBar bar = new JProgressBar(SwingConstants.HORIZONTAL);
    JButton cancel = new JButton(Localization.lang("Cancel"));
    cancel.addActionListener(event -> {
        fileSearchCancelled = true;
        ((JButton) event.getSource()).setEnabled(false);
    });
    final JDialog progressDialog = new JDialog(progressParent, title, false);
    bar.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    bar.setIndeterminate(true);
    if (includeCancelButton) {
        progressDialog.add(cancel, BorderLayout.SOUTH);
    }
    progressDialog.add(new JLabel(message), BorderLayout.NORTH);
    progressDialog.add(bar, BorderLayout.CENTER);
    progressDialog.pack();
    progressDialog.setLocationRelativeTo(null);
    progressDialog.setVisible(true);
    return progressDialog;
}

From source file:ConfigFiles.java

public ConfigFiles(Dimension screensize) {
    //         initializeFileBrowser();
    paths = new JPanel();
    paths.setBackground(Color.WHITE);
    //paths.setBorder(BorderFactory.createTitledBorder("Paths"));
    paths.setLayout(null);/*  w  ww . j a va 2s.co  m*/
    paths.setPreferredSize(new Dimension(930, 1144));
    paths.setSize(new Dimension(930, 1144));
    paths.setMinimumSize(new Dimension(930, 1144));
    paths.setMaximumSize(new Dimension(930, 1144));
    //paths.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
    setLayout(null);
    ttcpath = new JTextField();
    addPanel("TestCase Source Path",
            "Master directory with the test cases that can" + " be run by the framework", ttcpath,
            RunnerRepository.TESTSUITEPATH, 10, true, null);
    tMasterXML = new JTextField();
    tUsers = new JTextField();

    addPanel("Projects Path", "Location of projects XML files", tUsers, RunnerRepository.REMOTEUSERSDIRECTORY,
            83, true, null);

    tSuites = new JTextField();
    addPanel("Predefined Suites Path", "Location of predefined suites", tSuites,
            RunnerRepository.PREDEFINEDSUITES, 156, true, null);

    testconfigpath = new JTextField();
    addPanel("Test Configuration Path", "Test Configuration path", testconfigpath,
            RunnerRepository.TESTCONFIGPATH, 303, true, null);

    tepid = new JTextField();
    addPanel("EP name File", "Location of the file that contains" + " the Ep name list", tepid,
            RunnerRepository.REMOTEEPIDDIR, 595, true, null);
    tlog = new JTextField();
    addPanel("Logs Path", "Location of the directory that stores the most recent log files."
            + " The files are re-used each Run.", tlog, RunnerRepository.LOGSPATH, 667, true, null);
    tsecondarylog = new JTextField();

    JPanel p = addPanel("Secondary Logs Path",
            "Location of the directory that archives copies of the most recent log files, with"
                    + " original file names appended with <.epoch time>",
            tsecondarylog, RunnerRepository.SECONDARYLOGSPATH, 930, true, null);
    logsenabled.setSelected(Boolean.parseBoolean(RunnerRepository.PATHENABLED));
    logsenabled.setBackground(Color.WHITE);
    p.add(logsenabled);

    JPanel p7 = new JPanel();
    p7.setBackground(Color.WHITE);
    TitledBorder border7 = BorderFactory.createTitledBorder("Log Files");
    border7.setTitleFont(new Font("Arial", Font.PLAIN, 14));
    border7.setBorder(BorderFactory.createLineBorder(new Color(150, 150, 150), 1));
    p7.setBorder(border7);
    p7.setLayout(new BoxLayout(p7, BoxLayout.Y_AXIS));
    p7.setBounds(80, 740, 800, 190);
    paths.add(p7);
    JTextArea log2 = new JTextArea("All the log files that will be monitored");
    log2.setWrapStyleWord(true);
    log2.setLineWrap(true);
    log2.setEditable(false);
    log2.setCursor(null);
    log2.setOpaque(false);
    log2.setFocusable(false);
    log2.setBorder(null);
    log2.setFont(new Font("Arial", Font.PLAIN, 12));
    log2.setBackground(getBackground());
    log2.setMaximumSize(new Dimension(170, 25));
    log2.setPreferredSize(new Dimension(170, 25));
    JPanel p71 = new JPanel();
    p71.setBackground(Color.WHITE);
    p71.setLayout(new GridLayout());
    p71.setMaximumSize(new Dimension(700, 13));
    p71.setPreferredSize(new Dimension(700, 13));
    p71.add(log2);
    JPanel p72 = new JPanel();
    p72.setBackground(Color.WHITE);
    p72.setLayout(new BoxLayout(p72, BoxLayout.Y_AXIS));
    trunning = new JTextField();
    p72.add(addField(trunning, "Running: ", 0));
    tdebug = new JTextField();
    p72.add(addField(tdebug, "Debug: ", 1));
    tsummary = new JTextField();
    p72.add(addField(tsummary, "Summary: ", 2));
    tinfo = new JTextField();
    p72.add(addField(tinfo, "Info: ", 3));
    tcli = new JTextField();
    p72.add(addField(tcli, "Cli: ", 4));
    p7.add(p71);
    p7.add(p72);
    libpath = new JTextField();

    addPanel("Library path", "Secondary user library path", libpath, RunnerRepository.REMOTELIBRARY, 229, true,
            null);

    JPanel p8 = new JPanel();
    p8.setBackground(Color.WHITE);
    TitledBorder border8 = BorderFactory.createTitledBorder("File");
    border8.setTitleFont(new Font("Arial", Font.PLAIN, 14));
    border8.setBorder(BorderFactory.createLineBorder(new Color(150, 150, 150), 1));
    p8.setBorder(border8);
    p8.setLayout(null);
    p8.setBounds(80, 1076, 800, 50);
    if (PermissionValidator.canChangeFWM()) {
        paths.add(p8);
    }
    JButton save = new JButton("Save");
    save.setToolTipText("Save and automatically load config");
    save.setBounds(490, 20, 70, 20);
    save.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ev) {
            saveXML(false, "fwmconfig");
            loadConfig("fwmconfig.xml");
        }
    });
    p8.add(save);
    //         if(!PermissionValidator.canChangeFWM()){
    //             save.setEnabled(false);
    //         }
    JButton saveas = new JButton("Save as");
    saveas.setBounds(570, 20, 90, 20);
    saveas.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ev) {
            String filename = CustomDialog.showInputDialog(JOptionPane.QUESTION_MESSAGE,
                    JOptionPane.OK_CANCEL_OPTION, ConfigFiles.this, "File Name", "Please enter file name");
            if (!filename.equals("NULL")) {
                saveXML(false, filename);
            }
        }
    });
    p8.add(saveas);

    final JButton loadXML = new JButton("Load Config");
    loadXML.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ev) {
            try {
                String[] configs = RunnerRepository
                        .getRemoteFolderContent(RunnerRepository.USERHOME + "/twister/config/");
                JComboBox combo = new JComboBox(configs);
                int resp = (Integer) CustomDialog.showDialog(combo, JOptionPane.INFORMATION_MESSAGE,
                        JOptionPane.OK_CANCEL_OPTION, ConfigFiles.this, "Config", null);
                final String config;
                if (resp == JOptionPane.OK_OPTION)
                    config = combo.getSelectedItem().toString();
                else
                    config = null;
                if (config != null) {
                    new Thread() {
                        public void run() {
                            setEnabledTabs(false);
                            JFrame progress = new JFrame();
                            progress.setAlwaysOnTop(true);
                            progress.setLocation((int) loadXML.getLocationOnScreen().getX(),
                                    (int) loadXML.getLocationOnScreen().getY());
                            progress.setUndecorated(true);
                            JProgressBar bar = new JProgressBar();
                            bar.setIndeterminate(true);
                            progress.add(bar);
                            progress.pack();
                            progress.setVisible(true);
                            loadConfig(config);
                            progress.dispose();
                            setEnabledTabs(true);
                        }
                    }.start();
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
    loadXML.setBounds(670, 20, 120, 20);
    p8.add(loadXML);
    //         if(!PermissionValidator.canChangeFWM()){
    //             loadXML.setEnabled(false);
    //         }

    tdbfile = new JTextField();
    addPanel("Database XML path", "File location for database configuration", tdbfile,
            RunnerRepository.REMOTEDATABASECONFIGPATH + RunnerRepository.REMOTEDATABASECONFIGFILE, 375, true,
            null);
    temailfile = new JTextField();
    //         emailpanel = (JPanel)
    addPanel("Email XML path", "File location for email configuration", temailfile,
            RunnerRepository.REMOTEEMAILCONFIGPATH + RunnerRepository.REMOTEEMAILCONFIGFILE, 448, true, null)
                    .getParent();
    //paths.remove(emailpanel);

    //         emailpanel.setBounds(360,440,350,100);
    //         RunnerRepository.window.mainpanel.p4.getEmails().add(emailpanel);

    tglobalsfile = new JTextField();
    addPanel("Globals XML file", "File location for globals parameters", tglobalsfile,
            RunnerRepository.GLOBALSREMOTEFILE, 521, true, null);

    tceport = new JTextField();
    addPanel("Central Engine Port", "Central Engine port", tceport, RunnerRepository.getCentralEnginePort(),
            1003, false, null);
    //         traPort = new JTextField();
    //         addPanel("Resource Allocator Port","Resource Allocator Port",
    //                 traPort,RunnerRepository.getResourceAllocatorPort(),808,false,null);                
    //         thttpPort = new JTextField();
    //         addPanel("HTTP Server Port","HTTP Server Port",thttpPort,
    //                 RunnerRepository.getHTTPServerPort(),740,false,null);

    //paths.add(loadXML);

    if (!PermissionValidator.canChangeFWM()) {
        ttcpath.setEnabled(false);
        tMasterXML.setEnabled(false);
        tUsers.setEnabled(false);
        tepid.setEnabled(false);
        tSuites.setEnabled(false);
        tlog.setEnabled(false);
        trunning.setEnabled(false);
        tdebug.setEnabled(false);
        tsummary.setEnabled(false);
        tinfo.setEnabled(false);
        tcli.setEnabled(false);
        tdbfile.setEnabled(false);
        temailfile.setEnabled(false);
        tceport.setEnabled(false);
        libpath.setEnabled(false);
        tsecondarylog.setEnabled(false);
        testconfigpath.setEnabled(false);
        tglobalsfile.setEnabled(false);
        logsenabled.setEnabled(false);
    }

}

From source file:com.entertailion.java.fling.FlingFrame.java

/**
 * Create a progress indicator/*w w w .  ja v  a 2 s  .  co  m*/
 */
private void createProgressDialog() {
    progressDialog = new JDialog(this, resourceBundle.getString("progress.title"), true);
    JProgressBar progressBar = new JProgressBar(0, 100);
    progressBar.setStringPainted(true);
    progressBar.setIndeterminate(true);
    progressDialog.add(BorderLayout.CENTER, progressBar);
    progressDialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
    progressDialog.setSize(300, 75);
    progressDialog.setLocationRelativeTo(this);
}

From source file:gui_pack.MainGui.java

private void runTestsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_runTestsButtonActionPerformed
    int rangeMin, rangeMax, spacing;
    int passing = 0;

    {//  Beginning of input validation
        String errorTitle, errorMessage;

        //make sure at least one sort algorithm is selected
        if (!(insertionCheckBox.isSelected() || mergeCheckBox.isSelected() || quickCheckBox.isSelected()
                || selectionCheckBox.isSelected())) {
            errorTitle = "Selection Error";
            errorMessage = "At least one sort algorithm (Insertion Sort, "
                    + "Merge Sort, Quick Sort, or Selection Sort) must be selected.";
            JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.WARNING_MESSAGE);
            return;
        }// w w  w.  j av  a 2  s .  co m

        //make sure at least one order is selected
        if (!(ascendingCheckBox.isSelected() || descendingCheckBox.isSelected()
                || randomCheckBox.isSelected())) {
            errorTitle = "Selection Error";
            errorMessage = "At least one order (Ascending Order, Descending Order, or Random Order) "
                    + "must be selected.";
            JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.WARNING_MESSAGE);
            return;
        }

        //make sure all the proper fields contain data
        try {
            rangeMin = Integer.parseInt(rangeMinField.getText());
            rangeMax = Integer.parseInt(rangeMaxField.getText());
            spacing = Integer.parseInt(spacingField.getText());
            //for the multithreaded version of this program "iterations" cannot be a variable
            //this was left in to catch if the iteration field is left blank or has no value
            if (iterationField.isEnabled()) {
                Integer.parseInt(iterationField.getText());
            }
        } catch (NumberFormatException arbitraryName) {
            errorTitle = "Input Error";
            if (iterationField.isEnabled()) {
                errorMessage = "The size, intervals, and iterations fields must contain "
                        + "integer values and only integer values.";
            } else {
                errorMessage = "The size and intervals fields must contain "
                        + "integer values and only integer values.";
            }
            JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.WARNING_MESSAGE);
            return;
        }

        //make sure field data is appropriate
        if (rangeMin > rangeMax) {
            errorTitle = "Range Error";
            errorMessage = "Minimum Size must be less than or equal to Maximum Size.";
            JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.WARNING_MESSAGE);
            return;
        }

        if (spacing < 1 || rangeMin < 1 || rangeMax < 1
                || (iterationField.isEnabled() && Integer.parseInt(iterationField.getText()) < 1)) {
            errorTitle = "Value Error";
            if (iterationField.isEnabled()) {
                errorMessage = "Intervals, sizes, and iterations must be in the positive domain. "
                        + "Spacing, Range(min), Range(max), and Iterations must be greater than or"
                        + " equal to one.";
            } else {
                errorMessage = "Intervals and sizes must be in the positive domain. "
                        + "Spacing, Range(min) and Range(max) be greater than or" + " equal to one.";
            }
            JOptionPane.showMessageDialog(null, errorMessage, errorTitle, JOptionPane.WARNING_MESSAGE);
            return;
        }

        if (!iterationField.isEnabled()) {
            passing = 0;
        }

    } // End of input validation

    //here's where we set up a loading bar in case the tests take a while
    JProgressBar loadBar = new JProgressBar();
    JFrame loadFrame = new JFrame();
    JLabel displayLabel1 = new JLabel();
    loadBar.setIndeterminate(true);
    loadBar.setVisible(true);
    displayLabel1.setText("Running large tests, or many tests, using inefficient algorithms \n"
            + "may take a while. Please be patient.");
    loadFrame.setLayout(new FlowLayout());
    loadFrame.add(loadBar);
    loadFrame.add(displayLabel1);
    loadFrame.setSize(600, 100);
    loadFrame.setTitle("Loading");
    loadFrame.setVisible(true);

    //now we will leave this open until the tests are completed
    //now we can conduct the actual tests
    SwingWorker worker = new SwingWorker<XYSeriesCollection, Void>() {
        XYSeriesCollection results = new XYSeriesCollection();

        @Override
        protected XYSeriesCollection doInBackground() {
            XYSeries insertSeries = new XYSeries("Insertion Sort");
            XYSeries mergeSeries = new XYSeries("Merge Sort");
            XYSeries quickSeries = new XYSeries("Quick Sort");
            XYSeries selectSeries = new XYSeries("Selection Sort");

            final boolean ascending = ascendingCheckBox.isSelected();
            final boolean descending = descendingCheckBox.isSelected();
            final boolean insertion = insertionCheckBox.isSelected();
            final boolean merge = mergeCheckBox.isSelected();
            final boolean quick = quickCheckBox.isSelected();
            final boolean selection = selectionCheckBox.isSelected();

            final int iterations = Integer.parseInt(iterationField.getText());

            ListGenerator generator = new ListGenerator();
            int[] list;
            for (int count = rangeMin; count <= rangeMax; count = count + spacing) {

                if (ascending) {

                    list = generator.ascending(count);
                    if (insertion) {
                        insertSeries.add(count, insertionSort.sort(list));
                    }
                    if (merge) {
                        mergeSeries.add(count, mergeSort.sort(list));
                    }
                    if (quick) {
                        quickSeries.add(count, quickSort.sort(list));
                    }
                    if (selection) {
                        selectSeries.add(count, selectionSort.sort(list));
                    }
                }
                if (descending) {

                    list = generator.descending(count);
                    if (insertion) {
                        insertSeries.add(count, insertionSort.sort(list));
                    }
                    if (merge) {
                        mergeSeries.add(count, mergeSort.sort(list));
                    }
                    if (quick) {
                        quickSeries.add(count, quickSort.sort(list));
                    }
                    if (selection) {
                        selectSeries.add(count, selectionSort.sort(list));
                    }
                }

                for (int iteration = 0; iteration < iterations; iteration++) {
                    list = generator.random(count);

                    if (insertion) {
                        insertSeries.add(count, insertionSort.sort(list));
                    }
                    if (merge) {
                        mergeSeries.add(count, mergeSort.sort(list));
                    }
                    if (quick) {
                        quickSeries.add(count, quickSort.sort(list));
                    }
                    if (selection) {
                        selectSeries.add(count, selectionSort.sort(list));
                    }
                }

            }

            //now we aggregate the results
            if (insertion) {
                results.addSeries(insertSeries);
            }
            if (merge) {
                results.addSeries(mergeSeries);
            }
            if (quick) {
                results.addSeries(quickSeries);
            }
            if (selection) {
                results.addSeries(selectSeries);
            }
            return results;
        }

        @Override
        protected void done() {
            //finally, we display the results
            JFreeChart chart = ChartFactory.createScatterPlot("SortExplorer", // chart title
                    "List Size", // x axis label
                    "Number of Comparisons", // y axis label
                    results, // data  
                    PlotOrientation.VERTICAL, true, // include legend
                    true, // tooltips
                    false // urls
            );
            ChartFrame frame = new ChartFrame("First", chart);
            frame.pack();
            frame.setVisible(true);
            loadFrame.setVisible(false);
        }
    };

    //having set up the multithreading 'worker' we can finally conduct the 
    //test
    worker.execute();

}

From source file:it.iit.genomics.cru.igb.bundles.mi.business.MIWorker.java

public MIWorker(List<MIResult> results, IgbService service, MIQuery query, JProgressBar progressBar) {

    this.service = service;
    this.query = query;
    this.results = results;
    this.progressBar = progressBar;
    this.trackId = query.getLabel();

    igbLogger = IGBLogger.getInstance(trackId);

    progressBar.setIndeterminate(true);

    this.geneManager = IGBQuickLoadGeneManager.getInstance(service, query.getSpecies());
    geneManager.setSequences(query.getSequences());
}