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.TuxGuitar;
13
import org.herac.tuxguitar.gui.actions.composition.ChangeTempoAction;
14
import org.herac.tuxguitar.gui.actions.composition.ChangeTimeSignatureAction;
15
import org.herac.tuxguitar.gui.actions.insert.RepeatAlternativeAction;
16
import org.herac.tuxguitar.gui.actions.insert.RepeatCloseAction;
17
import org.herac.tuxguitar.gui.actions.insert.RepeatOpenAction;
18
import org.herac.tuxguitar.gui.items.ToolItems;
23
* TODO To change the template for this generated type comment go to
24
* Window - Preferences - Java - Code Style - Code Templates
26
public class CompositionToolItems extends ToolItems{
27
public static final String NAME = "composition.items";
29
private ToolItem tempo;
30
private ToolItem timeSignature;
31
private ToolItem repeatOpen;
32
private ToolItem repeatClose;
33
private ToolItem repeatAlternative;
35
public CompositionToolItems(){
39
public void showItems(ToolBar toolBar){
40
this.tempo = new ToolItem(toolBar, SWT.PUSH);
41
this.tempo.addSelectionListener(TuxGuitar.instance().getAction(ChangeTempoAction.NAME));
43
this.timeSignature = new ToolItem(toolBar, SWT.PUSH);
44
this.timeSignature.addSelectionListener(TuxGuitar.instance().getAction(ChangeTimeSignatureAction.NAME));
46
new ToolItem(toolBar, SWT.SEPARATOR);
48
this.repeatOpen = new ToolItem(toolBar, SWT.PUSH);
49
this.repeatOpen.addSelectionListener(TuxGuitar.instance().getAction(RepeatOpenAction.NAME));
51
this.repeatClose = new ToolItem(toolBar, SWT.PUSH);
52
this.repeatClose.addSelectionListener(TuxGuitar.instance().getAction(RepeatCloseAction.NAME));
54
this.repeatAlternative = new ToolItem(toolBar, SWT.PUSH);
55
this.repeatAlternative.addSelectionListener(TuxGuitar.instance().getAction(RepeatAlternativeAction.NAME));
58
this.loadProperties();
61
public void loadProperties(){
62
this.tempo.setToolTipText(TuxGuitar.getProperty("composition.tempo"));
63
this.timeSignature.setToolTipText(TuxGuitar.getProperty("composition.timesignature"));
64
this.repeatOpen.setToolTipText(TuxGuitar.getProperty("repeat.open"));
65
this.repeatClose.setToolTipText(TuxGuitar.getProperty("repeat.close"));
66
this.repeatAlternative.setToolTipText(TuxGuitar.getProperty("repeat.alternative"));
69
public void loadIcons(){
70
this.tempo.setImage(TuxGuitar.instance().getIconManager().getCompositionTempo());
71
this.timeSignature.setImage(TuxGuitar.instance().getIconManager().getCompositionTimeSignature());
72
this.repeatOpen.setImage(TuxGuitar.instance().getIconManager().getCompositionRepeatOpen());
73
this.repeatClose.setImage(TuxGuitar.instance().getIconManager().getCompositionRepeatClose());
74
this.repeatAlternative.setImage(TuxGuitar.instance().getIconManager().getCompositionRepeatAlternative());
78
boolean running = TuxGuitar.instance().getPlayer().isRunning();
79
this.tempo.setEnabled( !running );
80
this.timeSignature.setEnabled( !running );
81
this.repeatOpen.setEnabled( !running );
82
this.repeatClose.setEnabled( !running );
83
this.repeatAlternative.setEnabled( !running );