~ubuntu-branches/ubuntu/lucid/tuxguitar/lucid-updates

« back to all changes in this revision

Viewing changes to TuxGuitar-tuner/src/org/herac/tuxguitar/gui/tools/custom/tuner/TGTuningString.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2009-04-25 19:49:27 UTC
  • mfrom: (1.1.3 upstream) (2.1.7 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090425194927-pblqed0zxp0pmyeq
Tags: 1.1-1
* New Upstream Release (Closes: #489859) (LP: #366476)
* Merged patch : tuxguitar_1.0.dak-1ubuntu1.patch
* debian/README.txt
  - suggests to install tuxguitar-jsa

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * 
 
3
 */
 
4
package org.herac.tuxguitar.gui.tools.custom.tuner;
 
5
 
 
6
import org.eclipse.swt.SWT;
 
7
import org.eclipse.swt.events.SelectionAdapter;
 
8
import org.eclipse.swt.events.SelectionEvent;
 
9
import org.eclipse.swt.widgets.Button;
 
10
import org.eclipse.swt.widgets.Composite;
 
11
 
 
12
/**
 
13
 * @author Nikola Kolarovic <johnny47ns@yahoo.com>
 
14
 *
 
15
 */
 
16
public class TGTuningString {
 
17
 
 
18
        private int string;
 
19
        private Button stringButton = null;
 
20
        private TGTunerListener listener = null;
 
21
        
 
22
        
 
23
        
 
24
        TGTuningString(int string, Composite parent, TGTunerListener listener) {
 
25
                this.string = string;
 
26
                this.listener = listener;
 
27
                
 
28
                this.stringButton = new Button(parent,SWT.TOGGLE);
 
29
                this.stringButton.setText("--------- "+TGTunerRoughWidget.TONESSTRING[string%12]+(int)Math.floor(string/12)+" ---------");
 
30
        }
 
31
 
 
32
        
 
33
        
 
34
        void addListener() {
 
35
                this.stringButton.addSelectionListener(new SelectionAdapter() {
 
36
                        public void widgetSelected(SelectionEvent arg0) {
 
37
                                        TGTuningString.this.stringButton.setSelection(true);
 
38
                                        TGTuningString.this.listener.fireCurrentString(TGTuningString.this.string);
 
39
                        }
 
40
                        
 
41
                });
 
42
        }
 
43
        
 
44
        public int getString() {
 
45
                return this.string;
 
46
        }
 
47
        
 
48
        public Button getStringButton() {
 
49
                return this.stringButton;
 
50
        }
 
51
        
 
52
}