|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.ui.WindowHolder
ucar.unidata.idv.IdvManager
ucar.unidata.idv.StateManager
public class StateManager
This class manages the intialize properties that configure the IDV and the persistent store for writing preferences, etc. to the user's local .metapps directory
| Field Summary | |
|---|---|
protected boolean |
showControlsInTree
Do we show the DisplayControl-s in the DataTree-s. |
protected String |
userName
The name of the user |
| Fields inherited from class ucar.unidata.ui.WindowHolder |
|---|
contents, dialog, frame, window |
| Constructor Summary | |
|---|---|
StateManager(IntegratedDataViewer idv)
Create this manager |
|
| Method Summary | |
|---|---|
String |
applyMacros(String s)
Apply macros |
protected void |
applyPreferences()
|
protected IdvObjectStore |
doMakeObjectStore()
Factory method to create the IdvObjectStore. |
static String |
fixIds(String id)
Change id from application. |
String |
getBuildDate()
Get the build date |
Color |
getColorProperty(String name,
Color dflt)
Utility method to retrieve a String property from the idv properties. |
String |
getDefaultHelpTarget()
Get the default help target. |
String |
getDefaultHelpUrl()
Get the default base help url. |
String |
getHelpRoot()
|
double |
getNumberVersion()
Get major-minor as a number |
Object |
getPreference(String pref)
Helper method that wraps getStore().get (pref) |
Object |
getPreference(String pref,
Object dflt)
Helper method that wraps getStore().get (pref) |
Object |
getPreferenceOrProperty(String pref)
Find either the preference with the given name or, if not found, return the property value of the given name |
String |
getPreferenceOrProperty(String pref,
String dflt)
Find either the preference with the given name or, if not found, return the property String value of the given name if found. |
protected List |
getPreferencePaths()
Get the preference paths |
Hashtable |
getProperties()
Get the hashtable of properties |
Object |
getProperty(String name)
Get a property |
boolean |
getProperty(String name,
boolean dflt)
Utility method to retrieve a boolean property from the idv properties. |
int |
getProperty(String name,
int dflt)
Utility method to retrieve an int property from the idv properties. |
String |
getProperty(String name,
String dflt)
Utility method to retrieve a String property from the idv properties. |
boolean |
getShouldLoadBundlesSynchronously()
Get the flag for loading bundles synchronously |
boolean |
getShowControlsInTree()
Helper method to determine whether to show DisplayControl-s
in the data choosing guis. |
boolean |
getShowDashboardOnStart()
Lookup in the object store whether we should popup a DataSelector in a window on start up. |
IdvObjectStore |
getStore()
Create the IdvObjectStore, if needed, and return it. |
String |
getStoreName()
What is the store name. |
String |
getStoreSystemName()
Get the name of the top level users directory. |
String |
getTitle()
Return the title property |
String |
getUserName()
Return the user name |
String |
getVersion()
Read in and return the current version from the resources/VERSION file. |
String |
getVersionAbout()
Get the version about |
String |
getVersionMajor()
Get the major version |
String |
getVersionMinor()
Get the minor version |
String |
getVersionRevision()
Get the version revision |
Dimension |
getViewSize()
Get the ViewSize property. |
protected void |
initNewUserDirectory(File dir)
This gets called when we first create the users local object store directory. |
protected void |
initObjectStore(IdvObjectStore store)
Initialize the given object store. |
protected void |
initState(boolean interactiveMode)
Initialize the store, properties and IdvResourceManager |
protected void |
initUserDirectory(File dir)
This gets called when after we have created the IdvObjectStore object For now this method just copies the default rbi file into the directory. |
boolean |
isLoadingXml()
Returns whether we are currently unpersisting application state from xml. |
protected void |
loadProperties()
Initialize the list of property files and load them into the idvProperties. |
protected Hashtable |
processPropertyTable(Hashtable newTable)
Change property keys from application. |
void |
putPreference(String pref,
Object value)
Helper method that wraps getStore().put (pref value). |
void |
putProperty(String name,
boolean value)
Converts the given value to a String and sets the property name to the String value |
void |
putProperty(String name,
String value)
Sets the property name to the given value |
void |
setAlwaysLoadBundlesSynchronously(boolean value)
Set the flag to load bundles synchronously |
void |
setViewSize(Dimension value)
Set the ViewSize property. |
void |
writePreference(String pref,
Object value)
Puts the given value in the object store and writes out the store. |
void |
writePreferences()
Writes out the store. |
| Methods inherited from class ucar.unidata.ui.WindowHolder |
|---|
actionPerformed, close, doMakeContents, getContents, getDialog, getFrame, getWindow, getWindowTitle, isShowing, removeAll, setWindowTitle, shouldMakeDialog, show, show, showModal, toFront, windowIsClosing |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean showControlsInTree
protected String userName
| Constructor Detail |
|---|
public StateManager(IntegratedDataViewer idv)
idv - The IDV| Method Detail |
|---|
public void setAlwaysLoadBundlesSynchronously(boolean value)
value - true to load bundles synchronouslypublic boolean getShouldLoadBundlesSynchronously()
protected Hashtable processPropertyTable(Hashtable newTable)
newTable - The table to change
public static String fixIds(String id)
id - id to change
protected void loadProperties()
Now, we look for an "idv.properties" property (which is a semi-colon delimited list of property file paths) in the currently processed property files. If there is one then we create the list of property files, expand any %SITEPATH%, %USERPATH%, etc., macros and process the properties.
Note: Expanding the SITEPATH/USERPATH macros ends up creating the IdvObjectStore (to find the value of SITEPATH/USERPATH/etc.). The tricky thing is that the creation of the object store requires some things that we get from the properties (like the store name). These have to come from the original set of system property files.
public String getHelpRoot()
protected void initState(boolean interactiveMode)
IdvResourceManager
interactiveMode - Is the idv in interactive mode (the default)protected void applyPreferences()
protected List getPreferencePaths()
public String applyMacros(String s)
s - string
public Hashtable getProperties()
public Object getProperty(String name)
name - name of the property
public boolean getProperty(String name,
boolean dflt)
getProperty in class IdvManagername - Property namedflt - The default value to return if name is not found
public int getProperty(String name,
int dflt)
getProperty in class IdvManagername - Property namedflt - The default value to return if name is not found
public String getProperty(String name,
String dflt)
getProperty in class IdvManagername - Property namedflt - The default value to return if name is not found
public Color getColorProperty(String name,
Color dflt)
name - Property namedflt - The default value to return if name is not found
public void putProperty(String name,
String value)
name - Property namevalue - The value
public void putProperty(String name,
boolean value)
name - Property namevalue - The valuepublic IdvObjectStore getStore()
IdvObjectStore, if needed, and return it.
getStore in class IdvManagerpublic String getDefaultHelpUrl()
public String getDefaultHelpTarget()
public boolean isLoadingXml()
public boolean getShowControlsInTree()
DisplayControl-s
in the data choosing guis.
public String getUserName()
public String getTitle()
protected IdvObjectStore doMakeObjectStore()
IdvObjectStore. This
will also call initObjectStore(IdvObjectStore)
protected void initObjectStore(IdvObjectStore store)
store - The object store to initializepublic String getStoreName()
public String getStoreSystemName()
protected void initNewUserDirectory(File dir)
dir - The new directoryprotected void initUserDirectory(File dir)
dir - The store directory
public void writePreference(String pref,
Object value)
pref - The namevalue - The valuepublic void writePreferences()
public void putPreference(String pref,
Object value)
pref - The namevalue - The valuepublic Object getPreference(String pref)
pref - The name of the preference
public Object getPreference(String pref,
Object dflt)
pref - The name of the preferencedflt - The default value to use if pref is not found.
public Object getPreferenceOrProperty(String pref)
pref - The preference or property name
public String getPreferenceOrProperty(String pref,
String dflt)
pref - The preference or property namedflt - default
public boolean getShowDashboardOnStart()
public String getVersionMajor()
public String getVersionMinor()
public String getVersionRevision()
public String getVersionAbout()
public String getVersion()
public String getBuildDate()
public double getNumberVersion()
public void setViewSize(Dimension value)
value - The new value for ViewSizepublic Dimension getViewSize()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||