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.menu;
9
import org.eclipse.swt.SWT;
10
import org.eclipse.swt.widgets.Menu;
11
import org.eclipse.swt.widgets.MenuItem;
12
import org.eclipse.swt.widgets.Shell;
13
import org.herac.tuxguitar.gui.SystemImages;
14
import org.herac.tuxguitar.gui.TuxGuitar;
15
import org.herac.tuxguitar.gui.actions.composition.ChangeClefAction;
16
import org.herac.tuxguitar.gui.actions.composition.ChangeInfoAction;
17
import org.herac.tuxguitar.gui.actions.composition.ChangeKeySignatureAction;
18
import org.herac.tuxguitar.gui.actions.composition.ChangeTempoAction;
19
import org.herac.tuxguitar.gui.actions.composition.ChangeTimeSignatureAction;
20
import org.herac.tuxguitar.gui.actions.composition.ChangeTripletFeelAction;
21
import org.herac.tuxguitar.gui.actions.insert.CloseRepeatAction;
22
import org.herac.tuxguitar.gui.actions.insert.OpenRepeatAction;
23
import org.herac.tuxguitar.gui.editors.TablatureEditor;
24
import org.herac.tuxguitar.gui.items.MenuItems;
29
* TODO To change the template for this generated type comment go to
30
* Window - Preferences - Java - Code Style - Code Templates
32
public class CompositionMenuItem implements MenuItems{
33
private TablatureEditor tablatureEditor;
34
private MenuItem compositionMenuItem;
36
private MenuItem timeSignature;
37
private MenuItem tempo;
38
private MenuItem clef;
39
private MenuItem keySignature;
40
private MenuItem openRepeat;
41
private MenuItem closeRepeat;
42
private MenuItem tripletFeel;
44
private MenuItem properties;
46
public CompositionMenuItem(Shell shell,Menu parent, int style,TablatureEditor tablatureEditor) {
47
this.compositionMenuItem = new MenuItem(parent, style);
48
this.tablatureEditor = tablatureEditor;
49
this.menu = new Menu(shell, SWT.DROP_DOWN);
52
public void showItems(){
54
this.timeSignature = new MenuItem(this.menu, SWT.PUSH);
55
this.timeSignature.setImage(SystemImages.TIME_SIGNATURE_IMAGE);
56
this.timeSignature.addSelectionListener(TuxGuitar.instance().getAction(ChangeTimeSignatureAction.NAME));
58
this.tempo = new MenuItem(this.menu, SWT.PUSH);
59
this.tempo.setImage(SystemImages.TEMPO_ICON_IMAGE);
60
this.tempo.addSelectionListener(TuxGuitar.instance().getAction(ChangeTempoAction.NAME));
62
this.clef = new MenuItem(this.menu, SWT.PUSH);
63
this.clef.addSelectionListener(TuxGuitar.instance().getAction(ChangeClefAction.NAME));
65
this.keySignature = new MenuItem(this.menu, SWT.PUSH);
66
this.keySignature.addSelectionListener(TuxGuitar.instance().getAction(ChangeKeySignatureAction.NAME));
68
this.tripletFeel = new MenuItem(this.menu, SWT.PUSH);
69
this.tripletFeel.addSelectionListener(TuxGuitar.instance().getAction(ChangeTripletFeelAction.NAME));
71
new MenuItem(this.menu, SWT.SEPARATOR);
73
this.openRepeat = new MenuItem(this.menu, SWT.PUSH);
74
this.openRepeat.setImage(SystemImages.OPEN_REPEAT_IMAGE);
75
this.openRepeat.addSelectionListener(TuxGuitar.instance().getAction(OpenRepeatAction.NAME));
77
this.closeRepeat = new MenuItem(this.menu, SWT.PUSH);
78
this.closeRepeat.setImage(SystemImages.CLOSE_REPEAT_IMAGE);
79
this.closeRepeat.addSelectionListener(TuxGuitar.instance().getAction(CloseRepeatAction.NAME));
81
new MenuItem(this.menu, SWT.SEPARATOR);
83
this.properties = new MenuItem(this.menu, SWT.PUSH);
84
this.properties.setImage(SystemImages.SONG_PROPERTIES);
85
this.properties.addSelectionListener(TuxGuitar.instance().getAction(ChangeInfoAction.NAME));
87
this.compositionMenuItem.setMenu(menu);
89
this.loadProperties();
97
public void loadProperties(){
98
this.compositionMenuItem.setText(TuxGuitar.getProperty("composition"));
99
this.timeSignature.setText(TuxGuitar.getProperty("composition.timesignature"));
100
this.tempo.setText(TuxGuitar.getProperty("composition.tempo"));
101
this.clef.setText(TuxGuitar.getProperty("composition.clef"));
102
this.keySignature.setText(TuxGuitar.getProperty("composition.keysignature"));
103
this.tripletFeel.setText(TuxGuitar.getProperty("composition.tripletfeel"));
104
this.openRepeat.setText(TuxGuitar.getProperty("repeat.open"));
105
this.closeRepeat.setText(TuxGuitar.getProperty("repeat.close"));
106
this.properties.setText(TuxGuitar.getProperty("composition.properties"));