2
* Created on 27-ene-2006
4
* TODO To change the template for this generated file go to
5
* Window - Preferences - Java - Code Style - Code Templates
7
package org.herac.tuxguitar.gui.system.config;
9
import java.io.InputStream;
10
import java.util.Properties;
12
import org.herac.tuxguitar.gui.editors.tab.Tablature;
13
import org.herac.tuxguitar.gui.editors.tab.edit.EditorKit;
14
import org.herac.tuxguitar.gui.util.TuxGuitarFileUtils;
19
* TODO To change the template for this generated type comment go to
20
* Window - Preferences - Java - Code Style - Code Templates
22
public class ConfigDefaults{
23
private Properties properties;
25
public ConfigDefaults(){
26
this.properties = new Properties();
28
this.loadDefaultFile();
31
public void loadDefaultFile() {
33
InputStream is = TuxGuitarFileUtils.getResourceAsStream("defaults.properties");
35
this.properties.load(is);
37
} catch (Exception e) {
42
private void loadDefaults(){
43
this.loadProperty(ConfigKeys.WINDOW_TITLE,"${appname} - ${filename}");
44
this.loadProperty(ConfigKeys.SHOW_SPLASH,true);
45
this.loadProperty(ConfigKeys.MAXIMIZED,false);
46
this.loadProperty(ConfigKeys.WIDTH,800);
47
this.loadProperty(ConfigKeys.HEIGHT,600);
48
this.loadProperty(ConfigKeys.SHOW_MIXER,false);
49
this.loadProperty(ConfigKeys.SHOW_TRANSPORT,false);
50
this.loadProperty(ConfigKeys.SHOW_FRETBOARD,false);
51
this.loadProperty(ConfigKeys.SHOW_PIANO,false);
52
this.loadProperty(ConfigKeys.LAYOUT_MODE,2);
53
this.loadProperty(ConfigKeys.SHOW_MULTITRACK,true);
54
this.loadProperty(ConfigKeys.SHOW_SCORE,true);
55
this.loadProperty(ConfigKeys.SHOW_TABLATURE,true);
56
this.loadProperty(ConfigKeys.EDITOR_MOUSE_MODE,EditorKit.MOUSE_MODE_EDITION);
57
this.loadProperty(ConfigKeys.EDITOR_NATURAL_KEY_MODE,true);
58
this.loadProperty(ConfigKeys.FONT_DEFAULT,"Sans,6,2");
59
this.loadProperty(ConfigKeys.FONT_NOTE,"Sans,7,1");
60
this.loadProperty(ConfigKeys.FONT_TIME_SIGNATURE,"Sans,13,3");
61
this.loadProperty(ConfigKeys.FONT_PRINTER_DEFAULT,"Sans,6,2");
62
this.loadProperty(ConfigKeys.FONT_PRINTER_NOTE,"Sans,6,0");
63
this.loadProperty(ConfigKeys.FONT_PRINTER_TIME_SIGNATURE,"Sans,12,3");
64
this.loadProperty(ConfigKeys.FONT_LYRIC,"Sans,7,2");
65
this.loadProperty(ConfigKeys.FONT_GRACE,"Sans,6,0");
66
this.loadProperty(ConfigKeys.FONT_ABOUT_DIALOG_TITLE,"Serif,36,3");
67
this.loadProperty(ConfigKeys.COLOR_LINE,"150,150,150");
68
this.loadProperty(ConfigKeys.COLOR_SCORE_NOTE,"0,0,0");
69
this.loadProperty(ConfigKeys.COLOR_TAB_NOTE,"0,0,0");
70
this.loadProperty(ConfigKeys.COLOR_PLAY_NOTE,"255,0,0");
71
this.loadProperty(ConfigKeys.MAX_HISTORY_FILES,10);
72
this.loadProperty(ConfigKeys.AUTO_SPACING_ENABLE,true);
73
this.loadProperty(ConfigKeys.MIN_SCORE_TABLATURE_SPAN,20);
74
this.loadProperty(ConfigKeys.SCORE_LINE_SPAN,8);
75
this.loadProperty(ConfigKeys.TAB_LINE_SPAN,10);
76
this.loadProperty(ConfigKeys.FIRST_TRACK_SPAN,25);
77
this.loadProperty(ConfigKeys.TRACK_SPAN,10);
78
this.loadProperty(ConfigKeys.FRETBOARD_STRING_SPAN,20);
79
this.loadProperty(ConfigKeys.LANGUAGE,"");
80
this.loadProperty(ConfigKeys.SOUNDBANK_CUSTOM,false);
81
this.loadProperty(ConfigKeys.SYSTEM_PLAYER,"org.herac.tuxguitar.player.impl.MidiPlayerImpl");
82
this.loadProperty(ConfigKeys.TABLATURE_FLAGS,Tablature.ALLOW_PLAY_CACHE);
85
public Properties getProperties() {
86
return this.properties;
89
private void loadProperty(String key,String value){
90
this.properties.setProperty(key,value);
93
private void loadProperty(String key,int value){
94
this.properties.setProperty(key,Integer.toString(value));
97
private void loadProperty(String key,boolean value){
98
this.properties.setProperty(key,Boolean.toString(value));