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.note;
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.MeasureComponent;
14
import org.herac.tuxguitar.gui.editors.tab.NoteCoords;
15
import org.herac.tuxguitar.gui.undo.undoables.measure.UndoableMeasureGeneric;
20
* TODO To change the template for this generated type comment go to
21
* Window - Preferences - Java - Code Style - Code Templates
23
public class ChangeTiedNoteAction extends Action{
24
public static final String NAME = "action.note.general.tied";
26
public ChangeTiedNoteAction(TablatureEditor tablatureEditor) {
27
super(NAME,true,tablatureEditor);
30
public boolean doAction(TypedEvent e) {
31
Caret caret = getEditor().getTablature().getCaret();
32
MeasureComponent component = caret.getMeasureCoords().getComponent(caret.getPosition(),caret.getSelectedString().getNumber());
33
if(component instanceof NoteCoords){
34
//comienza el undoable
35
UndoableMeasureGeneric undoable = UndoableMeasureGeneric.startUndo();
37
NoteCoords note = (NoteCoords)component;
38
getSongManager().getMeasureManager().changeTieNote(note.getNote());
41
getEditor().getUndoManager().addEdit(undoable.endUndo());
48
protected void updateTablature() {
49
fireUpdate(getEditor().getTablature().getCaret().getMeasureCoords().getMeasure().getNumber());