~ubuntu-branches/ubuntu/oneiric/tuxguitar/oneiric

« back to all changes in this revision

Viewing changes to src/org/herac/tuxguitar/gui/marker/MarkerNavigator.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2008-06-19 00:30:30 UTC
  • mto: (5.1.2 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20080619003030-h719szrhsngou7c6
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package org.herac.tuxguitar.gui.marker;
2
 
 
3
 
import org.herac.tuxguitar.gui.TuxGuitar;
4
 
import org.herac.tuxguitar.gui.editors.tab.Caret;
5
 
import org.herac.tuxguitar.gui.editors.tab.MeasureCoords;
6
 
import org.herac.tuxguitar.gui.editors.tab.SongTrackCoords;
7
 
import org.herac.tuxguitar.song.models.Marker;
8
 
 
9
 
public class MarkerNavigator {
10
 
 
11
 
        public MarkerNavigator(){               
12
 
        }
13
 
        
14
 
        public void goToSelectedMarker(Marker marker){                                
15
 
        if(marker != null){
16
 
                Caret caret = TuxGuitar.instance().getTablatureEditor().getTablature().getCaret();
17
 
                SongTrackCoords track = caret.getSongTrackCoords();
18
 
                MeasureCoords measure = null;           
19
 
                if(track != null){
20
 
                        measure = track.getMeasure(TuxGuitar.instance().getSongManager().getTrackManager().getMeasure(track.getTrack(),marker.getMeasure()));
21
 
                }               
22
 
            if(track != null && measure != null){
23
 
                caret.update(track.getTrack().getNumber(), measure.getMeasure().getStart(),1);
24
 
                caret.setChanges(true);
25
 
                TuxGuitar.instance().redraw();
26
 
            }               
27
 
        }               
28
 
        }
29
 
}