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

« back to all changes in this revision

Viewing changes to src/org/herac/tuxguitar/gui/items/tool/ViewToolItems.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.view.ShowFretBoardAction;
15
 
import org.herac.tuxguitar.gui.actions.view.ShowMixerAction;
16
 
import org.herac.tuxguitar.gui.actions.view.ShowTransportAction;
17
 
import org.herac.tuxguitar.gui.items.ToolItems;
18
 
 
19
 
/**
20
 
 * @author julian
21
 
 *
22
 
 * TODO To change the template for this generated type comment go to
23
 
 * Window - Preferences - Java - Code Style - Code Templates
24
 
 */
25
 
public class ViewToolItems extends ToolItems{    
26
 
        public static final String NAME = "view.items";
27
 
        
28
 
    private ToolBar toolBar;   
29
 
    private ToolItem showFretBoard;
30
 
    private ToolItem showMixer;
31
 
    private ToolItem showTransport;
32
 
    
33
 
    public ViewToolItems(){
34
 
        super(NAME);
35
 
    }
36
 
   
37
 
    public void showItems(ToolBar toolBar){
38
 
        this.toolBar = toolBar;     
39
 
        
40
 
        //--FRETBOARD--
41
 
        this.showFretBoard = new ToolItem(toolBar, SWT.CHECK);    
42
 
        this.showFretBoard.setImage(SystemImages.FRETBOARD_IMAGE);
43
 
        this.showFretBoard.addSelectionListener(TuxGuitar.instance().getAction(ShowFretBoardAction.NAME));
44
 
        
45
 
        //--MIXER--
46
 
        this.showMixer = new ToolItem(toolBar, SWT.CHECK);    
47
 
        this.showMixer.setImage(SystemImages.MIXER_IMAGE);
48
 
        this.showMixer.addSelectionListener(TuxGuitar.instance().getAction(ShowMixerAction.NAME));
49
 
 
50
 
        //--TRANSPORT--
51
 
        this.showTransport = new ToolItem(toolBar, SWT.CHECK);    
52
 
        this.showTransport.setImage(SystemImages.TRANSPORT_IMAGE);
53
 
        this.showTransport.addSelectionListener(TuxGuitar.instance().getAction(ShowTransportAction.NAME));        
54
 
        
55
 
        this.loadProperties();
56
 
    }
57
 
 
58
 
    
59
 
    public void update(){
60
 
        this.showFretBoard.setSelection(TuxGuitar.instance().getFretBoardEditor().isVisible());
61
 
        this.showMixer.setSelection(!TuxGuitar.instance().getMixer().isDisposed());
62
 
        this.showTransport.setSelection(!TuxGuitar.instance().getTransport().isDisposed());
63
 
    }
64
 
    
65
 
    public void loadProperties(){            
66
 
        this.showFretBoard.setToolTipText(TuxGuitar.getProperty("show-fretboard"));  
67
 
        this.showMixer.setToolTipText(TuxGuitar.getProperty("show-mixer")); 
68
 
        this.showTransport.setToolTipText(TuxGuitar.getProperty("show-transport")); 
69
 
    }          
70
 
}