View Javadoc

1   package com.melloware.jukes.gui.tool;
2   
3   
4   import org.apache.log4j.Level;
5   
6   import com.l2fprod.common.beans.BaseBeanInfo;
7   import com.l2fprod.common.beans.ExtendedPropertyDescriptor;
8   import com.l2fprod.common.beans.editor.ComboBoxPropertyEditor;
9   import com.l2fprod.common.beans.editor.DirectoryPropertyEditor;
10  import com.l2fprod.common.beans.editor.FilePropertyEditor;
11  import com.l2fprod.common.beans.editor.IntegerPropertyEditor;
12  import com.melloware.jukes.file.filter.PlaylistFilter;
13  import com.melloware.jukes.gui.view.component.SpectrumTimeAnalyzer;
14  
15  /**
16   * Static class used to represent settings in property sheet.
17   * <p>
18   * Copyright (c) 1999-2007 Melloware, Inc. <http://www.melloware.com>
19   * @author Emil A. Lefkof III <info@melloware.com>
20   * @version 4.0
21   */
22  public class SettingsBeanInfo
23      extends BaseBeanInfo {
24  	
25  	private static final String[] LOG_LEVELS = new String[] { Level.DEBUG.toString(), Level.INFO.toString(), Level.WARN.toString(), Level.ERROR.toString() };
26     private static final String[] ANALYZER_MODES = new String[] { SpectrumTimeAnalyzer.OFF, SpectrumTimeAnalyzer.ANALYZER, SpectrumTimeAnalyzer.SCOPE };
27  	private static final String DATABASE = "Database";
28  	private static final String DISPLAY = "Display";
29  	private static final String FILES = "Files and Directories";
30  	private static final String PLAYER = "Player";
31  	
32  
33      public SettingsBeanInfo() {
34          super(Settings.class);
35          ExtendedPropertyDescriptor descriptor = null;
36          
37          descriptor = addProperty("databaseLocation");
38          descriptor.setCategory(DATABASE);
39          descriptor.setDisplayName("Local Database Location");
40          descriptor.setShortDescription("Location of the local database.");
41          descriptor.setPropertyEditorClass(DirectoryPropertyEditor.class);
42          
43          descriptor = addProperty("remoteDatabaseURL");
44          descriptor.setCategory(DATABASE);
45          descriptor.setDisplayName("Remote Database URL");
46          descriptor.setShortDescription("If connecting to a remote database (on another machine), the URL to connect to.");
47  
48          descriptor = addProperty("displayFormatDisc");
49          descriptor.setCategory(DISPLAY);
50          descriptor.setDisplayName("Disc Display Format");
51          descriptor.setShortDescription("How the disc will be rendered. %b for bitrate, %y for year, %r for running time, and %d for disc");
52  
53          descriptor = addProperty("displayFormatTrack");
54          descriptor.setCategory(DISPLAY);
55          descriptor.setDisplayName("Track Display Format");
56          descriptor.setShortDescription("How the track will be rendered. %b for bitrate, %n for track number, %r for duration, and %t for track");
57  
58          descriptor = addProperty("newFileInDays");
59          descriptor.setCategory(DISPLAY);
60          descriptor.setDisplayName("New File Marker (in days)");
61          descriptor.setShortDescription("Number of days a disc is considered 'New' or 'Recently Added'.");
62          
63          descriptor = addProperty("catalogScrollUnits");
64          descriptor.setCategory(DISPLAY);
65          descriptor.setDisplayName("Catalog Scroll Units");
66          descriptor.setShortDescription("Controls the mousewheel scroll speed in the catalog.");
67          
68          descriptor = addProperty("auditInfo");
69          descriptor.setCategory(DISPLAY);
70          descriptor.setDisplayName("Audit Information");
71          descriptor.setShortDescription("Whether to display the audit information or not.");
72          
73          descriptor = addProperty("coverSizeSmall");
74          descriptor.setCategory(DISPLAY);
75          descriptor.setDisplayName("Cover Size Small (in pixels)");
76          descriptor.setShortDescription("Size of the smaller cover images in pixels.");
77          
78          descriptor = addProperty("coverSizeLarge");
79          descriptor.setCategory(DISPLAY);
80          descriptor.setDisplayName("Cover Size Large (in pixels)");
81          descriptor.setShortDescription("Size of the larger cover images in pixels.");
82          
83          descriptor = addProperty("rowColorEven");
84          descriptor.setCategory(DISPLAY);
85          descriptor.setDisplayName("Row Color Even");
86          descriptor.setShortDescription("Alternating row color in tables.");
87          
88          descriptor = addProperty("rowColorOdd");
89          descriptor.setCategory(DISPLAY);
90          descriptor.setDisplayName("Row Color Odd");
91          descriptor.setShortDescription("Alternating row color in tables.");
92          
93          descriptor = addProperty("startInDirectory");
94          descriptor.setCategory(FILES);
95          descriptor.setDisplayName("Music Directory");
96          descriptor.setShortDescription("Directory that music is located.");
97          descriptor.setPropertyEditorClass(DirectoryPropertyEditor.class);
98  
99          descriptor = addProperty("fileFormatMusic");
100         descriptor.setCategory(FILES);
101         descriptor.setDisplayName("File Format Music");
102         descriptor.setShortDescription("Format of music files when renamed. %n for track, %t for title, %a for artist, %d for disc");
103         
104         descriptor = addProperty("fileFormatImage");
105         descriptor.setCategory(FILES);
106         descriptor.setDisplayName("File Format Image");
107         descriptor.setShortDescription("Format of image files when saved. %a for artist, %d for disc or hard code a name like folder.jpg");
108         
109         descriptor = addProperty("playlistType");
110         descriptor.setCategory(FILES);
111         descriptor.setDisplayName("Default Playlist Type");
112         descriptor.setShortDescription("Default playlist type either XSPF or M3U.");
113         descriptor.setPropertyEditorClass(PlaylistTypeEditor.class);
114         
115         descriptor = addProperty("fileBackup");
116         descriptor.setCategory(FILES);
117         descriptor.setDisplayName("Backup File");
118         descriptor.setShortDescription("Location to put the backup zipped database.");
119         descriptor.setPropertyEditorClass(FilePropertyEditor.class);
120         
121         descriptor = addProperty("logLevel");
122         descriptor.setCategory(FILES);
123         descriptor.setDisplayName("Logfile Level");
124         descriptor.setShortDescription("Level of logging output to display in logfile.");
125         descriptor.setPropertyEditorClass(LogLevelTypeEditor.class);
126         
127         descriptor = addProperty("analyzerMode");
128         descriptor.setCategory(PLAYER);
129         descriptor.setDisplayName("Spectrum Analyzer Mode");
130         descriptor.setShortDescription("Startup mode for the spectrum analyzer.  Either Off, Analyzer, or Scope.");
131         descriptor.setPropertyEditorClass(SpectrumAnalyzerTypeEditor.class);
132         
133         descriptor = addProperty("playerBufferSize");
134         descriptor.setCategory(PLAYER);
135         descriptor.setDisplayName("Buffer Size (in bytes)");
136         descriptor.setShortDescription("Buffer size for audio player.  Increase this number if you are hearing skips.");
137         descriptor.setPropertyEditorClass(IntegerPropertyEditor.class);
138         
139         descriptor = addProperty("fadeInOnPlay");
140         descriptor.setCategory(PLAYER);
141         descriptor.setDisplayName("Fade In On Play");
142         descriptor.setShortDescription("Whether to fade songs back in on play.");
143         
144         descriptor = addProperty("fadeOutOnChange");
145         descriptor.setCategory(PLAYER);
146         descriptor.setDisplayName("Fade Out On Change");
147         descriptor.setShortDescription("Whether to fade songs out on song change.");
148         
149         descriptor = addProperty("fadeOutOnPause");
150         descriptor.setCategory(PLAYER);
151         descriptor.setDisplayName("Fade Out On Pause");
152         descriptor.setShortDescription("Whether to fade songs out on pause.");
153         
154         descriptor = addProperty("fadeOutOnStop");
155         descriptor.setCategory(PLAYER);
156         descriptor.setDisplayName("Fade Out On Stop");
157         descriptor.setShortDescription("Whether to fade songs out on stop.");
158     }
159     
160     /**
161      * Class used to pick playlist types from a combo box
162      */
163     public static class PlaylistTypeEditor extends ComboBoxPropertyEditor {
164   	  public PlaylistTypeEditor() {
165   	    super();	    
166   	    setAvailableValues(PlaylistFilter.EXTENSIONS);
167   	  }
168   	}
169     
170     /**
171      * Class used to pick log levels for output
172      */
173     public static class LogLevelTypeEditor extends ComboBoxPropertyEditor {
174   	  public LogLevelTypeEditor() {
175   	    super();
176   	    setAvailableValues(LOG_LEVELS);
177   	  }
178   	}
179     
180     /**
181      * Class used to pick Spectrum Analyzer Levels.
182      */
183     public static class SpectrumAnalyzerTypeEditor extends ComboBoxPropertyEditor {
184      public SpectrumAnalyzerTypeEditor() {
185        super();
186        setAvailableValues(ANALYZER_MODES);
187      }
188    }
189 }