public static class GotoFeatureHandler implements IFeatureFound{
@Override
public void processResult(Iterator<? extends Feature> searchResult) {
ReferenceFrame frame = FrameManager.getDefaultFrame();
Feature f = searchResult.next();
String chr = GenomeManager.getInstance().getCurrentGenome().getChromosomeAlias(f.getChr());
double newCenter = f.getStart();
if (!chr.equals(frame.getChrName())) {
// Switch chromosomes. We have to do some tricks to maintain the same resolution scale.
double range = frame.getEnd() - frame.getOrigin();
int newOrigin = (int) Math.max(newCenter - range / 2, 0);
int newEnd = (int) (newOrigin + range);