|
Venice 0.74beta | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnz.org.venice.prefs.PreferencesManager
The Preferences Manager contains a set of routines for loading and saving all preferences data for the application. Consolidating these routines in a single place allows us to maintain preferences namespace convention and also allows us to easily change the method of storage at a later date if desired.
If a save method first clears all preferences data from a node, it is imperative
that both the save and the equivalent load methods are synchronized.
Otherwise there is the possibility the load call is called just after the
delete call which would nuke all the values. Perhaps all the methods
should be synchronized.
| Nested Class Summary | |
class |
PreferencesManager.DatabasePreferences
Database preferences fields. |
class |
PreferencesManager.DisplayPreferences
Display preferences fields. |
class |
PreferencesManager.IDQuoteSyncPreferences
Intra-day Quote Sync preferences fields. |
class |
PreferencesManager.ProxyPreferences
Web proxy preferences fields. |
| Field Summary | |
static int |
DATABASE
Indicates the quote source is accessing quotes in a database. |
static int |
FILES
Deprecated. Indicates the quote source is accessing quotes in files. |
static int |
INTERNAL
Indicates the quote source is accessing the internal database. |
static int |
SAMPLES
Indicates the quote source is using the inbuilt sample quotes. |
| Method Summary | |
static void |
deletePortfolio(java.lang.String name)
Delete the portfolio. |
static void |
deleteWatchScreen(java.lang.String name)
Delete the watch screen. |
static void |
flush()
Forces the preferences data to be saved to the backend store (e.g. disk). |
static java.lang.String |
getAlertDestination()
Retrieve where the users is storing alerts |
static java.util.HashMap |
getAnalyserPageSettings(java.lang.String key)
Load all saved user input in an Analyser Page. |
static boolean |
getCacheExpiryEnabled()
Load the users preference for whether the quotes in the cache expire. |
static int |
getCacheExpiryTime()
Load the users preference for when the quotes in the cache expire. |
static boolean |
getConfirmExitSetting()
Return true if Venice should confirm exit. |
static PreferencesManager.DatabasePreferences |
getDatabaseSettings()
Load database settings. |
static java.lang.String |
getDefaultChart()
Load default chart setting. |
static java.awt.Color |
getDefaultChartBackgroundColour()
Load default chart setting. |
static boolean |
getDefaultChartScrollToEnd()
Load default chart scroll bar position. |
static boolean |
getDefaultTableScrollToEnd()
Load default table scroll bar position. |
static java.lang.String |
getDirectoryLocation(java.lang.String dirtype)
Load the last directory used when importing quote files. |
static PreferencesManager.DisplayPreferences |
getDisplaySettings()
Load display settings. |
static int |
getEditTabSize()
Load user interface setting. |
static boolean |
getHasGPLAcceptance()
Return whether we require the user to explicitly accept the GPL license. |
static PreferencesManager.IDQuoteSyncPreferences |
getIDQuoteSyncPreferences()
Load intra-day quote sync module preferences. |
static java.lang.String |
getInternalFileName()
Load the file name to store the internal database. |
static java.lang.String |
getLanguageCode()
Load language setting. |
static int |
getLastPreferencesPage()
Load the last preferences page visited. |
static java.io.File |
getMacroHome()
Return the directroy which contains Venice's macros. |
static int |
getMaxDecimalDigits()
Load user interface setting. |
static int |
getMaximumCachedQuotes()
Load the cache's maximum number of quotes. |
static int |
getMinDecimalDigits()
Load user interface setting. |
static Portfolio |
getPortfolio(java.lang.String portfolioName)
Load the portfolio with the given name. |
static java.util.List |
getPortfolioNames()
Return a list of the names of all the portfolios. |
static PreferencesManager.ProxyPreferences |
getProxySettings()
Load proxy settings. |
static int |
getQuoteSource()
Get quote source setting. |
static boolean |
getRestoreSavedWindowsSetting()
Return wether to restore windows on restart |
static java.util.Vector |
getSavedFrames()
Return a list of frames saved on the filesystem. |
static java.util.List |
getStoredExpressions()
Load the list of all stored expressions. |
static java.util.List |
getStoredMacros()
Load the list of all registered macros. |
static java.util.List |
getSymbolMetadata()
|
static java.util.prefs.Preferences |
getUserNode(java.lang.String node)
Fetches the desired user node, based at the base branch. |
static java.lang.String |
getUserNotes(java.lang.String symbol)
|
static WatchScreen |
getWatchScreen(java.lang.String watchScreenName)
Load the watch screen with the given name. |
static java.util.List |
getWatchScreenNames()
Return a list of the names of all the watch screens. |
static boolean |
isMarketIndex(Symbol symbol)
|
static void |
putAlertDestination(java.lang.String destination)
Save alert destination |
static void |
putAnalyserPageSettings(java.lang.String key,
java.util.HashMap settings)
Save all user input in an Analyser Page. |
static void |
putCacheExpiryEnabled(boolean expiry)
Save the users preferences for whether the quotes in the cache expire. |
static void |
putCacheExpiryTime(int lifespan)
Save the users preference for when the quotes in the cache expire. |
static void |
putConfirmExitSetting(boolean state)
Save whether Venice should confirm exit. |
static void |
putDatabaseSettings(PreferencesManager.DatabasePreferences databasePreferences)
Save database settings. |
static void |
putDefaultChart(java.lang.String defaultChart)
Save default chart setting. |
static void |
putDefaultChartBackgroundColour(java.awt.Color backColour)
Save default chart background colour. |
static void |
putDefaultChartScrollToEnd(boolean isSelected)
Save default chart scroll bar setting. |
static void |
putDefaultTableScrollToEnd(boolean isSelected)
Save default table scroll bar setting. |
static void |
putDirectoryLocation(java.lang.String dirtype,
java.lang.String directory)
Save the directory used to import quote files. |
static void |
putDisplaySettings(PreferencesManager.DisplayPreferences displayPreferences)
Save display settings. |
static void |
putEditTabSize(java.lang.String tabSize)
Save user interface setting. |
static void |
putHasGPLAcceptance()
Set that the user has been shown the GPL and has accepted it. |
static void |
putIDQuoteSyncPreferences(PreferencesManager.IDQuoteSyncPreferences idQuoteSyncPreferences)
Save intra-day quote sync module preferences. |
static void |
putLanguageCode(java.lang.String languageCode)
Save language setting. |
static void |
putLastPreferencesPage(int page)
Save last preferences page visited. |
static void |
putMaxDecimalDigits(java.lang.String maxDecimalDigits)
Save user interface setting. |
static void |
putMaximumCachedQuotes(int maximumCachedQuotes)
Save the cache's maximum number of quotes. |
static void |
putMinDecimalDigits(java.lang.String minDecimalDigits)
Save user interface setting. |
static void |
putModuleFrameSettings(ModuleFrame frame)
|
static void |
putPortfolio(Portfolio portfolio)
Save the portfolio. |
static void |
putProxySettings(PreferencesManager.ProxyPreferences proxyPreferences)
Save proxy settings. |
static void |
putQuoteSource(int quoteSource)
Set quote source setting. |
static void |
putRestoreSavedWindowsSetting(boolean state)
Save wether to restore windows on restart. |
static void |
putStoredExpressions(java.util.List storedExpressions)
Save the list of all stored expressions. |
static void |
putStoredMacros(java.util.List stored_macros)
Save the list of all registered macros. |
static void |
putSymbolMetadata(java.util.List indexSymbols)
|
static void |
putUserNotes(java.lang.String symbol,
java.lang.String text)
|
static void |
putWatchScreen(WatchScreen watchScreen)
Save the watch screen. |
static void |
removeSavedFrames()
Remove all the saved frames. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static int SAMPLES
public static int FILES
public static int DATABASE
public static int INTERNAL
| Method Detail |
public static void flush()
public static java.util.prefs.Preferences getUserNode(java.lang.String node)
base branch.
node - the path to the node to be fetched.public static boolean getHasGPLAcceptance()
true if the user needs to explicitly accept the GPL.public static void putHasGPLAcceptance()
public static java.lang.String getDirectoryLocation(java.lang.String dirtype)
dirtype - the directory type (e.g. macros, importer, etc).
public static void putDirectoryLocation(java.lang.String dirtype,
java.lang.String directory)
dirtype - the directory type (e.g. macros, importer, etc)directory - the directory.public static java.util.List getStoredExpressions()
StoredExpressionpublic static void putStoredExpressions(java.util.List storedExpressions)
storedExpressions - the stored expressions.StoredExpressionpublic static java.util.List getStoredMacros()
StoredMacropublic static void putStoredMacros(java.util.List stored_macros)
stored_macros - the registered macros.StoredMacro
public static java.util.List getSymbolMetadata()
throws PreferencesException
PreferencesException
public static void putSymbolMetadata(java.util.List indexSymbols)
throws PreferencesException
PreferencesExceptionpublic static boolean isMarketIndex(Symbol symbol)
public static void putUserNotes(java.lang.String symbol,
java.lang.String text)
public static java.lang.String getUserNotes(java.lang.String symbol)
public static java.util.HashMap getAnalyserPageSettings(java.lang.String key)
key - a key which identifies which page settings to load.
AnalyserPage
public static void putAnalyserPageSettings(java.lang.String key,
java.util.HashMap settings)
key - a key which identifies which page settings to save.settings - the settings to save.AnalyserPagepublic static int getLastPreferencesPage()
public static void putLastPreferencesPage(int page)
page - index of the last preferences page visited.public static int getMaximumCachedQuotes()
public static void putMaximumCachedQuotes(int maximumCachedQuotes)
maximumCachedQuotes - the maximum number of quotes.public static boolean getCacheExpiryEnabled()
public static void putCacheExpiryEnabled(boolean expiry)
expiry - If true, the quotes in the cache will expire.public static void putCacheExpiryTime(int lifespan)
lifespan - the number of minutes that must elapse before refreshing the
cache.public static int getCacheExpiryTime()
public static java.util.List getWatchScreenNames()
public static WatchScreen getWatchScreen(java.lang.String watchScreenName)
throws PreferencesException
watchScreenName - the name of the watch screen to load.
PreferencesException - if there was an error loading the watch screen.
public static void putWatchScreen(WatchScreen watchScreen)
throws PreferencesException
watchScreen - the watch screen.
PreferencesException - if there was an error saving the watch screen.public static void deleteWatchScreen(java.lang.String name)
name - the watch screen name.public static java.util.List getPortfolioNames()
public static void deletePortfolio(java.lang.String name)
name - the portfolio name.
public static Portfolio getPortfolio(java.lang.String portfolioName)
throws PreferencesException
portfolioName - the name of the portfolio to load.
PreferencesException - if there was an error loading the portfolio.public static java.io.File getMacroHome()
public static void putPortfolio(Portfolio portfolio)
throws PreferencesException
portfolio - the portfolio.
PreferencesException - if there was an error saving the portfolio.public static PreferencesManager.ProxyPreferences getProxySettings()
public static void putProxySettings(PreferencesManager.ProxyPreferences proxyPreferences)
proxyPreferences - the new proxy preferences.public static java.lang.String getLanguageCode()
null if there is no language
setting saved in preferences.
public static void putLanguageCode(java.lang.String languageCode)
languageCode - ISO Language Code.public static int getMinDecimalDigits()
public static void putMinDecimalDigits(java.lang.String minDecimalDigits)
minDecimalDigits - the minimum decimal digits to be displayed.public static int getMaxDecimalDigits()
public static void putMaxDecimalDigits(java.lang.String maxDecimalDigits)
maxDecimalDigits - the maximum decimal digits to be displayed.public static int getEditTabSize()
public static void putEditTabSize(java.lang.String tabSize)
tabSize - the number of characters to insert when the tab key is pressed.public static java.lang.String getDefaultChart()
public static java.awt.Color getDefaultChartBackgroundColour()
public static boolean getDefaultChartScrollToEnd()
public static boolean getDefaultTableScrollToEnd()
public static void putRestoreSavedWindowsSetting(boolean state)
state - a boolean flag which when true causes Venice to reconstruct
previously open windows.public static boolean getRestoreSavedWindowsSetting()
public static void putConfirmExitSetting(boolean state)
state - Flag when true causes venice to prompt the user to
confirm their exit.public static boolean getConfirmExitSetting()
public static void putDefaultChart(java.lang.String defaultChart)
defaultChart - the chart to be displayed.public static void putDefaultChartBackgroundColour(java.awt.Color backColour)
backColour - the default background colour.public static void putDefaultChartScrollToEnd(boolean isSelected)
isSelected - if the scroll bar on a chart should be moved to the end.public static void putDefaultTableScrollToEnd(boolean isSelected)
isSelected - if the scroll bar on a table should be moved to the end.public static int getQuoteSource()
DATABASE, FILES or SAMPLES.public static void putQuoteSource(int quoteSource)
quoteSource - the quote source, one of DATABASE, INTERNAL or
SAMPLES.public static PreferencesManager.DatabasePreferences getDatabaseSettings()
public static void putDatabaseSettings(PreferencesManager.DatabasePreferences databasePreferences)
databasePreferences - the new database preferences.public static java.lang.String getInternalFileName()
public static PreferencesManager.DisplayPreferences getDisplaySettings()
public static void putDisplaySettings(PreferencesManager.DisplayPreferences displayPreferences)
displayPreferences - the new display preferences.public static PreferencesManager.IDQuoteSyncPreferences getIDQuoteSyncPreferences()
IDQuoteSyncModulepublic static void putIDQuoteSyncPreferences(PreferencesManager.IDQuoteSyncPreferences idQuoteSyncPreferences)
idQuoteSyncPreferences - the preferences.IDQuoteSyncModulepublic static java.util.Vector getSavedFrames()
public static void putModuleFrameSettings(ModuleFrame frame)
throws PreferencesException
PreferencesExceptionpublic static void removeSavedFrames()
public static java.lang.String getAlertDestination()
public static void putAlertDestination(java.lang.String destination)
destination - Where the alerts should be stored
|
Venice 0.74beta | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||