ucar.unidata.idv
Class IdvResourceManager

java.lang.Object
  extended by ucar.unidata.ui.WindowHolder
      extended by ucar.unidata.idv.IdvManager
          extended by ucar.unidata.idv.IdvResourceManager
All Implemented Interfaces:
ActionListener, EventListener, HyperlinkListener, IdvConstants

public class IdvResourceManager
extends IdvManager
implements HyperlinkListener

This class manages the set of resources that are used to instantiate the IDV. The idea is that the idv has a number of "rbi" (resource bundle for the idv) files that define the different collections of resources. For each collection (e.g., colortables, derived quantities) there is a list of locations that specify the file (either xml or text) that defines the particular resource.

For example in resources/idv.rbi we have:

 <resources name="idv.resource.colortables">
   <resource location="%USERPATH%/colortables.xml"/>
   <resource location="%SITEPATH%/colortables.xml"/>
   <resource location="%IDVPATH%/colortables.xml"/>
 </resources>
 
This defines the collection of color table resources. The %USERPATH%, etc., are macros that are replaced with the corresponding value.

This class has a set of static IdvResource and XmlIdvResource members, one for each resource collection, e.g., RSC_COLORTABLES. The IdvResource objects are those that point to text resources. The XmlIdvResource objects point to xml files. These objects provide methods to access the ResourceCollection and XmlResourceCollection objects that actually do the work of reading in the resources, creating the xml doms, etc.

Author:
IDV development team

Nested Class Summary
static class IdvResourceManager.IdvResource
          Class IdvResource holds the resources files for a particular type of resource
static class IdvResourceManager.XmlIdvResource
          Class XmlIdvResource.
 
Field Summary
static String ATTR_ID
          Xml attr name for the "id" attribute in the rbi file
static String ATTR_LABEL
          Xml attr name for the "label" attribute in the rbi file
static String ATTR_LOADMORE
          Xml attr name for the "loadmore" attribute in the rbi file
static String ATTR_LOCATION
          Xml attr name for the "location" attribute in the rbi file
static String ATTR_NAME
          xml attribute
static String ATTR_REMOVEPREVIOUS
          Xml attr name for the "removeprevious" attribute in the rbi file
static String ATTR_RESOURCETYPE
          Xml attr name for the "type" attribute in the rbi file
static String ATTR_VALUE
          Xml attr name for the "value" attribute in the rbi file
protected static List resources
          List of static IdvResource objects
static IdvResourceManager.XmlIdvResource RSC_ACTIONS
          Points to the skin xml
static IdvResourceManager.IdvResource RSC_ADDESERVER
          Points to the adde server descriptions
static IdvResourceManager.IdvResource RSC_ALIASES
          Points to data aliases
static IdvResourceManager.XmlIdvResource RSC_AUTODISPLAYS
          Points to the automatic display creation xml
static IdvResourceManager.XmlIdvResource RSC_BACKGROUNDWMS
          Points to the background image defaults
static IdvResourceManager.IdvResource RSC_BUNDLES
          Points to xidv bundle files
static IdvResourceManager.IdvResource RSC_BUNDLEXML
          Points to canned bundles
static IdvResourceManager.IdvResource RSC_CHOOSERS
          Points to the specification of the choosers ui
static IdvResourceManager.XmlIdvResource RSC_COLORPAIRS
          Points to the pairs of foreground/background colors
static IdvResourceManager.IdvResource RSC_COLORTABLES
          Points to the color tables
static IdvResourceManager.IdvResource RSC_CONTROLS
          Points to the control descriptor specification
static IdvResourceManager.IdvResource RSC_DATASOURCE
          Points to the data source descriptions
static IdvResourceManager.IdvResource RSC_DERIVED
          Points to the derived quantities and end user formulas
static IdvResourceManager.IdvResource RSC_DISPLAYSETTINGS
          Points to the projections
static IdvResourceManager.IdvResource RSC_GEMPAKGRIDPARAMTABLES
          Points to the gempak parameter look up tables
static IdvResourceManager.IdvResource RSC_GLOBEMAPS
          Points to the maps
static IdvResourceManager.IdvResource RSC_GRIB1LOOKUPTABLES
          Points to the grib look up tables
