Package ucar.unidata.idv
Class DisplayConventions
java.lang.Object
ucar.unidata.ui.WindowHolder
ucar.unidata.idv.IdvManager
ucar.unidata.idv.DisplayConventions
- All Implemented Interfaces:
ActionListener
,EventListener
,IdvConstants
Provides a set of display conventions (e.g., contour interval,
default color map, etc) typically based on parameter names
(e.g., "rh", "temp", etc.).
Some of the conventions are hardcoded but others are defined
using property files.
- Author:
- Unidata Development Team
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The preference id to hold the list of units that the user uses when changing unitsFields 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_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 this object with the given idv -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToUnitList
(Object selected) Add the given object to the list of unitsfindContourInfo
(String paramName, RealType rangeType, Unit displayUnit, Range range) Find pre-determined contouring values for this parameter by name from the paramdefaults.xml file, or compute reasonable values of contouring values from the data itself.findContourInfo
(String paramName, RealType rangeType, Unit displayUnit, Range range, ContourInfo contourInfo) Find pre-determined contouring values for this parameter by name from the paramdefaults.xml file, or compute reasonable values of contouring values from the data itself.findDefaultContourInfo
(String paramName) Find the default contour inffindDefaultContourInfo
(String paramName, ContourInfo contourInfo) Find the default contour infformat
(double v) Format of a double.formatAltitude
(Real alt) Format an AltitudeformatAngle
(double d) Format the given angle with the angleFormatformatDistance
(double d) Format the given distance using the distanceFormatformatEarthLocation
(EarthLocation el, boolean includeAlt) Format a EarthLocation as a lat/lon/(alt) string.formatEarthLocation
(EarthLocation el, boolean includeAlt, boolean includeLabel) format the earth locationFormat a EarthLocation as a lat/lon/(alt) string.formatLatLon
(double d) Format the given lat or lon using the latLonFormatformatLatLon
(Real latorlon) Format an lat or lonformatLatLonCardinal
(double value, int type) Format the lat/lon labels with cardinal points (N,S,E,W).formatLatLonCardinal
(Real latorlon, int type) Format an lat or lon with cardinal id (N,S,E,W)Format an LatLonPoint as a lat/lon string.formatLatLonPoint
(LatLonPoint llp, boolean includeLabel) format the latlon pointFormat a LatLonPoint as a lat/lon string.formatLatOrLon
(double ll) Format a double to a String, for values such as -179.123static Color
getColor()
Cycle through the color list.Get the color that corresponds to the given name (e.g., red, blue, etc.)getColorName
(Color color) Get the name that corresponds to the given colorReturn the list of color names.Return the list ofTwoFacedObject
s that make up the list of units.static DisplayConventions
Get the singleton objectgetDisplayUnit
(String paramName, Unit unit) Get the default display unit for a parameter with the given name.get the latlon formattergetMapProjectionLabel
(MapProjection mp, DisplayControl display) Create a label for a map projection based on aDisplayControl
.getMapProjectionName
(MapProjection projection) Get the name for the projection in question.getParamColorTable
(String paramName) Get the defaultColorTable
that should be used for the given parameter name.Wrapper around IdvBase.getParamDefaultsEditorgetParamRange
(String paramName, Unit unit) Set range of values for lower and upper parameter values locked to lower and upper entries in color table.Get the font used for window labelsmakeColorSelector
(Color dflt) A helper to make a color selector combo boxmakeUnitBox
(Unit unit, Unit defaultUnit) Popup a unit selection gui.makeUnitBox
(Unit unit, Unit unit1, Unit defaultUnit) When I need to add the alt unit to have option of pressure unitselectDisplayUnit
(String paramName, Unit unit) For the given parameter name, select the common unit to display; for example Celsius replacing Kelvin.selectUnit
(Unit unit, Unit defaultUnit) Popup a unit selection gui.selectUnit
(Unit unit, Unit unit1, Unit defaultUnit) Popup a unit selection gui.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
-
Field Details
-
PREF_UNITLIST
The preference id to hold the list of units that the user uses when changing units- See Also:
-
-
Constructor Details
-
DisplayConventions
Create this object with the given idv- Parameters:
idv
- The IDV
-
-
Method Details
-
getDisplayConventions
Get the singleton object- Returns:
- The singleton object
-
formatLatLonPoint
Format an LatLonPoint as a lat/lon string.- Parameters:
llp
- LatLonPoint to format- Returns:
- The formatted LatLonPoint
-
formatLatLonPoint
format the latlon point- Parameters:
llp
- the llpincludeLabel
- include the label- Returns:
- formatted point
-
formatEarthLocation
Format a EarthLocation as a lat/lon/(alt) string.- Parameters:
el
- EarthLocation to formatincludeAlt
- include Altitude in the return- Returns:
- The formatted lat/lon/alt
-
formatEarthLocation
format the earth location- Parameters:
el
- the earth locationincludeAlt
- include the altitudeincludeLabel
- include that lat/lon label- Returns:
- formatted earth location
-
formatLatLonShort
Format a LatLonPoint as a lat/lon string.- Parameters:
llp
- LatLonPoint to format- Returns:
- The formatted lat/lon
-
formatEarthLocationShort
Format a EarthLocation as a lat/lon/(alt) string.- Parameters:
el
- EarthLocation to format- Returns:
- The formatted lat/lon/alt
-
getLatLonFormat
get the latlon formatter- Returns:
- the latlon formatter
-
formatLatLon
Format the given lat or lon using the latLonFormat- Parameters:
d
- The lat or lon value (degrees?)- Returns:
- The formatted version
-
formatLatLon
Format an lat or lon- Parameters:
latorlon
- The lat or lon- Returns:
- The formatted lat or lon
-
formatLatLonCardinal
Format the lat/lon labels with cardinal points (N,S,E,W).- Parameters:
value
- the valuetype
- (LATITUDE or LONGITUDE)- Returns:
- the formatted string
-
formatLatLonCardinal
Format an lat or lon with cardinal id (N,S,E,W)- Parameters:
latorlon
- The lat or lontype
- (LATITUDE or LONGITUDE)- Returns:
- The formatted lat or lon
-
formatAltitude
Format an Altitude- Parameters:
alt
- The altitude- Returns:
- The formatted alt
-
formatDistance
Format the given distance using the distanceFormat- Parameters:
d
- The distance to format- Returns:
- The formatted version
-
formatAngle
Format the given angle with the angleFormat- Parameters:
d
- The angle to format- Returns:
- The formatted version
-
formatLatOrLon
Format a double to a String, for values such as -179.123- Parameters:
ll
- a double (such as a lat or lon in decimal degrees)- Returns:
- The formatted value deprecated use formatLatLon(double)
-
format
Format of a double.- Parameters:
v
- The value- Returns:
- Its format
-
findDefaultContourInfo
Find the default contour inf- Parameters:
paramName
- variable name from the data source- Returns:
- The default contour info for the param
-
findDefaultContourInfo
Find the default contour inf- Parameters:
paramName
- variable name from the data sourcecontourInfo
- The contour info to use- Returns:
- The default contour info for the param
-
findContourInfo
public ContourInfo findContourInfo(String paramName, RealType rangeType, Unit displayUnit, Range range) Find pre-determined contouring values for this parameter by name from the paramdefaults.xml file, or compute reasonable values of contouring values from the data itself. min no contour line below this value; base a contour line must have this value (even if not seen), other values are this value +/- some multiple of the interval; max no contour with greater value than this; interval if negative, means show dashed lines below base value.- Parameters:
paramName
- variable name from the data sourcerangeType
- one of them ViaAD RealType thingys for the datadisplayUnit
- the unit the data will appear on screenrange
- The range- Returns:
- a ContourInfo object with appropriate contouring values
-
findContourInfo
public ContourInfo findContourInfo(String paramName, RealType rangeType, Unit displayUnit, Range range, ContourInfo contourInfo) Find pre-determined contouring values for this parameter by name from the paramdefaults.xml file, or compute reasonable values of contouring values from the data itself. min no contour line below this value; base a contour line must have this value (even if not seen), other values are this value +/- some multiple of the interval; max no contour with greater value than this; interval if negative, means show dashed lines below base value.- Parameters:
paramName
- variable name from the data sourcerangeType
- one of them ViaAD RealType thingys for the datadisplayUnit
- the unit the data will appear on screenrange
- The rangecontourInfo
- Default contour info- Returns:
- a ContourInfo object with appropriate contouring values
-
getParamColorTable
Get the defaultColorTable
that should be used for the given parameter name.- Parameters:
paramName
- The name of the parameter- Returns:
- The color table to use
-
getParamRange
Set range of values for lower and upper parameter values locked to lower and upper entries in color table.- Parameters:
paramName
- name of parm to set range limits forunit
- DEFAULT VisAD unit not display unit- Returns:
- The
Range
to use for the given parameter - Throws:
VisADException
- the VisAD exceptionRemoteException
- the remote exception
-
getParamDefaultsEditor
Wrapper around IdvBase.getParamDefaultsEditor- Returns:
- the param defaults editor
-
selectDisplayUnit
For the given parameter name, select the common unit to display; for example Celsius replacing Kelvin.- Parameters:
paramName
- the String name of data parameterunit
- the VisAD Unit of the parameter (incoming or original)- Returns:
- Unit
-
getDisplayUnit
Get the default display unit for a parameter with the given name. If none is found then return the given unit.- Parameters:
paramName
- The parameter nameunit
- The default unit- Returns:
- The display unit
-
getColorNameList
Return the list of color names. This is used in comboboxes to choose a color.- Returns:
- List of color names
-
makeColorSelector
A helper to make a color selector combo box- Parameters:
dflt
- The default color value- Returns:
- The color selector combo box
-
getColor
Get the color that corresponds to the given name (e.g., red, blue, etc.)- Parameters:
name
- The color name- Returns:
- The color (or blue if not found).
-
getColorName
Get the name that corresponds to the given color- Parameters:
color
- The color- Returns:
- Its name
-
getColor
Cycle through the color list.- Returns:
- The next color in the list
-
getWindowLabelFont
Get the font used for window labels- Returns:
- The window label font
-
makeUnitBox
Popup a unit selection gui. This will also save off persistently ay new unit names typed in.- Parameters:
unit
- The current unitdefaultUnit
- The default unit to return if the user chooses "Default"- Returns:
- The new unit or null on a cancel or an error
-
makeUnitBox
When I need to add the alt unit to have option of pressure unit- Parameters:
unit
- The current unitunit1
- The unit of pressuredefaultUnit
- The default unit to return if the user chooses "Default"- Returns:
- The new unit or null on a cancel or an error
-
selectUnit
Popup a unit selection gui. This will also save off persistently any new unit names typed in.- Parameters:
unit
- The current unitdefaultUnit
- The default unit to return if the user chooses "Default"- Returns:
- The new unit or null on a cancel or an error
-
selectUnit
Popup a unit selection gui. This will also save off persistently any new unit names typed in.- Parameters:
unit
- The current unitunit1
- The next unitdefaultUnit
- The default unit to return if the user chooses "Default"- Returns:
- The new unit or null on a cancel or an error
-
addToUnitList
Add the given object to the list of units- Parameters:
selected
- Selected unit
-
getDefaultUnitList
Return the list ofTwoFacedObject
s that make up the list of units.- Returns:
- List of unit holding objects.
-
getMapProjectionName
Get the name for the projection in question. A little better thanMapProjection.toString()
- Parameters:
projection
- MapProjection in question- Returns:
- name for projection
-
getMapProjectionLabel
Create a label for a map projection based on aDisplayControl
.- Parameters:
mp
- MapProjection cannot be nulldisplay
- DisplayControl- Returns:
- label String
-