//JOptionPane.showMessageDialog(IGV.getInstance(),
// "Track panning is not enabled for data tracks.");
return;
}
Feature f = null;
if (t instanceof FeatureTrack) {
f = ((FeatureTrack) t).nextFeature(frame.getChrName(), frame.getCenter(), forward, frame);
} else if (t instanceof VariantTrack) {
f = ((VariantTrack) t).nextFeature(frame.getChrName(), frame.getCenter(), forward, frame);
}
if (f != null) {
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);