static IdvResourceManager.IdvResource RSC_GRIB2LOOKUPTABLES
          Points to the grib look up tables
static IdvResourceManager.IdvResource RSC_HELPTIPS
          Points to the help tips
static IdvResourceManager.XmlIdvResource RSC_IMAGEDEFAULTS
          Points to the adde image defaults
static IdvResourceManager.XmlIdvResource RSC_IMAGESETS
          Points to the background image defaults
static IdvResourceManager.IdvResource RSC_JYTHON
          Points to jython libraries
static IdvResourceManager.IdvResource RSC_JYTHONTOCOPY
          Points to jython libraries that are to be copied into the local Jython directory
static IdvResourceManager.IdvResource RSC_LOCATIONS
          Points to the location files (e.g., nexrad stations)
static IdvResourceManager.IdvResource RSC_MAPS
          Points to the maps
static IdvResourceManager.IdvResource RSC_MENUBAR
          Points to the menu bar xml
static IdvResourceManager.IdvResource RSC_MESSAGES
          Points to the message catalogs
static IdvResourceManager.IdvResource RSC_NJCONFIG
          Points to netcdf-Java config files
static IdvResourceManager.IdvResource RSC_PARAMDEFAULTS
          Points to the parameter defaults
static IdvResourceManager.IdvResource RSC_PARAMGROUPS
          Points to the parameter groups
static IdvResourceManager.IdvResource RSC_PLUGININDEX
          resource listing the plugins index
static IdvResourceManager.IdvResource RSC_PLUGINS
          Points to plugin
static IdvResourceManager.IdvResource RSC_PREFERENCES
          Points to user preferences
static IdvResourceManager.IdvResource RSC_PROJECTIONS
          Points to the projections
static IdvResourceManager.IdvResource RSC_PROTOTYPES
          Points to prototypes
static IdvResourceManager.IdvResource RSC_PUBLISHERS
          Publishers
static IdvResourceManager.IdvResource RSC_PUBLISHERTYPES
          Publishers
static IdvResourceManager.IdvResource RSC_QUICKLINKS
          Points to the quicklink pages
static IdvResourceManager.XmlIdvResource RSC_SKIN
          Points to the skin xml
static IdvResourceManager.IdvResource RSC_STATIONMODELS
          Points to station models
static IdvResourceManager.XmlIdvResource RSC_STATIONSYMBOLS
          Points to station model symbols
static IdvResourceManager.XmlIdvResource RSC_TOOLBAR
          Points to the skin xml
static IdvResourceManager.IdvResource RSC_TRANSECTS
          Points to the projections
static IdvResourceManager.IdvResource RSC_USERCHOOSER
          Points to the user created chooser components
static IdvResourceManager.IdvResource RSC_VIEWPOINTS
          viewpoints
static String TAG_PROPERTY
          Xml tag name
static String TAG_RESOURCE
          Xml tag name for the "resource" tag in the rbi file
static String TAG_RESOURCEBUNDLE
          resource bundle tag
static String TAG_RESOURCES
          Xml tag name for the "resources" tag in the rbi file
 
Fields inherited from class ucar.unidata.ui.WindowHolder
contents, dialog, frame, window
 
Fields inherited from interface ucar.unidata.idv.IdvConstants
ARG_B64BUNDLE, ARG_B64ISL, 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_NOERRORSINGUI, 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_MAX_PERMGENSIZE, DEFAULT_TIMEZONE, 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_GEOMETRY_BY_REF, PREF_HISTORY, PREF_IMAGE_BY_REF, PREF_LASTVERSION, PREF_LATLON_FORMAT, PREF_LEGEND_SHOWICONS, PREF_LOCALE, PREF_LOOKANDFEEL, PREF_MAX_PERMGENSIZE, PREF_MAXIMAGESIZE, PREF_MEMORY, PREF_NPOT_IMAGE, 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_THREADS_DATA, PREF_THREADS_RENDER, PREF_TIMEZONE, PREF_VERTICALCS, PREF_VERTICALUNIT, PREF_WINDOW_SHOWTOOLBAR, 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_DISPLAYLIST_GROUP, PROP_FIXFILELOCKUP, PROP_JNLPCODEBASE, PROP_JNLPTEMPLATE, PROP_JNLPTITLE, PROP_LOADINGXML, PROP_MAP_GLOBE_LEVEL, PROP_MAP_MAP_LEVEL, PROP_MINIMUMFRAMECYCLETIME, PROP_MONITORPORT, PROP_OLDCONTROLDESCRIPTORS, PROP_ONEINSTANCEPORT, PROP_PREFERENCES, PROP_PROJ_NAME, PROP_RESOURCEFILES, PROP_SHOWCLOCK, PROP_SHOWDASHBOARD, PROP_SHOWDATATREE, PROP_SHOWFORMULAS, PROP_SHOWSPLASH, PROP_SPLASHICON, PROP_UI_DESKTOP, PROP_USE_TIMEDRIVER, 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
IdvResourceManager(IntegratedDataViewer idv)
          Create me
 
