|
||||||||||
| 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.IdvResourceManager
public class IdvResourceManager
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.
| 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_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_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 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 |
| 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()
A utility to instantiate a MapInfo from the maps resources |
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 |
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. |
List |
getMaps()
Get the list of maps/descriptions from the maps resources. |
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 list)
Remove list of display settings |
boolean |
removeLocalMaps()
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)
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.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 |
|---|
public static final String TAG_RESOURCES
public static final String TAG_RESOURCEBUNDLE
public static final String TAG_RESOURCE
public static final String TAG_PROPERTY
public static final String ATTR_LOADMORE
public static final String ATTR_REMOVEPREVIOUS
public static final String ATTR_NAME
public static final String ATTR_ID
public static final String ATTR_VALUE
public static final String ATTR_LABEL
public static final String ATTR_LOCATION
public static final String ATTR_RESOURCETYPE
protected static List resources
public static final IdvResourceManager.IdvResource RSC_COLORTABLES
public static final IdvResourceManager.IdvResource RSC_STATIONMODELS
public static final IdvResourceManager.IdvResource RSC_PROJECTIONS
public static final IdvResourceManager.IdvResource RSC_PARAMDEFAULTS
public static final IdvResourceManager.IdvResource RSC_DISPLAYSETTINGS
public static final IdvResourceManager.IdvResource RSC_ALIASES
public static final IdvResourceManager.IdvResource RSC_BUNDLEXML
public static final IdvResourceManager.IdvResource RSC_DERIVED
public static final IdvResourceManager.IdvResource RSC_JYTHON
public static final IdvResourceManager.XmlIdvResource RSC_SKIN
public static final IdvResourceManager.IdvResource RSC_QUICKLINKS
public static final IdvResourceManager.IdvResource RSC_TRANSECTS
public static final IdvResourceManager.IdvResource RSC_MESSAGES
public static final IdvResourceManager.IdvResource RSC_GRIB1LOOKUPTABLES
public static final IdvResourceManager.IdvResource RSC_GRIB2LOOKUPTABLES
public static final IdvResourceManager.IdvResource RSC_GEMPAKGRIDPARAMTABLES
public static final IdvResourceManager.IdvResource RSC_JYTHONTOCOPY
public static final IdvResourceManager.XmlIdvResource RSC_IMAGEDEFAULTS
public static final IdvResourceManager.XmlIdvResource RSC_BACKGROUNDWMS
public static final IdvResourceManager.XmlIdvResource RSC_IMAGESETS
public static final IdvResourceManager.XmlIdvResource RSC_AUTODISPLAYS
public static final IdvResourceManager.XmlIdvResource RSC_TOOLBAR
public static final IdvResourceManager.XmlIdvResource RSC_ACTIONS
public static final IdvResourceManager.XmlIdvResource RSC_STATIONSYMBOLS
public static final IdvResourceManager.XmlIdvResource RSC_COLORPAIRS
public static final IdvResourceManager.IdvResource RSC_DATASOURCE
public static final IdvResourceManager.IdvResource RSC_ADDESERVER
public static final IdvResourceManager.IdvResource RSC_CHOOSERS
public static final IdvResourceManager.IdvResource RSC_BUNDLES
public static final IdvResourceManager.IdvResource RSC_CONTROLS
public static final IdvResourceManager.IdvResource RSC_HELPTIPS
public static final IdvResourceManager.IdvResource RSC_LOCATIONS
public static final IdvResourceManager.IdvResource RSC_MAPS
public static final IdvResourceManager.IdvResource RSC_MENUBAR
public static final IdvResourceManager.IdvResource RSC_PARAMGROUPS
public static final IdvResourceManager.IdvResource RSC_USERCHOOSER
public static final IdvResourceManager.IdvResource RSC_PREFERENCES
public static final IdvResourceManager.IdvResource RSC_PLUGINS
public static final IdvResourceManager.IdvResource RSC_PLUGININDEX
public static final IdvResourceManager.IdvResource RSC_PROTOTYPES
public static final IdvResourceManager.IdvResource RSC_NJCONFIG
| Constructor Detail |
|---|
public IdvResourceManager(IntegratedDataViewer idv)
idv - The IDV| Method Detail |
|---|
public List getResources()
public List getResourcesForUser()
public ResourceCollection getResources(IdvResourceManager.IdvResource resource)
ResourceCollection that is represented by
the given resource.
resource - The resource
public XmlResourceCollection getXmlResources(IdvResourceManager.IdvResource resource)
XmlResourceCollection that is represented by
the given resource.
resource - The resource
public void clearDefaultBundles()
public void showHtmlView()
public String getHtmlView()
public void hyperlinkUpdate(HyperlinkEvent e)
hyperlinkUpdate in interface HyperlinkListenere - The eventpublic void processRbi(Element root)
root - The root of the rbi file
protected void processRbi(Element root,
boolean payAttentionToLoadMore)
root - The root of the rbi filepayAttentionToLoadMore - Flags whether we should stop processing
when we encounter a "loadmore" tag in the rbi xmlpublic ResourceCollection getResources(String id)
id - The resource id
public void removeResources(String id)
id - id of the resource to removepublic XmlResourceCollection getXmlResources(String name)
name - The resource name
protected void init(List rbiFiles)
rbiFiles - List of rbi filesprotected List getResourceList(String propName)
propName - The property name
public List getResourcePaths(List paths)
paths - Incoming strings
public void clearResourceMacros()
protected Hashtable getMacroMap()
public String getResourcePath(String path)
path - Macro containing patha
public List getLocationList()
public String getIdvResourcePath()
public String getUserHome()
public String getDataResourcePath()
public String getAppResourcePath()
public String getSitePath()
public String getUserPath()
public boolean removeLocalMaps()
public List getMaps()
public MapInfo createMapInfo()
public void writeMapState(String mapsXml)
mapsXml - The maps xmlpublic NamedStationTable getDefaultStations()
public List findLocationsByType(String type)
type - type
public NamedStationTable findLocations(String name)
name - Name of station
public String getResourceUrlBase()
public List getTransects()
public void writeTransects(List t)
t - List of transectspublic List getDisplaySettings()
public DisplaySetting findDisplaySetting(String name)
name - name
public void displaySettingChanged(DisplaySetting displaySetting)
displaySetting - display setting that changedpublic void addDisplaySetting(DisplaySetting displaySetting)
displaySetting - display settingpublic void removeDisplaySettings(List list)
list - listpublic void removeDisplaySetting(DisplaySetting displaySetting)
displaySetting - display settingpublic long getDisplaySettingsTimestamp()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||