Coverage Report - org.homeunix.thecave.buddi.Const
 
Classes in this File Line Coverage Branch Coverage Complexity
Const
95%
21/22
N/A
2.2
Const$1
100%
5/5
75%
3/4
2.2
Const$2
20%
1/5
0%
0/4
2.2
 
 1  
 /*
 2  
  * Created on May 12, 2006 by wyatt
 3  
  */
 4  
 package org.homeunix.thecave.buddi;
 5  
 
 6  
 import java.awt.Color;
 7  
 import java.io.File;
 8  
 
 9  
 import javax.swing.JList;
 10  
 import javax.swing.filechooser.FileFilter;
 11  
 
 12  
 import org.homeunix.thecave.buddi.i18n.BuddiKeys;
 13  
 import org.homeunix.thecave.buddi.model.prefs.PrefsModel;
 14  
 import org.homeunix.thecave.buddi.plugin.builtin.cellrenderer.ChequeTransactionCellRenderer;
 15  
 import org.homeunix.thecave.buddi.plugin.builtin.cellrenderer.ConciseTransactionCellRenderer;
 16  
 import org.homeunix.thecave.buddi.plugin.builtin.cellrenderer.DefaultTransactionCellRenderer;
 17  
 import org.homeunix.thecave.buddi.plugin.builtin.cellrenderer.SimpleTransactionCellRenderer;
 18  
 import org.homeunix.thecave.buddi.plugin.builtin.preference.AdvancedPreferences;
 19  
 import org.homeunix.thecave.buddi.plugin.builtin.preference.LocalePreferences;
 20  
 import org.homeunix.thecave.buddi.plugin.builtin.preference.NetworkPreferences;
 21  
 import org.homeunix.thecave.buddi.plugin.builtin.preference.PluginPreferences;
 22  
 import org.homeunix.thecave.buddi.plugin.builtin.preference.ViewPreferences;
 23  
 import org.homeunix.thecave.buddi.plugin.builtin.report.AverageIncomeExpenseByCategory;
 24  
 import org.homeunix.thecave.buddi.plugin.builtin.report.ExpensesPieGraph;
 25  
 import org.homeunix.thecave.buddi.plugin.builtin.report.IncomeExpenseReportByCategory;
 26  
 import org.homeunix.thecave.buddi.plugin.builtin.report.IncomePieGraph;
 27  
 import org.homeunix.thecave.buddi.plugin.builtin.report.NetWorthOverTime;
 28  
 
 29  
 
 30  
 /**
 31  
  * A container for constants, used throughout the rest of the program.
 32  
  * 
 33  
  * @author wyatt
 34  
  *
 35  
  */
 36  
 public class Const {
 37  
         public static final String PROJECT_NAME = "Buddi";
 38  
         
 39  
         public static final String STABLE = "STABLE";
 40  
         public static final String DEVELOPMENT = "DEVELOPMENT";
 41  
         
 42  
         //Version variables
 43  
         public static final String BRANCH = STABLE;
 44  2986
         public static final boolean DEVEL = BRANCH.equals(DEVELOPMENT);
 45  
         
 46  
         //Language constants
 47  
         public final static String LANGUAGE_EXTENSION = ".lang";
 48  
         public final static String LANGUAGE_FOLDER = "Languages";
 49  
         public final static String LANGUAGE_RESOURCE_PATH = "/Languages";
 50  
         
 51  
         //Data file constants
 52  
         public final static String DATA_FILE_EXTENSION = ".buddi3";
 53  
         public final static String BACKUP_FILE_EXTENSION = ".buddi3bak";
 54  
         public final static String AUTOSAVE_FILE_EXTENSION = ".buddi3autosave";
 55  
         
 56  
         //Preference file constants
 57  
         public static final String PREFERENCE_FILE_NAME = "Buddi3_Prefs.xml"; 
 58  
                 
 59  
         //Report constants
 60  
         public static final String REPORT_FOLDER = "Reports";
 61  
         
 62  
         //Plugin Constants
 63  
         public static final String PLUGIN_FOLDER = "Plugins";
 64  
         public static final String PLUGIN_EXTENSION = ".buddi3plugin";
 65  
         public static final String PLUGIN_PROPERTIES = "plugin.properties";
 66  
         public static final String PLUGIN_PROPERTIES_ROOT = "PLUGIN_ROOT";  //Used for plugins to define where to look for plugin classes
 67  
         public static final String PLUGIN_PROPERTIES_VERSION = "VERSION";
 68  
         
 69  
         //File filter for loading / saving data files
 70  2986
         public static final FileFilter FILE_FILTER_DATA = new FileFilter(){
 71  
                 @Override
 72  
                 public boolean accept(File f) {
 73  21999
                         if (f.isDirectory() 
 74  
                                         || f.getName().endsWith(Const.DATA_FILE_EXTENSION)){
 75  20522
                                 return true;
 76  
                         }
 77  1477
                         return false;
 78  
                 }
 79  
 
 80  
                 @Override
 81  
                 public String getDescription() {
 82  1386
                         return PrefsModel.getInstance().getTranslator().get(BuddiKeys.FILE_DESCRIPTION_BUDDI_DATA_FILES);
 83  
                 }
 84  
         };
 85  
         
 86  
         //File filter for loading backup files
 87  2986
         public static final FileFilter FILE_FILTER_BACKUP = new FileFilter(){
 88  
                 @Override
 89  
                 public boolean accept(File f) {
 90  0
                         if (f.isDirectory() 
 91  
                                         || f.getName().endsWith(Const.BACKUP_FILE_EXTENSION)){
 92  0
                                 return true;
 93  
                         }
 94  0
                         return false;
 95  
                 }
 96  
 
 97  
                 @Override
 98  
                 public String getDescription() {
 99  0
                         return PrefsModel.getInstance().getTranslator().get(BuddiKeys.FILE_DESCRIPTION_BUDDI_DATA_FILES);
 100  
                 }
 101  
         };
 102  
         
 103  
         //Web addresses
 104  
         public final static String DONATE_URL = "http://sourceforge.net/donate/index.php?group_id=167026";
 105  
         public final static String PROJECT_URL = "http://buddi.digitalcave.ca/";
 106  
         public final static String DOWNLOAD_URL_STABLE = "http://buddi.digitalcave.ca/buddi";
 107  
         public final static String DOWNLOAD_URL_UNSTABLE = "http://buddi.digitalcave.ca/buddi-development";
 108  
         public final static String VERSION_FILE = "version.txt";
 109  
         
 110  
         //File Types
 111  
         public final static String DOWNLOAD_TYPE_OSX = ".dmg";
 112  
         public final static String DOWNLOAD_TYPE_WINDOWS = ".exe";
 113  
         public final static String DOWNLOAD_TYPE_WINDOWS_INSTALLER = "-Installer.exe";
 114  
         public final static String DOWNLOAD_TYPE_GENERIC = ".jar";
 115  
         public final static String DOWNLOAD_TYPE_DEBIAN = ".deb";
 116  
         public final static String DOWNLOAD_TYPE_REDHAT = ".rpm";
 117  
         public final static String DOWNLOAD_TYPE_SLACKWARE = "-Slackware.tgz";
 118  
         public final static String DOWNLOAD_TYPE_UNIX = ".tgz";
 119  
         
 120  
         //Local help paths
 121  
         public final static String HELP_FOLDER = "Help";
 122  
         public final static String HELP_FILE = "index.html";
 123  
         
 124  
         //File names
 125  
         public final static String LOG_FILE = "Buddi.log";
 126  
         
 127  
         //Colors
 128  2986
         public final static Color COLOR_JLIST_SELECTED_BACKGROUND = new JList().getSelectionBackground(); // new Color(181, 213, 255);
 129  2986
         public final static Color COLOR_JLIST_SELECTED_TEXT = new JList().getSelectionForeground();
 130  2986
         public final static Color COLOR_JLIST_UNSELECTED_TEXT = new JList().getForeground();
 131  2986
         public final static Color COLOR_TRANSPARENT = new Color(0, 0, 0, 255);
 132  2986
         public final static Color COLOR_EVEN_ROW = new Color(237, 243, 254);
 133  2986
         public final static Color COLOR_ODD_ROW = Color.WHITE;
 134  
 
 135  
         
 136  
         //Languages which are included in the .jar file.  Needed since there
 137  
         // is no good method of reading the main jar file by itself (since
 138  
         // it may be wrapped in a .exe, etc).
 139  2986
         public final static String[] BUNDLED_LANGUAGES = {
 140  
 //                "Czech",
 141  
                 "Deutsch",
 142  
                 "English_(US)",
 143  
                 "English",
 144  
                 "Espanol",
 145  
                 "Francais",
 146  
                 "Greek",
 147  
                 "Hebrew",
 148  
                 "Italiano",
 149  
                 "Nederlands",
 150  
                 "Norsk",
 151  
                 "Portugues",
 152  
                 "Russian",
 153  
                 "Serbian",
 154  
                 "Svenska",
 155  
         };
 156  
         
 157  
         //Date formats to appear in Preferences.
 158  2986
         public final static String[] DATE_FORMATS = {
 159  
                 "yyyy/MM/dd",
 160  
                 "yyyy/MMM/dd",
 161  
                 "dd/MM/yyyy",
 162  
                 "dd/MMM/yyyy",
 163  
                 "MM/dd/yyyy",
 164  
                 "MMM/dd/yyyy",
 165  
                 "MMMM dd, yyyy",
 166  
                 "MMM dd yyyy"
 167  
         };
 168  
         
 169  
         //Currency formats to appear in Preferences
 170  2986
         public final static String[] CURRENCY_FORMATS = {
 171  
                 "$",
 172  
                 "\u20ac", //Euro
 173  
                 "\u00a3", //British Pounds
 174  
                 "p.",     //Russian Ruble
 175  
                 "\u00a5", //Yen
 176  
                 "\u20a3", //French Franc
 177  
                 "SFr",                 //Swiss Franc (?)
 178  
                 "Rs",                 //Indian Rupees
 179  
                 "Kr",                 //Norwegian
 180  
                 "Bs",                 //Venezuela
 181  
                 "S/.",                 //Peru
 182  
                 "\u20b1", //Peso
 183  
                 "\u20aa", //Israel Sheqel 
 184  
                 "Mex$",                //Mexican Peso
 185  
                 "R$",                        //Brazilian Real
 186  
                 "Ch$",                //Chilean Peso
 187  
                 "C",                        //Costa Rican Colon
 188  
                 "Arg$",                //Argentinan Peso
 189  
                 "Kc"        //Something else; requested by a user
 190  
         };
 191  
         
 192  
         //Built in Preference Panes 
 193  2986
         public final static String[] BUILT_IN_PREFERENCE_PANELS = {
 194  
                 ViewPreferences.class.getCanonicalName(),
 195  
                 PluginPreferences.class.getCanonicalName(),
 196  
                 LocalePreferences.class.getCanonicalName(),
 197  
                 NetworkPreferences.class.getCanonicalName(),
 198  
                 AdvancedPreferences.class.getCanonicalName(),
 199  
 //                SkinChooserPreferencePane.class.getCanonicalName(),
 200  
         };
 201  
         
 202  
         //Built in Reports
 203  2986
         public final static String[] BUILT_IN_REPORTS = {
 204  
                 IncomeExpenseReportByCategory.class.getCanonicalName(),
 205  
                 AverageIncomeExpenseByCategory.class.getCanonicalName(),
 206  
                 IncomePieGraph.class.getCanonicalName(),
 207  
                 ExpensesPieGraph.class.getCanonicalName(),
 208  
                 NetWorthOverTime.class.getCanonicalName(),
 209  
         };
 210  
         
 211  
         //Built in Imports
 212  2986
         public static final String[] BUILT_IN_IMPORTS = {
 213  
 //                ImportLegacyData.class.getCanonicalName(),
 214  
 //                ImportTestData.class.getCanonicalName(),
 215  
 //                CSVImportDoneRight.class.getCanonicalName(),
 216  
         };
 217  
         
 218  
         //Built in Exports
 219  2986
         public static final String[] BUILT_IN_EXPORTS = {};
 220  
         
 221  
         //Built in Synchronizes
 222  2986
         public static final String[] BUILT_IN_SYNCHRONIZES = {};
 223  
         
 224  
         //Built in Runnable plugins
 225  2986
         public static final String[] BUILT_IN_RUNNABLES = {
 226  
 //                SkinChangerPlugin.class.getCanonicalName(),
 227  
         };
 228  
         
 229  
         //Built in Panel plugins
 230  2986
         public static final String[] BUILT_IN_PANELS = {
 231  
         };
 232  
         
 233  
         //Built in transaction cell renderers
 234  2986
         public static final String[] BUILT_IN_TRANSACTION_CELL_RENDERERS = {
 235  
                 DefaultTransactionCellRenderer.class.getCanonicalName(),
 236  
                 SimpleTransactionCellRenderer.class.getCanonicalName(),
 237  
                 ChequeTransactionCellRenderer.class.getCanonicalName(),
 238  
                 ConciseTransactionCellRenderer.class.getCanonicalName(),
 239  
         };
 240  
         
 241  
         //Built in main screen tabs
 242  2986
         public static final String[] BUILT_IN_MAIN_FRAME_TABS = {};
 243  
         
 244  0
         private Const(){}
 245  
 }