Method Summary
 void addDisplaySetting(DisplaySetting displaySetting)
          Add new display setting
 void clearDefaultBundles()
          Remove all default bundles
 void clearResourceMacros()
          Clear the macro values
 MapInfo createMapInfo(boolean forGlobe)
          A utility to instantiate a MapInfo from the maps resources
protected  ResourceCollection createResourceCollection(String id)
          Create, if needed, and return the ResourceCollection defined by the given id
protected  XmlResourceCollection createXmlResourceCollection(String id)
          Create, if needed, and return the XmlResourceCollection defined by the given id
 void displaySettingChanged(DisplaySetting displaySetting)
          handle when a display setting changed
 DisplaySetting findDisplaySetting(String name)
          Find display setting by name
 NamedStationTable findLocations(String name)
          Find the NamedStationTable with the given name
 List findLocationsByType(String type)
          Find the NamedStationTable with the given name
 String getAppResourcePath()
          Return the path used to substitute the %APPPATH% macro for in the resource list properties.
 String getDataResourcePath()
          Return the path used to substitute the %DATAPATH% macro for in the resource list properties.
 NamedStationTable getDefaultStations()
          Find the default NamedStationTable
 List<DisplaySetting> getDisplaySettings()
          Get all display settings
 long getDisplaySettingsTimestamp()
          get timestamp
 String getHtmlView()
          Create the html representation of the list of resources.
 String getIdvResourcePath()
          Return the path used to substitute the %IDVPATH% macro for in the resource list properties.
 List getLocationList()
          Create (if null) and return the list NamedStationTable-s defined by the locationResources XmlResourceCollection.
protected  Hashtable getMacroMap()
          Get map of macro name -> value.
 XmlResourceCollection getMapResources(boolean forGlobe)
          _more_
 List<MapData> getMaps()
          _more_
protected  List getResourceList(String propName)
          Do a property lookup of the given resource list property.
 String getResourcePath(String path)
          Do the macro expansion
 List getResourcePaths(List paths)
          For each string in the given paths list do a textual substitution of a set of macros with their values (e.g., %USERPATH%).
 List getResources()
          Get the resources
 ResourceCollection getResources(IdvResourceManager.IdvResource resource)
          Create, if needed, and return the ResourceCollection that is represented by the given resource.
 ResourceCollection getResources(String id)
          Lookup up in the resource collections map the ResouceCollection with the given id
 List getResourcesForUser()
          Get the list of resources for the user
 String getResourceUrlBase()
          A hardcoded url base to find resources at
 String getSitePath()
          Return the path used to substitute the %SITEPATH% macro for in the resource list properties.
 List getTransects()
          Get the list of transects
 String getUserHome()
          Return the path used to substitute the %USERHOME% macro for in the resource list properties.
 String getUserPath()
          Return the path used to substitute the %USERPATH% macro for in the resource list properties.
 XmlResourceCollection getXmlResources(IdvResourceManager.IdvResource resource)
          Create, if needed, and return the XmlResourceCollection that is represented by the given resource.
 XmlResourceCollection getXmlResources(String name)
          Lookup up in the resource collections map the XmlResouceCollection with the given id
 void hyperlinkUpdate(HyperlinkEvent e)
          Respond to events from the html view.
protected  void init(List rbiFiles)
          Create the set of resources (defined in the idv.properties file) and do the relevant initializations.
 void processRbi(Element root)
          Process the top level root of the rbi xml file
