2
* Created on 02-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.items.tool;
9
import org.eclipse.swt.SWT;
10
import org.eclipse.swt.widgets.ToolBar;
11
import org.eclipse.swt.widgets.ToolItem;
12
import org.herac.tuxguitar.gui.SystemImages;
13
import org.herac.tuxguitar.gui.TuxGuitar;
14
import org.herac.tuxguitar.gui.actions.effects.ChangeAccentuatedNoteAction;
15
import org.herac.tuxguitar.gui.actions.effects.ChangeBendNoteAction;
16
import org.herac.tuxguitar.gui.actions.effects.ChangeDeadNoteAction;
17
import org.herac.tuxguitar.gui.actions.effects.ChangeFadeInAction;
18
import org.herac.tuxguitar.gui.actions.effects.ChangeGhostNoteAction;
19
import org.herac.tuxguitar.gui.actions.effects.ChangeGraceNoteAction;
20
import org.herac.tuxguitar.gui.actions.effects.ChangeHammerNoteAction;
21
import org.herac.tuxguitar.gui.actions.effects.ChangeHarmonicNoteAction;
22
import org.herac.tuxguitar.gui.actions.effects.ChangeHeavyAccentuatedNoteAction;
23
import org.herac.tuxguitar.gui.actions.effects.ChangePalmMuteAction;
24
import org.herac.tuxguitar.gui.actions.effects.ChangePoppingAction;
25
import org.herac.tuxguitar.gui.actions.effects.ChangeSlappingAction;
26
import org.herac.tuxguitar.gui.actions.effects.ChangeSlideNoteAction;
27
import org.herac.tuxguitar.gui.actions.effects.ChangeStaccatoAction;
28
import org.herac.tuxguitar.gui.actions.effects.ChangeTappingAction;
29
import org.herac.tuxguitar.gui.actions.effects.ChangeTremoloBarAction;
30
import org.herac.tuxguitar.gui.actions.effects.ChangeTremoloPickingAction;
31
import org.herac.tuxguitar.gui.actions.effects.ChangeTrillNoteAction;
32
import org.herac.tuxguitar.gui.actions.effects.ChangeVibratoNoteAction;
33
import org.herac.tuxguitar.gui.items.ToolItems;
34
import org.herac.tuxguitar.song.models.Note;
35
import org.herac.tuxguitar.song.models.NoteEffect;
39
* TODO To change the template for this generated type comment go to
40
* Window - Preferences - Java - Code Style - Code Templates
42
public class NoteEffectToolItems extends ToolItems{
43
public static final String NAME = "effect.items";
45
private ToolBar toolBar;
47
private ToolItem deadNote;
48
private ToolItem ghostNote;
49
private ToolItem accentuatedNote;
50
private ToolItem heavyAccentuatedNote;
51
private ToolItem harmonicNote;
52
private ToolItem graceNote;
54
private ToolItem vibrato;
55
private ToolItem bend;
56
private ToolItem tremoloBar;
57
private ToolItem slide;
58
private ToolItem hammer;
60
private ToolItem trill;
61
private ToolItem tremoloPicking;
62
private ToolItem palmMute;
64
private ToolItem staccato;
65
private ToolItem tapping;
66
private ToolItem slapping;
67
private ToolItem popping;
69
private ToolItem fadeIn;
71
public NoteEffectToolItems(){
75
public void showItems(ToolBar toolBar){
76
this.toolBar = toolBar;
78
this.deadNote = new ToolItem(toolBar, SWT.CHECK);
79
this.deadNote.setImage(SystemImages.EFFECT_DEAD);
80
this.deadNote.addSelectionListener(TuxGuitar.instance().getAction(ChangeDeadNoteAction.NAME));
83
this.ghostNote = new ToolItem(toolBar, SWT.CHECK);
84
this.ghostNote.setImage(SystemImages.EFFECT_GHOST);
85
this.ghostNote.addSelectionListener(TuxGuitar.instance().getAction(ChangeGhostNoteAction.NAME));
87
//--ACCENTUATED NOTE--
88
this.accentuatedNote = new ToolItem(toolBar, SWT.CHECK);
89
this.accentuatedNote.setImage(SystemImages.EFFECT_ACCENTUATED);
90
this.accentuatedNote.addSelectionListener(TuxGuitar.instance().getAction(ChangeAccentuatedNoteAction.NAME));
92
//--HEAVY ACCENTUATED NOTE--
93
this.heavyAccentuatedNote = new ToolItem(toolBar, SWT.CHECK);
94
this.heavyAccentuatedNote.setImage(SystemImages.EFFECT_HEAVY_ACCENTUATED);
95
this.heavyAccentuatedNote.addSelectionListener(TuxGuitar.instance().getAction(ChangeHeavyAccentuatedNoteAction.NAME));
98
this.harmonicNote = new ToolItem(toolBar, SWT.CHECK);
99
this.harmonicNote.setImage(SystemImages.EFFECT_HARMONIC);
100
this.harmonicNote.addSelectionListener(TuxGuitar.instance().getAction(ChangeHarmonicNoteAction.NAME));
103
this.graceNote = new ToolItem(toolBar, SWT.CHECK);
104
this.graceNote.setImage(SystemImages.EFFECT_GRACE);
105
this.graceNote.addSelectionListener(TuxGuitar.instance().getAction(ChangeGraceNoteAction.NAME));
108
new ToolItem(toolBar, SWT.SEPARATOR);
111
this.vibrato = new ToolItem(toolBar, SWT.CHECK);
112
this.vibrato.setImage(SystemImages.EFFECT_VIBRATO);
113
this.vibrato.addSelectionListener(TuxGuitar.instance().getAction(ChangeVibratoNoteAction.NAME));
116
this.bend = new ToolItem(toolBar, SWT.CHECK);
117
this.bend.setImage(SystemImages.EFFECT_BEND);
118
this.bend.addSelectionListener(TuxGuitar.instance().getAction(ChangeBendNoteAction.NAME));
121
this.tremoloBar = new ToolItem(toolBar, SWT.CHECK);
122
this.tremoloBar.setImage(SystemImages.EFFECT_TREMOLO_BAR);
123
this.tremoloBar.addSelectionListener(TuxGuitar.instance().getAction(ChangeTremoloBarAction.NAME));
126
this.slide = new ToolItem(toolBar, SWT.CHECK);
127
this.slide.setImage(SystemImages.EFFECT_SLIDE);
128
this.slide.addSelectionListener(TuxGuitar.instance().getAction(ChangeSlideNoteAction.NAME));
131
this.hammer = new ToolItem(toolBar, SWT.CHECK);
132
this.hammer.setImage(SystemImages.EFFECT_HAMMER);
133
this.hammer.addSelectionListener(TuxGuitar.instance().getAction(ChangeHammerNoteAction.NAME));
137
new ToolItem(toolBar, SWT.SEPARATOR);
140
this.trill = new ToolItem(toolBar, SWT.CHECK);
141
this.trill.setImage(SystemImages.EFFECT_TRILL);
142
this.trill.addSelectionListener(TuxGuitar.instance().getAction(ChangeTrillNoteAction.NAME));
144
//--TREMOLO PICKING--
145
this.tremoloPicking = new ToolItem(toolBar, SWT.CHECK);
146
this.tremoloPicking.setImage(SystemImages.EFFECT_TREMOLO_PICKING);
147
this.tremoloPicking.addSelectionListener(TuxGuitar.instance().getAction(ChangeTremoloPickingAction.NAME));
152
this.palmMute = new ToolItem(toolBar, SWT.CHECK);
153
this.palmMute.setImage(SystemImages.EFFECT_PALM_MUTE);
154
this.palmMute.addSelectionListener(TuxGuitar.instance().getAction(ChangePalmMuteAction.NAME));
157
this.staccato = new ToolItem(toolBar, SWT.CHECK);
158
this.staccato.setImage(SystemImages.EFFECT_STACCATO);
159
this.staccato.addSelectionListener(TuxGuitar.instance().getAction(ChangeStaccatoAction.NAME));
163
new ToolItem(toolBar, SWT.SEPARATOR);
166
this.tapping = new ToolItem(toolBar, SWT.CHECK);
167
this.tapping.setImage(SystemImages.EFFECT_TAPPING);
168
this.tapping.addSelectionListener(TuxGuitar.instance().getAction(ChangeTappingAction.NAME));
171
this.slapping = new ToolItem(toolBar, SWT.CHECK);
172
this.slapping.setImage(SystemImages.EFFECT_SLAPPING);
173
this.slapping.addSelectionListener(TuxGuitar.instance().getAction(ChangeSlappingAction.NAME));
176
this.popping = new ToolItem(toolBar, SWT.CHECK);
177
this.popping.setImage(SystemImages.EFFECT_POPPING);
178
this.popping.addSelectionListener(TuxGuitar.instance().getAction(ChangePoppingAction.NAME));
181
new ToolItem(toolBar, SWT.SEPARATOR);
184
this.fadeIn = new ToolItem(toolBar, SWT.CHECK);
185
this.fadeIn.setImage(SystemImages.EFFECT_FADE_IN);
186
this.fadeIn.addSelectionListener(TuxGuitar.instance().getAction(ChangeFadeInAction.NAME));
188
this.loadProperties();
192
public void update(){
193
Note note = TuxGuitar.instance().getTablatureEditor().getTablature().getCaret().getSelectedNote();
194
NoteEffect effect = ((note != null)?note.getEffect():new NoteEffect());
196
this.vibrato.setSelection(effect.isVibrato());
197
this.bend.setSelection(effect.isBend());
198
this.tremoloBar.setSelection(effect.isTremoloBar());
199
this.deadNote.setSelection(effect.isDeadNote());
200
this.slide.setSelection(effect.isSlide());
201
this.hammer.setSelection(effect.isHammer());
202
this.ghostNote.setSelection(effect.isGhostNote());
203
this.accentuatedNote.setSelection(effect.isAccentuatedNote());
204
this.heavyAccentuatedNote.setSelection(effect.isHeavyAccentuatedNote());
205
this.harmonicNote.setSelection(effect.isHarmonic());
206
this.graceNote.setSelection(effect.isGrace());
207
this.trill.setSelection(effect.isTrill());
208
this.tremoloPicking.setSelection(effect.isTremoloPicking());
209
this.palmMute.setSelection(effect.isPalmMute());
210
this.staccato.setSelection(effect.isStaccato());
211
this.tapping.setSelection(effect.isTapping());
212
this.slapping.setSelection(effect.isSlapping());
213
this.popping.setSelection(effect.isPopping());
214
this.fadeIn.setSelection(effect.isFadeIn());
217
public void loadProperties(){
218
this.vibrato.setToolTipText(TuxGuitar.getProperty("effects.vibrato"));
219
this.bend.setToolTipText(TuxGuitar.getProperty("effects.bend"));
220
this.popping.setToolTipText(TuxGuitar.getProperty("effects.popping"));
221
this.deadNote.setToolTipText(TuxGuitar.getProperty("effects.deadnote"));
222
this.slide.setToolTipText(TuxGuitar.getProperty("effects.slide"));
223
this.hammer.setToolTipText(TuxGuitar.getProperty("effects.hammer"));
224
this.ghostNote.setToolTipText(TuxGuitar.getProperty("effects.ghostnote"));
225
this.accentuatedNote.setToolTipText(TuxGuitar.getProperty("effects.accentuatednote"));
226
this.heavyAccentuatedNote.setToolTipText(TuxGuitar.getProperty("effects.heavyaccentuatednote"));
227
this.harmonicNote.setToolTipText(TuxGuitar.getProperty("effects.harmonic"));
228
this.graceNote.setToolTipText(TuxGuitar.getProperty("effects.grace"));
229
this.trill.setToolTipText(TuxGuitar.getProperty("effects.trill"));
230
this.tremoloPicking.setToolTipText(TuxGuitar.getProperty("effects.tremolo-picking"));
231
this.palmMute.setToolTipText(TuxGuitar.getProperty("effects.palm-mute"));
232
this.staccato.setToolTipText(TuxGuitar.getProperty("effects.staccato"));
233
this.tapping.setToolTipText(TuxGuitar.getProperty("effects.tapping"));
234
this.slapping.setToolTipText(TuxGuitar.getProperty("effects.slapping"));
235
this.popping.setToolTipText(TuxGuitar.getProperty("effects.popping"));
236
this.fadeIn.setToolTipText(TuxGuitar.getProperty("effects.fade-in"));