ucar.unidata.idv
Class IdvObjectStore

java.lang.Object
  extended by ucar.unidata.xml.XmlObjectStore
      extended by ucar.unidata.idv.IdvObjectStore
All Implemented Interfaces:
IdvConstants, PersistentStore

public class IdvObjectStore
extends XmlObjectStore
implements IdvConstants

Provides some IDV specific extensions to the XmlObjectStore. Creates the users local .metapps directory, jython cache dir, etc.

Author:
IDV development team

Field Summary
static String DIR_BUNDLES
          The subdirectory name for holding favorites bundles
static String DIR_SAVEDBUNDLES
          Where we save bundles to
static String PROP_TMPDIR
          tmp dir
 
Fields inherited from class ucar.unidata.xml.XmlObjectStore
tmpFiles
 
Fields inherited from interface ucar.unidata.idv.IdvConstants
ARG_B64BUNDLE, ARG_BUNDLE, ARG_CATALOG, ARG_CHOOSER, ARG_CLEARDEFAULT, ARG_CODE, ARG_CONNECT, ARG_CURRENTTIME, ARG_DATA, ARG_DEBUG, ARG_DEFAULT, ARG_DISPLAY, ARG_DXML, ARG_FIXEDTIME, ARG_HELP, ARG_IMAGE, ARG_IMAGESERVER, ARG_INSTALLPLUGIN, ARG_ISLFILE, ARG_ISLINTERACTIVE, ARG_LISTRESOURCES, ARG_MAINCLASS, ARG_MOVIE, ARG_MSG_DEBUG, ARG_MSG_RECORD, ARG_NODEFAULT, ARG_NOGUI, ARG_NOONEINSTANCE, ARG_NOPLUGINS, ARG_NOPREF, ARG_ONEINSTANCEPORT, ARG_PLUGIN, ARG_PORT, ARG_PRINTJNLP, ARG_PROPERTIES, ARG_SCRIPT, ARG_SERVER, ARG_SETFILES, ARG_SITEPATH, ARG_TEMPLATE, ARG_TEST, ARG_TESTEVAL, ARG_TRACE, ARG_TRACEONLY, ARG_USERPATH, DEFAULT_DATE_FORMAT, DEFAULT_DOCPATH, DEFAULT_TIMEZONE, FILE_VMSTATE, FILTER_CPT, FILTER_ISL, FILTER_JNLP, FILTER_XIDV, FILTER_XIDVZIDV, FILTER_XML, FILTER_ZIDV, ID_COMMANDSTORUN, ID_DATASOURCES, ID_DISPLAYCONTROLS, ID_IDV, ID_JYTHON, ID_MESSAGE, ID_MISCHASHTABLE, ID_VERSION, ID_VIEWMANAGERS, ID_WINDOWS, INITIAL_PROBE_EARTHLOCATION, NULL_DATA_SELECTION, NULL_STRING, PREF_ARCHIVEDIR, PREF_ARCHIVENAME, PREF_AUTODISPLAYS_ENABLE, PREF_AUTODISPLAYS_SHOWGUI, PREF_AUTOSELECTDATA, PREF_CACHESIZE, PREF_CONTROLSINTABS, PREF_DATAPREFIX, PREF_DATE_FORMAT, PREF_DISTANCEUNIT, PREF_DOCACHE, PREF_EMBEDDATACHOOSERINDASHBOARD, PREF_EMBEDFIELDSELECTORINDASHBOARD, PREF_EMBEDLEGENDINDASHBOARD, PREF_EMBEDQUICKLINKSINDASHBOARD, PREF_EVENT_KEYBOARDMAP, PREF_EVENT_MOUSEMAP, PREF_EVENT_WHEELMAP, PREF_FAST_RENDER, PREF_FIELD_CACHETHRESHOLD, PREF_FILEREADDIR, PREF_FILEWRITEDIR, PREF_HISTORY, PREF_LASTVERSION, PREF_LATLON_FORMAT, PREF_LOCALE, PREF_LOOKANDFEEL, PREF_MAXIMAGESIZE, PREF_OPEN_ASK, PREF_OPEN_MERGE, PREF_OPEN_REMOVE, PREF_PROJ_LIST, PREF_SAMPLINGMODE, PREF_SHOWCONTROLWINDOW, PREF_SHOWDASHBOARD, PREF_SHOWDECODEDIALOG, PREF_SHOWHIDDENFILES, PREF_SHOWQUITCONFIRM, PREF_SITEPATH, PREF_TIMEZONE, PREF_VERTICALCS, PREF_VERTICALUNIT, PREF_ZIDV_ASK, PREF_ZIDV_DIRECTORY, PREF_ZIDV_SAVETOTMP, PROP_3DMODE, PROP_ABOUTTEXT, PROP_APPRESOURCEPATH, PROP_CHOOSERS, PROP_CHOOSERS_ALL, PROP_CONTROLDESCRIPTORS, PROP_CONTROLDESCRIPTORS_ALL, PROP_DATAHOLDERBOUNDS, PROP_DEFAULTLOCATIONS, PROP_JNLPCODEBASE, PROP_JNLPTEMPLATE, PROP_JNLPTITLE, PROP_LOADINGXML, PROP_OLDCONTROLDESCRIPTORS, PROP_ONEINSTANCEPORT, PROP_PREFERENCES, PROP_PROJ_NAME, PROP_RESOURCEFILES, PROP_SHOWDASHBOARD, PROP_SHOWDATATREE, PROP_SHOWFORMULAS, PROP_SHOWSPLASH, PROP_SPLASHICON, PROP_UI_DESKTOP, PROP_VERSIONFILE, PROP_WINDOW_SCREENSIZEOFFSET, PROP_WINDOW_SIZEHEIGHT, PROP_WINDOW_SIZEWIDTH, PROP_WINDOW_USESCREENSIZE, SUFFIX_BAT, SUFFIX_CPT, SUFFIX_ISL, SUFFIX_JNLP, SUFFIX_RBI, SUFFIX_SH, SUFFIX_XIDV, SUFFIX_XML, SUFFIX_ZIDV
 