protected  void processRbi(Element root, boolean payAttentionToLoadMore)
          Process the top level root of the rbi xml file
 void removeDisplaySetting(DisplaySetting displaySetting)
          Remove display setting
 void removeDisplaySettings(List<DisplaySetting> list)
          Remove list of display settings
 boolean removeLocalMaps(boolean forGlobe)
          Remove any local maps.xml file
 void removeResources(String id)
          Remove the resources identified by id
 void showHtmlView()
          Show the html representation of the list of resources
 void writeMapState(String mapsXml, boolean forGlobe)
          Write out the given maps xml to the writable resource
 void writeTransects(List t)
          Write the non-system transects in the list to the users transects resource file
 
Methods inherited from class ucar.unidata.idv.IdvManager
getArgsManager, getCollabManager, getColorTableManager, getDataManager, getIdv, getIdvChooserManager, getIdvClass, getIdvProjectionManager, getIdvUIManager, getImageGenerator, getInstallManager, getJythonManager, getPersistenceManager, getPreferenceManager, getProperty, getProperty, getProperty, getPublishManager, getResourceManager, getStateManager, getStationModelManager, getStore, getVMManager, logException, showNormalCursor, showWaitCursor, waitUntilDisplaysAreDone, waitUntilDisplaysAreDone
 
Methods inherited from class ucar.unidata.ui.WindowHolder
actionPerformed, close, doMakeContents, getContents, getDialog, getFrame, getWindow, getWindowTitle, isShowing, removeAll, setMenuBar, 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

TAG_RESOURCES

public static final String TAG_RESOURCES
Xml tag name for the "resources" tag in the rbi file

See Also:
Constant Field Values

TAG_RESOURCEBUNDLE

public static final String TAG_RESOURCEBUNDLE
resource bundle tag

See Also:
Constant Field Values

TAG_RESOURCE

public static final String TAG_RESOURCE
Xml tag name for the "resource" tag in the rbi file

See Also:
Constant Field Values

TAG_PROPERTY

public static final String TAG_PROPERTY
Xml tag name

See Also:
Constant Field Values

ATTR_LOADMORE

public static final String ATTR_LOADMORE
Xml attr name for the "loadmore" attribute in the rbi file

See Also:
Constant Field Values

ATTR_REMOVEPREVIOUS

public static final String ATTR_REMOVEPREVIOUS
Xml attr name for the "removeprevious" attribute in the rbi file

See Also:
Constant Field Values

ATTR_NAME

public static final String ATTR_NAME
xml attribute

See Also:
Constant Field Values

ATTR_ID

public static final String ATTR_ID
Xml attr name for the "id" attribute in the rbi file

See Also:
Constant Field Values

ATTR_VALUE

public static final String ATTR_VALUE
Xml attr name for the "value" attribute in the rbi file

See Also:
Constant Field Values

ATTR_LABEL

public static final String ATTR_LABEL
Xml attr name for the "label" attribute in the rbi file

See Also:
Constant Field Values

ATTR_LOCATION

public static final String ATTR_LOCATION
Xml attr name for the "location" attribute in the rbi file

See Also:
Constant Field Values

ATTR_RESOURCETYPE

public static final String ATTR_RESOURCETYPE
Xml attr name for the "type" attribute in the rbi file

See Also:
Constant Field Values

resources

protected static List resources
List of static IdvResource objects


RSC_COLORTABLES

public static final IdvResourceManager.IdvResource RSC_COLORTABLES
Points to the color tables


RSC_STATIONMODELS

public static final IdvResourceManager.IdvResource RSC_STATIONMODELS
Points to station models


RSC_VIEWPOINTS

public static final IdvResourceManager.IdvResource RSC_VIEWPOINTS
viewpoints


RSC_PROJECTIONS

public static final IdvResourceManager.IdvResource RSC_PROJECTIONS
Points to the projections


RSC_PARAMDEFAULTS

public static final IdvResourceManager.IdvResource RSC_PARAMDEFAULTS
Points to the parameter defaults


RSC_DISPLAYSETTINGS

public static final IdvResourceManager.IdvResource RSC_DISPLAYSETTINGS
Points to the projections


RSC_ALIASES

public static final IdvResourceManager.IdvResource RSC_ALIASES
Points to data aliases


