Coverage Report - org.homeunix.thecave.buddi.model.prefs.PrefsModelBean
 
Classes in this File Line Coverage Branch Coverage Complexity
PrefsModelBean
79%
110/138
64%
9/14
1.088
 
 1  
 /*
 2  
  * Created on Jul 30, 2007 by wyatt
 3  
  */
 4  
 package org.homeunix.thecave.buddi.model.prefs;
 5  
 
 6  
 import java.awt.Dimension;
 7  
 import java.awt.Point;
 8  
 import java.util.HashMap;
 9  
 import java.util.List;
 10  
 import java.util.Map;
 11  
 
 12  
 
 13  
 
 14  3212
 public class PrefsModelBean {
 15  
         //Window location, size
 16  
 //        private Dimension mainWindowSize;
 17  
 //        private Point mainWindowLocation;
 18  
 //        private Dimension transactionWindowSize;
 19  
 //        private Point transactionWindowLocation;
 20  
 //        private Point scheduledWindowLocation;
 21  
 //        private Point preferencesWindowLocation;
 22  
         
 23  
         //Plugin-saved information.  The plugin author will access this
 24  
         // via a string key.  The current implementation of
 25  
         // PluginPreferenceBean contains a single string; you can
 26  
         // extend this class to get more data if you wish.  Be sure
 27  
         // to create standard getters and setters for all data you wish
 28  
         // to save.
 29  
         private Map<String, String> pluginPreferences;
 30  
         private Map<String, List<String>> pluginListPreferences;
 31  
         
 32  
         //Data file information
 33  
         private List<String> lastDataFiles;
 34  
         private Map<String, Dimension> windowSize;
 35  
         private Map<String, Point> windowLocation;
 36  
         
 37  
         //State
 38  
         private String lastVersion;
 39  
         private String availableVersion;
 40  
         
 41  
         //Locale
 42  
         private String language;
 43  
         private String dateFormat;
 44  
         private String currencySign;
 45  
         private boolean showCurrencyAfterAmount;
 46  
         
 47  
         //View Options
 48  
         private boolean showDeleted;
 49  
         private boolean showAutoComplete;
 50  
         private boolean showCleared;
 51  
         private boolean showReconciled;
 52  
         private boolean showFlatAccounts;
 53  
         private boolean showFlatBudget;
 54  
         private boolean showOverdraft;
 55  
         private boolean showCreditRemaining;
 56  
         private boolean showInterestRates;
 57  
         private boolean showTooltips;
 58  
         private boolean showNegativeSign;
 59  
         private boolean showFlatBudgetInSourceCombobox;
 60  
         //Currently must be set to 4.  If we change this, we will need to change 
 61  
         // the menu item code which displays the dates to copy to / from, as well 
 62  
         // as other things.
 63  
         private int numberOfBudgetColumns; 
 64  
         
 65  
         //Network Options
 66  
         private boolean showProxySettings;
 67  
         private String proxyServer;
 68  
         private int port;
 69  
         //TODO get more options here
 70  
         
 71  
         //Advanced Options
 72  3212
         private int numberOfBackups = 10;
 73  3212
         private int autosaveDelay = 30;
 74  
         private boolean sendCrashReports;
 75  
         private boolean showUpdateNotifications;
 76  
         private boolean showPromptAtStartup;
 77  
         private String transactionCellRenderer; 
 78  
         
 79  
         //Transaction Pane collapsible panes
 80  
         private boolean searchPaneVisible;
 81  
         private boolean totalPaneVisible;
 82  
         private String searchText;
 83  
         private String dateFilter;
 84  
         private String clearedFilter;
 85  
         private String reconciledFilter;
 86  
         
 87  
         //Maintain option state
 88  3212
         private int lastDeleteOption = 0;
 89  
         
 90  
         //Define the max / min number of budget columns visible (not currently used)
 91  3212
         private int MIN_BUDGET_COLUMNS = 2;
 92  3212
         private int MAX_BUDGET_COLUMNS = 13;
 93  
         
 94  
         public int getNumberOfBudgetColumns() {
 95  197780
                 if (numberOfBudgetColumns < MIN_BUDGET_COLUMNS || numberOfBudgetColumns > MAX_BUDGET_COLUMNS)
 96  3209
                         numberOfBudgetColumns = 4;
 97  
                 
 98  197780
                 return numberOfBudgetColumns;
 99  
         }
 100  
         
 101  
         public Map<String, List<String>> getPluginListPreferences() {
 102  452
                 return pluginListPreferences;
 103  
         }
 104  
 
 105  
         public void setPluginListPreferences(
 106  
                         Map<String, List<String>> pluginListPreferences) {
 107  0
                 this.pluginListPreferences = pluginListPreferences;
 108  0
         }
 109  
 
 110  
         public boolean isShowTooltips() {
 111  3703
                 return showTooltips;
 112  
         }
 113  
 
 114  
         public void setShowTooltips(boolean showTooltips) {
 115  3253
                 this.showTooltips = showTooltips;
 116  3253
         }
 117  
 
 118  
         public boolean isShowFlatAccounts() {
 119  16951
                 return showFlatAccounts;
 120  
         }
 121  
         public void setShowFlatAccounts(boolean showFlatAccounts) {
 122  45
                 this.showFlatAccounts = showFlatAccounts;
 123  45
         }
 124  
         public boolean isShowFlatBudget() {
 125  58299
                 return showFlatBudget;
 126  
         }
 127  
         public void setShowFlatBudget(boolean showFlatBudget) {
 128  45
                 this.showFlatBudget = showFlatBudget;
 129  45
         }
 130  
 
 131  
         /**
 132  
          * Sets the number of columns in the My Budget window.  For now, do 
 133  
          * not change this, as we make certain assumptions about the number 
 134  
          * of visible columns.  If we find a need to change this in the future,
 135  
          * we may do so.  
 136  
          * @param numberOfBudgetColumns
 137  
          */
 138  
         public void setNumberOfBudgetColumns(int numberOfBudgetColumns) {
 139  0
                 if (numberOfBudgetColumns < MIN_BUDGET_COLUMNS)
 140  0
                         numberOfBudgetColumns = MIN_BUDGET_COLUMNS;
 141  0
                 if (numberOfBudgetColumns > MAX_BUDGET_COLUMNS)
 142  0
                         numberOfBudgetColumns = MAX_BUDGET_COLUMNS;
 143  0
                 this.numberOfBudgetColumns = numberOfBudgetColumns;
 144  0
         }
 145  
 
 146  
         public String getCurrencySign() {
 147  30432
                 return currencySign;
 148  
         }
 149  
 
 150  
         public void setCurrencySign(String currencySign) {
 151  3255
                 this.currencySign = currencySign;
 152  3255
         }
 153  
 
 154  
         public int getAutosaveDelay() {
 155  1373
                 return autosaveDelay;
 156  
         }
 157  
 
 158  
         public void setAutosaveDelay(int autosaveDelay) {
 159  43
                 this.autosaveDelay = autosaveDelay;
 160  43
         }
 161  
 
 162  
         public String getDateFormat() {
 163  29831
                 return dateFormat;
 164  
         }
 165  
 
 166  
         public void setDateFormat(String dateFormat) {
 167  3255
                 this.dateFormat = dateFormat;
 168  3255
         }
 169  
         
 170  
         public boolean isShowCreditRemaining() {
 171  23793
                 return showCreditRemaining;
 172  
         }
 173  
 
 174  
         public void setShowCreditRemaining(boolean showCreditRemaining) {
 175  45
                 this.showCreditRemaining = showCreditRemaining;
 176  45
         }
 177  
 
 178  
         public boolean isShowOverdraft() {
 179  23809
                 return showOverdraft;
 180  
         }
 181  
 
 182  
         public void setShowOverdraft(boolean showOverdraft) {
 183  45
                 this.showOverdraft = showOverdraft;
 184  45
         }
 185  
 
 186  
         public String getLanguage() {
 187  21071
                 return language;
 188  
         }
 189  
 
 190  
         public void setLanguage(String language) {
 191  3255
                 this.language = language;
 192  3255
         }
 193  
 
 194  
         public List<String> getLastDataFiles() {
 195  3461
                 return lastDataFiles;
 196  
         }
 197  
 
 198  
         public void setLastDataFiles(List<String> lastDataFiles) {
 199  45
                 this.lastDataFiles = lastDataFiles;
 200  45
         }
 201  
 
 202  
         public int getNumberOfBackups() {
 203  1373
                 return numberOfBackups;
 204  
         }
 205  
 
 206  
         public void setNumberOfBackups(int numberOfBackups) {
 207  43
                 this.numberOfBackups = numberOfBackups;
 208  43
         }
 209  
 
 210  
         public String getProxyServer() {
 211  1842
                 return proxyServer;
 212  
         }
 213  
 
 214  
         public void setProxyServer(String proxyServer) {
 215  3255
                 this.proxyServer = proxyServer;
 216  3255
         }
 217  
 
 218  
         public int getPort() {
 219  1373
                 return port;
 220  
         }
 221  
 
 222  
         public void setPort(int port) {
 223  43
                 this.port = port;
 224  43
         }
 225  
 
 226  
         public boolean isShowAutoComplete() {
 227  2538
                 return showAutoComplete;
 228  
         }
 229  
 
 230  
         public void setShowAutoComplete(boolean showAutoComplete) {
 231  3253
                 this.showAutoComplete = showAutoComplete;
 232  3253
         }
 233  
 
 234  
         public boolean isShowCleared() {
 235  6013
                 return showCleared;
 236  
         }
 237  
 
 238  
         public void setShowCleared(boolean showCleared) {
 239  45
                 this.showCleared = showCleared;
 240  45
         }
 241  
 
 242  
         public boolean isShowCurrencyAfterAmount() {
 243  29963
                 return showCurrencyAfterAmount;
 244  
         }
 245  
 
 246  
         public void setShowCurrencyAfterAmount(boolean showCurrencyAfterAmount) {
 247  44
                 this.showCurrencyAfterAmount = showCurrencyAfterAmount;
 248  44
         }
 249  
 
 250  
         public boolean isShowDeleted() {
 251  171263
                 return showDeleted;
 252  
         }
 253  
 
 254  
         public void setShowDeleted(boolean showDeleted) {
 255  3253
                 this.showDeleted = showDeleted;
 256  3253
         }
 257  
 
 258  
         public boolean isShowPromptAtStartup() {
 259  4359
                 return showPromptAtStartup;
 260  
         }
 261  
 
 262  
         public void setShowPromptAtStartup(boolean showPromptAtStartup) {
 263  45
                 this.showPromptAtStartup = showPromptAtStartup;
 264  45
         }
 265  
 
 266  
         public boolean isShowProxySettings() {
 267  1391
                 return showProxySettings;
 268  
         }
 269  
 
 270  
         public void setShowProxySettings(boolean showProxySettings) {
 271  45
                 this.showProxySettings = showProxySettings;
 272  45
         }
 273  
 
 274  
         public boolean isShowReconciled() {
 275  6013
                 return showReconciled;
 276  
         }
 277  
 
 278  
         public void setShowReconciled(boolean showReconciled) {
 279  45
                 this.showReconciled = showReconciled;
 280  45
         }
 281  
 
 282  
 //        public boolean isShowTypes() {
 283  
 //                return showTypes;
 284  
 //        }
 285  
 //
 286  
 //        public void setShowTypes(boolean showTypes) {
 287  
 //                this.showTypes = showTypes;
 288  
 //        }
 289  
 
 290  
         public boolean isShowUpdateNotifications() {
 291  7336
                 return showUpdateNotifications;
 292  
         }
 293  
 
 294  
         public void setShowUpdateNotifications(boolean showUpdateNotifications) {
 295  45
                 this.showUpdateNotifications = showUpdateNotifications;
 296  45
         }
 297  
 
 298  
         public String getLastVersion() {
 299  12360
                 return lastVersion;
 300  
         }
 301  
 
 302  
         public void setLastVersion(String lastVersion) {
 303  3212
                 this.lastVersion = lastVersion;
 304  3212
         }
 305  
 
 306  
         public boolean isSendCrashReports() {
 307  678
                 return sendCrashReports;
 308  
         }
 309  
 
 310  
         public void setSendCrashReports(boolean sendCrashReports) {
 311  3212
                 this.sendCrashReports = sendCrashReports;
 312  3212
         }
 313  
 
 314  
 //        public Point getMainWindowLocation() {
 315  
 //                return mainWindowLocation;
 316  
 //        }
 317  
 //
 318  
 //        public void setMainWindowLocation(Point mainWindowLocation) {
 319  
 //                this.mainWindowLocation = mainWindowLocation;
 320  
 //        }
 321  
 //
 322  
 //        public Dimension getMainWindowSize() {
 323  
 //                return mainWindowSize;
 324  
 //        }
 325  
 //
 326  
 //        public void setMainWindowSize(Dimension mainWindowSize) {
 327  
 //                this.mainWindowSize = mainWindowSize;
 328  
 //        }
 329  
 
 330  
         public Map<String, String> getPluginPreferences() {
 331  678
                 if (pluginPreferences == null)
 332  407
                         pluginPreferences = new HashMap<String, String>();
 333  678
                 return pluginPreferences;
 334  
         }
 335  
 
 336  
         public void setPluginPreferences(Map<String, String> pluginPreferences) {
 337  0
                 this.pluginPreferences = pluginPreferences;
 338  0
         }
 339  
 
 340  
         public Map<String, Point> getWindowLocation() {
 341  9390
                 if (windowLocation == null)
 342  3212
                         windowLocation = new HashMap<String, Point>();
 343  9390
                 return windowLocation;
 344  
         }
 345  
 
 346  
         public void setWindowLocation(Map<String, Point> windowLocation) {
 347  0
                 this.windowLocation = windowLocation;
 348  0
         }
 349  
 
 350  
         public Map<String, Dimension> getWindowSize() {
 351  6689
                 if (windowSize == null)
 352  3212
                         windowSize = new HashMap<String, Dimension>();
 353  6689
                 return windowSize;
 354  
         }
 355  
 
 356  
         public void setWindowSize(Map<String, Dimension> windowSize) {
 357  0
                 this.windowSize = windowSize;
 358  0
         }
 359  
 
 360  
         public boolean isShowNegativeSign() {
 361  29920
                 return showNegativeSign;
 362  
         }
 363  
 
 364  
         public void setShowNegativeSign(boolean showNegativeSign) {
 365  45
                 this.showNegativeSign = showNegativeSign;
 366  45
         }
 367  
 
 368  
         public boolean isSearchPaneVisible() {
 369  678
                 return searchPaneVisible;
 370  
         }
 371  
 
 372  
         public void setSearchPaneVisible(boolean searchPaneVisible) {
 373  0
                 this.searchPaneVisible = searchPaneVisible;
 374  0
         }
 375  
 
 376  
         public boolean isTotalPaneVisible() {
 377  678
                 return totalPaneVisible;
 378  
         }
 379  
 
 380  
         public void setTotalPaneVisible(boolean totalPaneVisible) {
 381  0
                 this.totalPaneVisible = totalPaneVisible;
 382  0
         }
 383  
 
 384  
         public String getTransactionCellRenderer() {
 385  1147
                 return transactionCellRenderer;
 386  
         }
 387  
 
 388  
         public void setTransactionCellRenderer(String transactionCellRenderer) {
 389  3255
                 this.transactionCellRenderer = transactionCellRenderer;
 390  3255
         }
 391  
 
 392  
         public String getClearedFilter() {
 393  452
                 return clearedFilter;
 394  
         }
 395  
 
 396  
         public void setClearedFilter(String clearedFilter) {
 397  0
                 this.clearedFilter = clearedFilter;
 398  0
         }
 399  
 
 400  
         public String getDateFilter() {
 401  452
                 return dateFilter;
 402  
         }
 403  
 
 404  
         public void setDateFilter(String dateFilter) {
 405  0
                 this.dateFilter = dateFilter;
 406  0
         }
 407  
 
 408  
         public String getReconciledFilter() {
 409  452
                 return reconciledFilter;
 410  
         }
 411  
 
 412  
         public void setReconciledFilter(String reconciledFilter) {
 413  0
                 this.reconciledFilter = reconciledFilter;
 414  0
         }
 415  
 
 416  
         public String getSearchText() {
 417  452
                 return searchText;
 418  
         }
 419  
 
 420  
         public void setSearchText(String searchText) {
 421  0
                 this.searchText = searchText;
 422  0
         }
 423  
         
 424  
         public int getLastDeleteOption() {
 425  678
                 return lastDeleteOption;
 426  
         }
 427  
         public void setLastDeleteOption(int lastDeleteOption) {
 428  0
                 this.lastDeleteOption = lastDeleteOption;
 429  0
         }
 430  
         
 431  
         public String getAvailableVersion() {
 432  452
                 return availableVersion;
 433  
         }
 434  
         public void setAvailableVersion(String availableVersion) {
 435  3212
                 this.availableVersion = availableVersion;
 436  3212
         }
 437  
         
 438  
         public boolean isShowInterestRates() {
 439  23803
                 return showInterestRates;
 440  
         }
 441  
         public void setShowInterestRates(boolean showInterestRates) {
 442  45
                 this.showInterestRates = showInterestRates;
 443  45
         }
 444  
         public boolean isShowFlatBudgetInSourceCombobox() {
 445  27746
                 return showFlatBudgetInSourceCombobox;
 446  
         }
 447  
         public void setShowFlatBudgetInSourceCombobox(
 448  
                         boolean showFlatBudgetInSourceCombobox) {
 449  45
                 this.showFlatBudgetInSourceCombobox = showFlatBudgetInSourceCombobox;
 450  45
         }
 451  
 }