2
* Created on 17-dic-2005
4
* TODO To change the template for this generated file go to
5
* Window - Preferences - Java - Code Style - Code Templates
7
package org.herac.tuxguitar.gui.actions.measure;
9
import org.eclipse.swt.events.TypedEvent;
10
import org.herac.tuxguitar.gui.actions.Action;
11
import org.herac.tuxguitar.gui.editors.TablatureEditor;
12
import org.herac.tuxguitar.gui.editors.tab.Caret;
13
import org.herac.tuxguitar.gui.editors.tab.MeasureCoords;
14
import org.herac.tuxguitar.gui.editors.tab.SongTrackCoords;
19
* TODO To change the template for this generated type comment go to
20
* Window - Preferences - Java - Code Style - Code Templates
22
public class GoFirstMeasureAction extends Action{
23
public static final String NAME = "action.measure.go-first";
25
public GoFirstMeasureAction(TablatureEditor tablatureEditor) {
26
super(NAME,true,tablatureEditor);
29
public boolean doAction(TypedEvent e) {
30
Caret caret = getEditor().getTablature().getCaret();
31
SongTrackCoords track = caret.getSongTrackCoords();
32
MeasureCoords measure = caret.getSongTrackCoords().getFirstMeasure();
33
if(track != null && measure != null){
34
caret.update(track.getTrack().getNumber(),measure.getMeasure().getStart(),caret.getSelectedString().getNumber());