RSC_BUNDLEXML

public static final IdvResourceManager.IdvResource RSC_BUNDLEXML
Points to canned bundles


RSC_DERIVED

public static final IdvResourceManager.IdvResource RSC_DERIVED
Points to the derived quantities and end user formulas


RSC_JYTHON

public static final IdvResourceManager.IdvResource RSC_JYTHON
Points to jython libraries


RSC_SKIN

public static final IdvResourceManager.XmlIdvResource RSC_SKIN
Points to the skin xml


RSC_QUICKLINKS

public static final IdvResourceManager.IdvResource RSC_QUICKLINKS
Points to the quicklink pages


RSC_TRANSECTS

public static final IdvResourceManager.IdvResource RSC_TRANSECTS
Points to the projections


RSC_MESSAGES

public static final IdvResourceManager.IdvResource RSC_MESSAGES
Points to the message catalogs


RSC_GRIB1LOOKUPTABLES

public static final IdvResourceManager.IdvResource RSC_GRIB1LOOKUPTABLES
Points to the grib look up tables


RSC_GRIB2LOOKUPTABLES

public static final IdvResourceManager.IdvResource RSC_GRIB2LOOKUPTABLES
Points to the grib look up tables


RSC_GEMPAKGRIDPARAMTABLES

public static final IdvResourceManager.IdvResource RSC_GEMPAKGRIDPARAMTABLES
Points to the gempak parameter look up tables


RSC_JYTHONTOCOPY

public static final IdvResourceManager.IdvResource RSC_JYTHONTOCOPY
Points to jython libraries that are to be copied into the local Jython directory


RSC_IMAGEDEFAULTS

public static final IdvResourceManager.XmlIdvResource RSC_IMAGEDEFAULTS
Points to the adde image defaults


RSC_BACKGROUNDWMS

public static final IdvResourceManager.XmlIdvResource RSC_BACKGROUNDWMS
Points to the background image defaults


RSC_IMAGESETS

public static final IdvResourceManager.XmlIdvResource RSC_IMAGESETS
Points to the background image defaults


RSC_AUTODISPLAYS

public static final IdvResourceManager.XmlIdvResource RSC_AUTODISPLAYS
Points to the automatic display creation xml


RSC_TOOLBAR

public static final IdvResourceManager.XmlIdvResource RSC_TOOLBAR
Points to the skin xml


RSC_ACTIONS

public static final IdvResourceManager.XmlIdvResource RSC_ACTIONS
Points to the skin xml


RSC_STATIONSYMBOLS

public static final IdvResourceManager.XmlIdvResource RSC_STATIONSYMBOLS
Points to station model symbols


RSC_COLORPAIRS

public static final IdvResourceManager.XmlIdvResource RSC_COLORPAIRS
Points to the pairs of foreground/background colors


RSC_DATASOURCE

public static final IdvResourceManager.IdvResource RSC_DATASOURCE
Points to the data source descriptions


RSC_ADDESERVER

public static final IdvResourceManager.IdvResource RSC_ADDESERVER
Points to the adde server descriptions


RSC_CHOOSERS

public static final IdvResourceManager.IdvResource RSC_CHOOSERS
Points to the specification of the choosers ui


RSC_BUNDLES

public static final IdvResourceManager.IdvResource RSC_BUNDLES
Points to xidv bundle files


RSC_CONTROLS

public static final IdvResourceManager.IdvResource RSC_CONTROLS
Points to the control descriptor specification


RSC_HELPTIPS

public static final IdvResourceManager.IdvResource RSC_HELPTIPS
Points to the help tips


RSC_LOCATIONS

public static final IdvResourceManager.IdvResource RSC_LOCATIONS
Points to the location files (e.g., nexrad stations)


RSC_GLOBEMAPS

public static final IdvResourceManager.IdvResource RSC_GLOBEMAPS
Points to the maps


RSC_MAPS

public static final IdvResourceManager.IdvResource RSC_MAPS
Points to the maps


RSC_MENUBAR

public static final IdvResourceManager.IdvResource RSC_MENUBAR
Points to the menu bar xml


RSC_PARAMGROUPS

public static final IdvResourceManager.IdvResource RSC_PARAMGROUPS
Points to the parameter groups


RSC_USERCHOOSER

