//We search backwards by setting a negative searchIncrement
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();