| 1 | |
|
| 2 | |
|
| 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 | |
|
| 32 | |
|
| 33 | |
|
| 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 | |
|
| 43 | |
public static final String BRANCH = STABLE; |
| 44 | 2986 | public static final boolean DEVEL = BRANCH.equals(DEVELOPMENT); |
| 45 | |
|
| 46 | |
|
| 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 | |
|
| 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 | |
|
| 57 | |
public static final String PREFERENCE_FILE_NAME = "Buddi3_Prefs.xml"; |
| 58 | |
|
| 59 | |
|
| 60 | |
public static final String REPORT_FOLDER = "Reports"; |
| 61 | |
|
| 62 | |
|
| 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"; |
| 67 | |
public static final String PLUGIN_PROPERTIES_VERSION = "VERSION"; |
| 68 | |
|
| 69 | |
|
| 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 | |
|
| 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 | |
|
| 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 | |
|
| 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 | |
|
| 121 | |
public final static String HELP_FOLDER = "Help"; |
| 122 | |
public final static String HELP_FILE = "index.html"; |
| 123 | |
|
| 124 | |
|
| 125 | |
public final static String LOG_FILE = "Buddi.log"; |
| 126 | |
|
| 127 | |
|
| 128 | 2986 | public final static Color COLOR_JLIST_SELECTED_BACKGROUND = new JList().getSelectionBackground(); |
| 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 | |
|
| 137 | |
|
| 138 | |
|
| 139 | 2986 | public final static String[] BUNDLED_LANGUAGES = { |
| 140 | |
|
| 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 | |
|
| 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 | |
|
| 170 | 2986 | public final static String[] CURRENCY_FORMATS = { |
| 171 | |
"$", |
| 172 | |
"\u20ac", |
| 173 | |
"\u00a3", |
| 174 | |
"p.", |
| 175 | |
"\u00a5", |
| 176 | |
"\u20a3", |
| 177 | |
"SFr", |
| 178 | |
"Rs", |
| 179 | |
"Kr", |
| 180 | |
"Bs", |
| 181 | |
"S/.", |
| 182 | |
"\u20b1", |
| 183 | |
"\u20aa", |
| 184 | |
"Mex$", |
| 185 | |
"R$", |
| 186 | |
"Ch$", |
| 187 | |
"C", |
| 188 | |
"Arg$", |
| 189 | |
"Kc" |
| 190 | |
}; |
| 191 | |
|
| 192 | |
|
| 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 | |
|
| 200 | |
}; |
| 201 | |
|
| 202 | |
|
| 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 | |
|
| 212 | 2986 | public static final String[] BUILT_IN_IMPORTS = { |
| 213 | |
|
| 214 | |
|
| 215 | |
|
| 216 | |
}; |
| 217 | |
|
| 218 | |
|
| 219 | 2986 | public static final String[] BUILT_IN_EXPORTS = {}; |
| 220 | |
|
| 221 | |
|
| 222 | 2986 | public static final String[] BUILT_IN_SYNCHRONIZES = {}; |
| 223 | |
|
| 224 | |
|
| 225 | 2986 | public static final String[] BUILT_IN_RUNNABLES = { |
| 226 | |
|
| 227 | |
}; |
| 228 | |
|
| 229 | |
|
| 230 | 2986 | public static final String[] BUILT_IN_PANELS = { |
| 231 | |
}; |
| 232 | |
|
| 233 | |
|
| 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 | |
|
| 242 | 2986 | public static final String[] BUILT_IN_MAIN_FRAME_TABS = {}; |
| 243 | |
|
| 244 | 0 | private Const(){} |
| 245 | |
} |