public static final IdvResourceManager.IdvResource RSC_USERCHOOSER
Points to the user created chooser components


RSC_PREFERENCES

public static final IdvResourceManager.IdvResource RSC_PREFERENCES
Points to user preferences


RSC_PLUGINS

public static final IdvResourceManager.IdvResource RSC_PLUGINS
Points to plugin


RSC_PLUGININDEX

public static final IdvResourceManager.IdvResource RSC_PLUGININDEX
resource listing the plugins index


RSC_PROTOTYPES

public static final IdvResourceManager.IdvResource RSC_PROTOTYPES
Points to prototypes


RSC_NJCONFIG

public static final IdvResourceManager.IdvResource RSC_NJCONFIG
Points to netcdf-Java config files


RSC_PUBLISHERS

public static final IdvResourceManager.IdvResource RSC_PUBLISHERS
Publishers


RSC_PUBLISHERTYPES

public static final IdvResourceManager.IdvResource RSC_PUBLISHERTYPES
Publishers

Constructor Detail

IdvResourceManager

public IdvResourceManager(IntegratedDataViewer idv)
Create me

Parameters:
idv - The IDV
Method Detail

getResources

public List getResources()
Get the resources

Returns:
List of all resources

getResourcesForUser

public List getResourcesForUser()
Get the list of resources for the user

Returns:
the list of resources

getResources

public ResourceCollection getResources(IdvResourceManager.IdvResource resource)
Create, if needed, and return the ResourceCollection that is represented by the given resource.

Parameters:
resource - The resource
Returns:
The resource collection

getXmlResources

public XmlResourceCollection getXmlResources(IdvResourceManager.IdvResource resource)
Create, if needed, and return the XmlResourceCollection that is represented by the given resource.

Parameters:
resource - The resource
Returns:
The resource collection

clearDefaultBundles

public void clearDefaultBundles()
Remove all default bundles


showHtmlView

public void showHtmlView()
Show the html representation of the list of resources


getHtmlView

public String getHtmlView()
Create the html representation of the list of resources.

Returns:
The html

hyperlinkUpdate

public void hyperlinkUpdate(HyperlinkEvent e)
Respond to events from the html view. Bring up the editor for the resource if there is one, etc.

Specified by:
hyperlinkUpdate in interface HyperlinkListener
Parameters:
e - The event

processRbi

public void processRbi(Element root)
Process the top level root of the rbi xml file

Parameters:
root - The root of the rbi file

processRbi

protected void processRbi(Element root,
                          boolean payAttentionToLoadMore)
Process the top level root of the rbi xml file

Parameters:
root - The root of the rbi file
payAttentionToLoadMore - Flags whether we should stop processing when we encounter a "loadmore" tag in the rbi xml

createResourceCollection

protected ResourceCollection createResourceCollection(String id)
Create, if needed, and return the ResourceCollection defined by the given id

Parameters:
id - The id of the resource, e.g., idv.resource.colortables
Returns:
The resource collection

createXmlResourceCollection

protected XmlResourceCollection createXmlResourceCollection(String id)
Create, if needed, and return the XmlResourceCollection defined by the given id

Parameters:
id - The id of the resource, e.g., idv.resource.colortables
Returns:
The xml resource collection

getResources

public ResourceCollection getResources(String id)
Lookup up in the resource collections map the ResouceCollection with the given id

Parameters:
id - The resource id
Returns:
The resource collection or null if not found

removeResources

public void removeResources(String id)
Remove the resources identified by id

Parameters:
id - id of the resource to remove

getXmlResources

public XmlResourceCollection getXmlResources(String name)
Lookup up in the resource collections map the XmlResouceCollection with the given id

Parameters:
name - The resource name
Returns:
The xml resource collection or null if not found

init

protected void init(List rbiFiles)
Create the set of resources (defined in the idv.properties file) and do the relevant initializations.

Parameters:
rbiFiles - List of rbi files

getResourceList

protected List getResourceList(String propName)
Do a property lookup of the given resource list property. Turn the String property value (";" delimited) into a List of Strings Do a textual substitution of a set of macros with their values (e.g., %USERPATH%).

Parameters:
propName - The property name
Returns:
List of expanded Strings

getResourcePaths

