Package ucar.unidata.idv.ui
Class ParamDefaultsEditor
java.lang.Object
ucar.unidata.ui.WindowHolder
ucar.unidata.idv.IdvManager
ucar.unidata.idv.ui.ParamDefaultsEditor
- All Implemented Interfaces:
ActionListener,EventListener,IdvConstants
This class provides 2 facilities. First, there is a set of static methods:
init (XmlResourceCollection resources);
Range getParamRange (String paramName);
getParamColorTable (String paramName);
that provide basic lookup of parameter defaults.
The init method is called once. It is passed an XmlResourceCollection
that holds the list of xml files to be used. The first resource in the list
is taken to be the user's "writable" resource. These resources are read in, first to
last, and a static collection of
ParamInfo-s are is created that is used to
do the subsequent param default lookups.
This class is also used to provide an end-user editing facility.- Version:
- $Revision: 1.78 $Date: 2007/06/22 13:03:56 $
- Author:
- IDV development team
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassA JTable that holds a list ofParamInfoobjects and provides display and editing capabilities -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe contour info base xml attribute namestatic final StringThe contour info dash xml attribute namestatic final StringThe contour info interval xml attribute namestatic final StringThe contour info label xml attribute namestatic final StringThe contour info max xml attribute namestatic final StringThe contour info min xml attribute namestatic final StringThe contour info label xml attribute namestatic final StringThe colortable xml attribute namestatic final StringThe name xml attribute namestatic final StringThe range max xml attribute namestatic final StringThe range min xml attribute namestatic final StringThe unit xml attribute namestatic final booleanThe contour info default dash valuestatic final booleanThe contour info default label valuestatic final intThe contour info default width valuestatic final StringThe param xml tag namestatic final StringThe params xml tag nameFields inherited from class ucar.unidata.ui.WindowHolder
contents, dialog, frame, windowFields 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_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_NCIDV_VERSION, ID_VERSION, ID_VIEWMANAGERS, ID_WINDOWS, INITIAL_PROBE_EARTHLOCATION, NULL_DATA_SELECTION, NULL_STRING, PREF_APPEARANCEMODE, 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_LARGE_REMOTE_DATA_WARN, PREF_LASTVERSION, PREF_LATLON_FORMAT, PREF_LEGEND_SHOWICONS, PREF_LOCALE, PREF_LOOKANDFEEL, 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_DASH, PROP_SHOWCLOCK_VIEW, PROP_SHOWDASHBOARD, PROP_SHOWDATATREE, PROP_SHOWFORMULAS, PROP_SHOWSPLASH, PROP_SPLASHICON, PROP_UI_DESKTOP, PROP_USE_DISPLAYAREA, 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
ConstructorsConstructorDescriptionCreate the editor with the given collection of xml resources -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Handle the CLOSEANCEL, OK, HELP, events.voidadd a new row to users tableprotected voidCopy the given ParamInfo object into the user's editable tablevoiddoClose()Close the window (and the color table editor if it is open)voiddoImport()Import an xml param defaults filevoiddoOpen()Open an xml param defaults filevoidSave the list of ParamInfo-s into the given filevoiddoSaveAs()Save the param infosvoidPrompt for a file and write out the ParamInfo-s from the given list.voidExport the selected param infos to the plugin managervoidExport allthe param infos to the plugin managerReturn the ParamDefaultsTable which is currently being shown in the tabbed panegetParamColorTable(String paramName) Returns a color table based on the parameter name (e.g., rh, t, etc.)getParamColorTable(String paramName, boolean useDefault) Get the color table for the parametersgetParamContourInfo(String paramName) Returns a ContourInfo based on the parameter name (e.g., rh, t, etc.)getParamDisplayUnit(String paramName) Returns a Unit based on the parameter name (e.g., rh, t, etc.)getParamInfos(boolean justFirst) Get the param infosgetParamRange(String paramName) Returns a Range based on the parameter name (e.g., rh, t, etc.)Get the list of resourcesprotected StringGet the window title to usevoidloadResources(XmlResourceCollection resources) Load in the xml resourcesvoidsaveDefaults(DisplayControlImpl displayControl) Get the color table, range, etc, from the given display control and save them as the param defaults for its data choicevoidshowHelp()show helpMethods 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, waitUntilDisplaysAreDoneMethods inherited from class ucar.unidata.ui.WindowHolder
close, doMakeContents, getContents, getDialog, getFrame, getWindow, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, show, showModal, toFront, windowIsClosing
-
Field Details
-
TAG_PARAM
The param xml tag name- See Also:
-
TAG_PARAMS
The params xml tag name- See Also:
-
ATTR_UNIT
The unit xml attribute name- See Also:
-
ATTR_NAME
The name xml attribute name- See Also:
-
ATTR_COLORTABLE
The colortable xml attribute name- See Also:
-
ATTR_RANGE_MIN
The range min xml attribute name- See Also:
-
ATTR_RANGE_MAX
The range max xml attribute name- See Also:
-
ATTR_CI_INTERVAL
The contour info interval xml attribute name- See Also:
-
ATTR_CI_BASE
The contour info base xml attribute name- See Also:
-
ATTR_CI_MIN
The contour info min xml attribute name- See Also:
-
ATTR_CI_MAX
The contour info max xml attribute name- See Also:
-
ATTR_CI_DASH
The contour info dash xml attribute name- See Also:
-
ATTR_CI_LABEL
The contour info label xml attribute name- See Also:
-
ATTR_CI_WIDTH
The contour info label xml attribute name- See Also:
-
DFLT_CI_DASH
public static final boolean DFLT_CI_DASHThe contour info default dash value- See Also:
-
DFLT_CI_LABEL
public static final boolean DFLT_CI_LABELThe contour info default label value- See Also:
-
DFLT_CI_WIDTH
public static final int DFLT_CI_WIDTHThe contour info default width value- See Also:
-
-
Constructor Details
-
ParamDefaultsEditor
Create the editor with the given collection of xml resources- Parameters:
idv- The IDV
-
-
Method Details
-
exportSelectedToPlugin
public void exportSelectedToPlugin()Export the selected param infos to the plugin manager -
exportToPlugin
public void exportToPlugin()Export allthe param infos to the plugin manager -
addNewRow
public void addNewRow()add a new row to users table -
getParamInfos
Get the param infos- Parameters:
justFirst- if true then just get the first table- Returns:
- param infos
-
getResources
Get the list of resources- Returns:
- the list of resources
-
loadResources
Load in the xml resources- Parameters:
resources- The resources
-
getCurrentTable
Return the ParamDefaultsTable which is currently being shown in the tabbed pane- Returns:
- The current ParamDefaultsTable
-
doImport
public void doImport()Import an xml param defaults file -
doOpen
public void doOpen()Open an xml param defaults file -
actionPerformed
Handle the CLOSEANCEL, OK, HELP, events.- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classWindowHolder- Parameters:
event- The event
-
showHelp
public void showHelp()show help -
doClose
public void doClose()Close the window (and the color table editor if it is open) -
getWindowTitle
Get the window title to use- Overrides:
getWindowTitlein classWindowHolder- Returns:
- Window title
-
doSave
Save the list of ParamInfo-s into the given file- Parameters:
infoList- List of infosfilename- The filename to write to
-
doSaveAs
public void doSaveAs()Save the param infos -
doSaveAs
Prompt for a file and write out the ParamInfo-s from the given list.- Parameters:
infoList- List of ParamInfo-s
-
copyToUsers
Copy the given ParamInfo object into the user's editable table- Parameters:
i- the param fino object to copy
-
saveDefaults
Get the color table, range, etc, from the given display control and save them as the param defaults for its data choice- Parameters:
displayControl- the display control to get state from
-
getParamRange
Returns a Range based on the parameter name (e.g., rh, t, etc.)- Parameters:
paramName- Name to look for- Returns:
- The
Rangefound or null
-
getParamContourInfo
Returns a ContourInfo based on the parameter name (e.g., rh, t, etc.)- Parameters:
paramName- Name to look for- Returns:
- The
ContourInfofound or null
-
getParamDisplayUnit
Returns a Unit based on the parameter name (e.g., rh, t, etc.)- Parameters:
paramName- Name to look for- Returns:
- The Unit found or null
-
getParamColorTable
Returns a color table based on the parameter name (e.g., rh, t, etc.)- Parameters:
paramName- Name to look for- Returns:
- The
ColorTablefound or null
-
getParamColorTable
Get the color table for the parameters- Parameters:
paramName- parameter nameuseDefault- true to use the default color table if not found- Returns:
- the associated color table
-