Package org.broad.igv.tools

Examples of org.broad.igv.tools.FeatureSearcher$GotoFeatureHandler


        int searchIncrement = (initEnd - initStart) * (forward ? +1 : -1);
        int start = initStart + searchIncrement;

        IndefiniteProgressMonitor monitor = new IndefiniteProgressMonitor();

        final FeatureSearcher searcher = new FeatureSearcher(source, genome, chr, start, monitor);
        searcher.setSearchIncrement(searchIncrement);

        final ActionListener cancelListener = new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                FeatureTrackUtils.isSearching = false;
                searcher.cancel();
            }
        };

        final CancellableProgressDialog dialog = CancellableProgressDialog.showCancellableProgressDialog(IGV.getMainFrame(), "Searching...", cancelListener, true, monitor);
        dialog.getProgressBar().setIndeterminate(true);

        monitor.addPropertyChangeListener(new PropertyChangeListener() {
            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                if(evt.getPropertyName().equals(ProgressMonitor.PROGRESS_PROPERTY) &&  (Integer) evt.getNewValue() >= 100){
                    FeatureTrackUtils.isSearching = false;
                    Iterator<? extends Feature> result = searcher.getResult();
                    if(result != null) foundHandler.processResult(result);
                }
            }
        });

View Full Code Here

TOP

Related Classes of org.broad.igv.tools.FeatureSearcher$GotoFeatureHandler

Copyright © 2018 www.massapicom. 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.