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

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/gui/editors/TablatureEditor.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2008-06-19 00:30:30 UTC
  • mfrom: (1.1.1 upstream) (2.1.3 hardy)
  • Revision ID: james.westby@ubuntu.com-20080619003030-agens2gvd5m4dacu
New upstream release (Closes: #481728) also (LP: #176979, #212207)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Created on 30-nov-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.editors;
 
8
 
 
9
import org.eclipse.swt.SWT;
 
10
import org.eclipse.swt.widgets.Composite;
 
11
import org.eclipse.swt.widgets.Menu;
 
12
import org.herac.tuxguitar.gui.TuxGuitar;
 
13
import org.herac.tuxguitar.gui.clipboard.ClipBoard;
 
14
import org.herac.tuxguitar.gui.editors.tab.Tablature;
 
15
 
 
16
/**
 
17
 * @author julian
 
18
 * 
 
19
 * TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
 
20
 */
 
21
public class TablatureEditor {
 
22
        private Tablature tablature;
 
23
        private ClipBoard clipBoard;
 
24
        
 
25
        public TablatureEditor() {
 
26
                this.clipBoard = new ClipBoard();
 
27
        }
 
28
        
 
29
        public void showTablature(Composite parent) {
 
30
                this.tablature = new Tablature(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.DOUBLE_BUFFERED);
 
31
                this.tablature.initGUI();
 
32
                this.tablature.setSongManager(TuxGuitar.instance().getSongManager());
 
33
                this.tablature.reloadViewLayout();
 
34
                this.tablature.initDefaults();
 
35
                this.tablature.updateTablature();
 
36
                this.tablature.initCaret();
 
37
                this.tablature.setFocus();
 
38
                this.initKeyActions();
 
39
                this.initMenu();
 
40
        }
 
41
        
 
42
        private void initKeyActions(){
 
43
                TuxGuitar.instance().getkeyBindingManager().appendListenersTo(this.tablature);
 
44
        }
 
45
        
 
46
        private void initMenu(){
 
47
                Menu menu = TuxGuitar.instance().getItemManager().getPopupMenu();
 
48
                menu.addMenuListener(getTablature().getEditorKit());
 
49
                this.tablature.setMenu(menu);
 
50
        }
 
51
        
 
52
        public void reloadConfig(){
 
53
                getTablature().reloadStyles();
 
54
        }
 
55
        
 
56
        public Tablature getTablature() {
 
57
                return this.tablature;
 
58
        }
 
59
        
 
60
        public ClipBoard getClipBoard(){
 
61
                return this.clipBoard;
 
62
        }
 
63
}
 
 
b'\\ No newline at end of file'