Constructor Summary
IdvObjectStore(IntegratedDataViewer idv, String systemName, String appName, XmlEncoder encoder, String overrideUserDirectory)
          Create the store.
 
Method Summary
 Object get(String key)
          Return the obejct held in the table identified by the given key.
 String getDataSourcesDir()
          Return the full path to the directory where we save the display control templates
 String getDisplayTemplateDir()
          Return the full path to the directory where we save the display control templates
 String getJythonCacheDir()
          Create, if needed, and return the directory to use for the jython cache.
 String getLocalBundlesDir()
          Return the full path to the directory where we save the user's local bundles
 boolean getMadeUserDirectory()
          Get the MadeUserDirectory property.
 String getPluginsDir()
          Return the full path to the directory where we look for plugins
 File getSavedBundlesDir()
          Return the full path to the directory where we save the user's local bundles
 String getSystemDirectory()
          Get the path to the system directory.
 File getUserDirectory()
          Get the users local directory.
protected  Hashtable processTable(Hashtable newTable)
          Overrwrite base class method to tweak any old property names
 void setOverrideDirectory(File newDirectory)
          Set the override directory.
 
Methods inherited from class ucar.unidata.xml.XmlObjectStore
append, cleanupTmpDirectory, cleanupTmpFiles, get, get, get, get, get, get, get, get, get, get, get, getEncodedFile, getEncoder, getFileContents, getTmpFile, getUniqueTmpDirectory, getUniqueTmpFile, getUserTmpDirectory, init, main, put, put, put, put, put, put, put, put, put, putEncodedFile, putFile, remove, save, saveIfNeeded, setEncoder, setTmpDir, userDirectoryOk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_TMPDIR

public static final String PROP_TMPDIR
tmp dir

See Also:
Constant Field Values

DIR_BUNDLES

public static final String DIR_BUNDLES
The subdirectory name for holding favorites bundles

See Also:
Constant Field Values

DIR_SAVEDBUNDLES

public static final String DIR_SAVEDBUNDLES
Where we save bundles to

See Also:
Constant Field Values
Constructor Detail

IdvObjectStore

public IdvObjectStore(IntegratedDataViewer idv,
                      String systemName,
                      String appName,
                      XmlEncoder encoder,
                      String overrideUserDirectory)
Create the store.

Parameters:
idv - The IntegratedDataViewer for this object store
systemName - The name of the top level directory (e.g., .metapps)
appName - The name of the subdir (e.g., DefaultIdv)
encoder - The encoder to use for writing out and reading in the store
overrideUserDirectory - If non-null this overrides wehre we look for the user's home directory. Else we use the user.home system property.
Method Detail

getMadeUserDirectory

public boolean getMadeUserDirectory()
Get the MadeUserDirectory property. Was the user's directory created now.

Returns:
The MadeUserDirectory

getSystemDirectory

public String getSystemDirectory()
Get the path to the system directory. Ex: ~/.metapps

Returns:
The system directory path.

processTable

protected Hashtable processTable(Hashtable newTable)
Overrwrite base class method to tweak any old property names

Overrides:
processTable in class XmlObjectStore
Parameters:
newTable - The table to process
Returns:
The tweaked table

getJythonCacheDir

public String getJythonCacheDir()
Create, if needed, and return the directory to use for the jython cache.

Returns:
The jython cache directory

getUserDirectory

public File getUserDirectory()
Get the users local directory. Example: ~/.metapps.DefaultIdv

Overrides:
getUserDirectory in class XmlObjectStore
Returns:
The user's local IDV directory

setOverrideDirectory

public void setOverrideDirectory(File newDirectory)
Set the override directory.

Parameters:
newDirectory - dir to use

getDisplayTemplateDir

public String getDisplayTemplateDir()
Return the full path to the directory where we save the display control templates

Returns:
Template directory

getDataSourcesDir

public String getDataSourcesDir()
Return the full path to the directory where we save the display control templates

Returns:
Template directory

getPluginsDir

public String getPluginsDir()
Return the full path to the directory where we look for plugins

Returns:
Plugins directory

getLocalBundlesDir

public String getLocalBundlesDir()
Return the full path to the directory where we save the user's local bundles

Returns:
Bundle directory

getSavedBundlesDir

public File getSavedBundlesDir()
Return the full path to the directory where we save the user's local bundles

Returns:
Bundle directory

get

public Object get(String key)
Return the obejct held in the table identified by the given key. Override the base class method. If the property is not in the main.xml then check the idv properties

Overrides:
get in class XmlObjectStore
Parameters:
key - The object's key.
Returns:
The Object identified by the given key or null if not found.