public List getResourcePaths(List paths)
For each string in the given paths list do a textual substitution of a set of macros with their values (e.g., %USERPATH%).

Parameters:
paths - Incoming strings
Returns:
Expanded strings

clearResourceMacros

public void clearResourceMacros()
Clear the macro values


getMacroMap

protected Hashtable getMacroMap()
Get map of macro name -> value. eg: the SITEPATH, USERPATH, etc.

Returns:
macros

getResourcePath

public String getResourcePath(String path)
Do the macro expansion

Parameters:
path - Macro containing patha
Returns:
Expanded path

getLocationList

public List getLocationList()
Create (if null) and return the list NamedStationTable-s defined by the locationResources XmlResourceCollection.

Returns:
List of named station tables

getIdvResourcePath

public String getIdvResourcePath()
Return the path used to substitute the %IDVPATH% macro for in the resource list properties.

Returns:
idv path

getUserHome

public String getUserHome()
Return the path used to substitute the %USERHOME% macro for in the resource list properties.

Returns:
idv path

getDataResourcePath

public String getDataResourcePath()
Return the path used to substitute the %DATAPATH% macro for in the resource list properties.

Returns:
The data path

getAppResourcePath

public String getAppResourcePath()
Return the path used to substitute the %APPPATH% macro for in the resource list properties.

Returns:
The app path

getSitePath

public String getSitePath()
Return the path used to substitute the %SITEPATH% macro for in the resource list properties.

Returns:
The site path

getUserPath

public String getUserPath()
Return the path used to substitute the %USERPATH% macro for in the resource list properties.

Returns:
The user path (e.g., ~/.unidata/idv/DefaultIdv)

removeLocalMaps

public boolean removeLocalMaps(boolean forGlobe)
Remove any local maps.xml file

Parameters:
forGlobe - if true then use the globemaps resource
Returns:
Was there one removed

getMapResources

public XmlResourceCollection getMapResources(boolean forGlobe)
_more_

Parameters:
forGlobe - _more_
Returns:
_more_

getMaps

public List<MapData> getMaps()
_more_

Returns:
_more_

createMapInfo

public MapInfo createMapInfo(boolean forGlobe)
A utility to instantiate a MapInfo from the maps resources

Parameters:
forGlobe - if true then use the globemaps resource
Returns:
The MapInfo holding the map stuff.

writeMapState

public void writeMapState(String mapsXml,
                          boolean forGlobe)
Write out the given maps xml to the writable resource

Parameters:
mapsXml - The maps xml
forGlobe - if true then use the globemaps resource

getDefaultStations

public NamedStationTable getDefaultStations()
Find the default NamedStationTable

Returns:
The default stations

findLocationsByType

public List findLocationsByType(String type)
Find the NamedStationTable with the given name

Parameters:
type - type
Returns:
The list of stations

findLocations

public NamedStationTable findLocations(String name)
Find the NamedStationTable with the given name

Parameters:
name - Name of station
Returns:
The station

getResourceUrlBase

public String getResourceUrlBase()
A hardcoded url base to find resources at

Returns:
http url resource base

getTransects

public List getTransects()
Get the list of transects

Returns:
List of transects

writeTransects

public void writeTransects(List t)
Write the non-system transects in the list to the users transects resource file

Parameters:
t - List of transects

getDisplaySettings

public List<DisplaySetting> getDisplaySettings()
Get all display settings

Returns:
display settings

findDisplaySetting

public DisplaySetting findDisplaySetting(String name)
Find display setting by name

Parameters:
name - name
Returns:
displaysetting

displaySettingChanged

public void displaySettingChanged(DisplaySetting displaySetting)
handle when a display setting changed

Parameters:
displaySetting - display setting that changed

addDisplaySetting

public void addDisplaySetting(DisplaySetting displaySetting)
Add new display setting

Parameters:
displaySetting - display setting

removeDisplaySettings

public void removeDisplaySettings(List<DisplaySetting> list)
Remove list of display settings

Parameters:
list - list

removeDisplaySetting

public void removeDisplaySetting(DisplaySetting displaySetting)
Remove display setting

Parameters:
displaySetting - display setting

getDisplaySettingsTimestamp

public long getDisplaySettingsTimestamp()
get timestamp

Returns:
timestamp_