1
package org.herac.tuxguitar.gui.editors;
3
import org.eclipse.swt.layout.FormAttachment;
4
import org.eclipse.swt.layout.FormData;
5
import org.eclipse.swt.widgets.Composite;
6
import org.herac.tuxguitar.gui.TuxGuitar;
7
import org.herac.tuxguitar.gui.editors.fretboard.FretBoard;
8
import org.herac.tuxguitar.gui.system.icons.IconLoader;
9
import org.herac.tuxguitar.gui.system.language.LanguageLoader;
11
public class FretBoardEditor implements IconLoader,LanguageLoader{
13
private FretBoard fretBoard;
14
private boolean visible;
16
public FretBoardEditor(){
17
TuxGuitar.instance().getIconManager().addLoader(this);
18
TuxGuitar.instance().getLanguageManager().addLoader(this);
21
private FretBoard getFretBoard(){
22
return this.fretBoard;
25
public void hideFretBoard(){
27
getFretBoard().setVisible(this.visible);
28
TuxGuitar.instance().updateShellFooter(0,0,0);
31
public void showFretBoard(){
33
getFretBoard().setVisible(this.visible);
34
TuxGuitar.instance().updateShellFooter(getFretBoard().getHeight(), 730,520);
37
public void showFretBoard(Composite parent) {
38
FormData data = new FormData();
39
data.left = new FormAttachment(0, 0);
40
data.right = new FormAttachment(100, 0);
41
data.top = new FormAttachment(0,0);
42
data.bottom = new FormAttachment(100,0);
44
this.fretBoard = new FretBoard(parent);
45
this.fretBoard.setLayoutData(data);
48
public void setScaleChanges(){
49
if(getFretBoard() != null){
50
getFretBoard().setChanges(true);
54
public void dispose(){
55
if(getFretBoard() != null && !getFretBoard().isDisposed()){
56
getFretBoard().dispose();
61
if(getFretBoard() != null && !getFretBoard().isDisposed() && !TuxGuitar.instance().isLocked()){
62
getFretBoard().redraw();
66
public void redrawPlayingMode(){
67
if(getFretBoard() != null && !getFretBoard().isDisposed() && !TuxGuitar.instance().isLocked()){
68
getFretBoard().redrawPlayingMode();
72
public boolean isVisible(){
73
return (getFretBoard() != null && !getFretBoard().isDisposed() && this.visible);
76
public void loadProperties(){
77
if(getFretBoard() != null && !getFretBoard().isDisposed()){
78
getFretBoard().loadProperties();
82
public void loadIcons(){
83
if(getFretBoard() != null && !getFretBoard().isDisposed()){
84
getFretBoard().loadIcons();