~ubuntu-branches/ubuntu/oneiric/tuxguitar/oneiric

« back to all changes in this revision

Viewing changes to src/org/herac/tuxguitar/gui/items/tool/CompositionToolItems.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2008-06-19 00:30:30 UTC
  • mto: (5.1.2 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20080619003030-h719szrhsngou7c6
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Created on 02-dic-2005
3
 
 *
4
 
 * TODO To change the template for this generated file go to
5
 
 * Window - Preferences - Java - Code Style - Code Templates
6
 
 */
7
 
package org.herac.tuxguitar.gui.items.tool;
8
 
 
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.composition.ChangeTempoAction;
15
 
import org.herac.tuxguitar.gui.actions.composition.ChangeTimeSignatureAction;
16
 
import org.herac.tuxguitar.gui.actions.insert.CloseRepeatAction;
17
 
import org.herac.tuxguitar.gui.actions.insert.OpenRepeatAction;
18
 
import org.herac.tuxguitar.gui.items.ToolItems;
19
 
 
20
 
/**
21
 
 * @author julian
22
 
 *
23
 
 * TODO To change the template for this generated type comment go to
24
 
 * Window - Preferences - Java - Code Style - Code Templates
25
 
 */
26
 
public class CompositionToolItems extends ToolItems{
27
 
    public static final String NAME = "composition.items";
28
 
 
29
 
    private ToolBar toolBar;   
30
 
    private ToolItem tempo;
31
 
    private ToolItem timeSignature;
32
 
    private ToolItem openRepeat;    
33
 
    private ToolItem closeRepeat;
34
 
    
35
 
    public CompositionToolItems(){    
36
 
        super(NAME);
37
 
    }
38
 
   
39
 
    public void showItems(ToolBar toolBar){
40
 
        this.toolBar = toolBar;
41
 
        
42
 
        this.tempo = new ToolItem(toolBar, SWT.PUSH);        
43
 
        this.tempo.setImage(SystemImages.TEMPO_ICON_IMAGE);
44
 
        this.tempo.addSelectionListener(TuxGuitar.instance().getAction(ChangeTempoAction.NAME));
45
 
        
46
 
        this.timeSignature = new ToolItem(toolBar, SWT.PUSH);        
47
 
        this.timeSignature.setImage(SystemImages.TIME_SIGNATURE_IMAGE);
48
 
        this.timeSignature.addSelectionListener(TuxGuitar.instance().getAction(ChangeTimeSignatureAction.NAME));
49
 
        
50
 
        new ToolItem(toolBar, SWT.SEPARATOR);
51
 
        
52
 
        this.openRepeat = new ToolItem(toolBar, SWT.PUSH);
53
 
        this.openRepeat.setImage(SystemImages.OPEN_REPEAT_IMAGE);
54
 
        this.openRepeat.addSelectionListener(TuxGuitar.instance().getAction(OpenRepeatAction.NAME));            
55
 
        
56
 
        this.closeRepeat = new ToolItem(toolBar, SWT.PUSH);
57
 
        this.closeRepeat.setImage(SystemImages.CLOSE_REPEAT_IMAGE);
58
 
        this.closeRepeat.addSelectionListener(TuxGuitar.instance().getAction(CloseRepeatAction.NAME));        
59
 
        
60
 
        this.loadProperties();
61
 
    }
62
 
 
63
 
    public void loadProperties(){
64
 
        this.tempo.setToolTipText(TuxGuitar.getProperty("composition.tempo"));
65
 
        this.timeSignature.setToolTipText(TuxGuitar.getProperty("composition.timesignature"));
66
 
        this.openRepeat.setToolTipText(TuxGuitar.getProperty("repeat.open"));
67
 
        this.closeRepeat.setToolTipText(TuxGuitar.getProperty("repeat.close"));          
68
 
    }
69
 
    
70
 
    public void update(){
71
 
    }
72
 
}
73