Package ucar.unidata.idv.control
Class DisplayControlBase
java.lang.Object
ucar.unidata.collab.SharableImpl
ucar.unidata.idv.control.DisplayControlBase
- All Implemented Interfaces:
Sharable
- Direct Known Subclasses:
DisplayControlImpl
Some display control oriented utilities
- Version:
- $Revision: 1.28 $
- Author:
- IDV development team
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
String used to set the appearance modestatic final String
String used to set the appearance modestatic final String
String used to set the appearance modestatic final String
String used as the action command for setting the size of wind barbsstatic final String
String used as the action command for the color setting buttonstatic final String
String used as the action command for setting the color tablestatic final String
String used as the action command for setting the wind barb intervalstatic final String
String used as the action command for setting the levelstatic final String
String used as the action command for setting the levelstatic final String
String used as the action command for showing the control windowstatic final String
String used as the action command for removing this display controlstatic final int
Default selector point size.protected static String
What is the default samppling modestatic final String
search string for allstatic final String
search string for categorystatic final String
search string for class:static final String
search string for specialstatic final String
search string for thisstatic final String
search string for displays with datastatic final String
search string for display like this with datastatic final String
search string for display with this datastatic final String
search string with displays in this viewstatic final int
Bitmask for controls that use colorsstatic final int
Bitmask for controls that use color tablesstatic final int
Bitmask for controls that can change their color unitsstatic final int
Bitmask for controls that use contour interval informationstatic final int
Bitmask for controls that have the "Set data" button capability enabledstatic final int
Bitmask for controls that can change their display unitsstatic final int
flag for the trackcontrol to add marker widget or notstatic final int
Bitmask for controls that allow line width settingstatic final int
No-op for attributeFlagsstatic final int
Bitmask for controls that allow selecting a data rangestatic final int
Bitmask for controls that allow skip factor settingstatic final int
Bitmask for controls that allow grid smoothing settingstatic final int
Bitmask for controls that allow texture quality settingstatic final int
Bitmask for controls that allow selecting a time rangestatic final int
Bitmask for controls that have a fixed z positionprotected static final Insets
Used for doing doLayout callsprotected static ImageIcon
The icon used to show locked legend componentsstatic ImageIcon
Icon used to remove displaysprotected static ImageIcon
The icon used to show unlocked legend componentsstatic final String
A label for Nonestatic LogUtil.LogCategory
Use this member to log messages (through calls to LogUtil)static final String
Macro for the data source name (or names) for the labelstatic final String
Macro for the display name for the labelstatic final String
Macro for the display unit for the labelstatic final String
forecast hour macrostatic final String
forecast hour macro without the 'H' -- user can format their ownstatic final String
Macro for the long parameter name for the labelstatic final String
Macro for the short parameter name for the labelstatic final String
Macro for the resolution for the labelstatic final String
Macro for the short parameter name for the labelstatic final String
Macro for stationstatic final String
Macro for the display unit for the labelstatic final String
Macro for the short parameter name for the labelstatic final String
String used the set the sampling to be nearest neighborstatic final String
The preference id for the default label template for displaysstatic final String
The preference id for the default extra label template for displaysstatic final String
The preference id for the default label template for displaysstatic final String
Name of the property removed propertstatic final String
display group settingstatic final String
group flagsstatic final String
data choices propertystatic final String
Color propertystatic final String
Color scale propertystatic final String
Color table propertystatic final String
Display unit propertystatic final String
Probe position propertystatic final String
select range propertystatic final String
Probe position propertystatic final String
Transect Line position propertystatic final String
Visiblity propertystatic final String
String used to set the sampling to be weighted average -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboxToEarth
(double[] boxCoords) Map the visad box to an earth locationboxToEarth
(double[] boxCoords, boolean setZToZeroIfOverhead) Map the visad box to an earth locationboxToEarth
(double x, double y, double z) Map the visad box to an earth locationboxToEarth
(double x, double y, double z, boolean setZToZeroIfOverhead) Map the visad box to an earth locationboxToEarth
(List boxPoints) Map the visad box points to earth locationsint[]
boxToScreen
(double[] xyz) Map a visad box point to the screen coords.protected Rectangle2D
Calculates the rectangle that is the bounds of the VisAD display.static TwoFacedObject
A utility to wrap the given object (which should be a NamedStationImpl) in a TwoFacedObject, truncating the label to a fixed size.earthToBox
(List earthLocations) Map the earth locations to box pointsdouble[]
Map an earth location to a visad box pointMap an earth location to a visad box tupleint[]
Map earth to screenprotected Object[]
formatLevels
(Object[] levels) Format the levels to make them look presentableprotected TwoFacedObject
getLabeledReal
(Object level) Get a labeled Realprotected Real
getLevelReal
(Object level) Get the real value from a level objectabstract NavigatedDisplay
We have this here so some of the utility methods can get the navigated display.double[]
Return the x/y coordinate of the center of the displaystatic NamedStationImpl
A utility to find and return the NamedStationImpl which is selected in the given combobox.getTmpProperty
(Object key) Get the tmp property.static boolean
isLeftButtonDown
(DisplayEvent event) Is the left button pressedstatic void
logException
(Exception exc) Utility method for logging exceptions.static void
logException
(String desc, Exception exc) Utility method for logging exceptions with the given description.static EarthLocation
makeEarthLocation
(double lat, double lon, double alt) Make an earth location from the given lat,on and altvoid
putTmpProperty
(Object key, Object value) put the tmp property.removeTmpProperty
(Object key) remove the tmp propertydouble[]
screenToBox
(int screenX, int screenY) Map the screen x/y to a visad box pointdouble[]
screenToBox
(int screenX, int screenY, double zPosition) Map the screen x/y to a visad box pointscreenToEarth
(int screenX, int screenY) Map screen position to earth locationstatic void
setStations
(List stationList, JComboBox box) A utility that takes a list of NamedStationImpl-s, wraps each of them in a TwoFacedObject, truncates their label and adds them to the given combobox.static void
setStations
(List stationList, JComboBox box, boolean addMessage) A utility that takes a list of NamedStationImpl-s, wraps each of them in a TwoFacedObject, truncates their label and adds them to the given combobox.double[]
toBox
(DisplayEvent event) Map the screen x/y to a visad box pointtoEarth
(DisplayEvent event) Map the screen x/y of the event to an earth locationvoid
userErrorMessage
(String message) A utility method to show an error message to the user.static void
userMessage
(String msg) Utility method for creating user messagesMethods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
-
Field Details
-
log_
Use this member to log messages (through calls to LogUtil) -
ICON_LOCK
The icon used to show locked legend components -
ICON_UNLOCK
The icon used to show unlocked legend components -
ICON_REMOVE
Icon used to remove displays -
PROP_REMOVED
Name of the property removed propert- See Also:
-
PREF_LEGENDLABEL_TEMPLATE
The preference id for the default label template for displays- See Also:
-
PREF_EXTRALABEL_TEMPLATE
The preference id for the default extra label template for displays- See Also:
-
PREF_DISPLAYLIST_TEMPLATE
The preference id for the default label template for displays- See Also:
-
MACRO_SHORTNAME
Macro for the short parameter name for the label- See Also:
-
MACRO_STATION
Macro for station- See Also:
-
MACRO_RESOLUTION
Macro for the resolution for the label- See Also:
-
MACRO_LONGNAME
Macro for the long parameter name for the label- See Also:
-
MACRO_VALUE
Macro for the short parameter name for the label- See Also:
-
MACRO_POSITION
Macro for the short parameter name for the label- See Also:
-
MACRO_DATASOURCENAME
Macro for the data source name (or names) for the label- See Also:
-
MACRO_DISPLAYNAME
Macro for the display name for the label- See Also:
-
MACRO_DISPLAYUNIT
Macro for the display unit for the label- See Also:
-
MACRO_TIMESTAMP
Macro for the display unit for the label- See Also:
-
MACRO_FHOUR
forecast hour macro- See Also:
-
MACRO_FHOUR2
forecast hour macro without the 'H' -- user can format their own- See Also:
-
CMD_COLORS
String used as the action command for the color setting button- See Also:
-
CMD_REMOVE
String used as the action command for removing this display control- See Also:
-
CMD_POPUP
String used as the action command for showing the control window- See Also:
-
CMD_COLORTABLE
String used as the action command for setting the color table- See Also:
-
CMD_BARBSIZE
String used as the action command for setting the size of wind barbs- See Also:
-
CMD_INTERVAL
String used as the action command for setting the wind barb interval- See Also:
-
CMD_LEVEL
String used as the action command for setting the level- See Also:
-
CMD_LINEWIDTH
String used as the action command for setting the level- See Also:
-
WEIGHTED_AVERAGE
String used to set the sampling to be weighted average- See Also:
-
NEAREST_NEIGHBOR
String used the set the sampling to be nearest neighbor- See Also:
-
DEFAULT_SAMPLING_MODE
What is the default samppling mode -
APPEARANCE_IDV
String used to set the appearance mode- See Also:
-
APPEARANCE_DARK
String used to set the appearance mode- See Also:
-
APPEARANCE_LIGHT
String used to set the appearance mode- See Also:
-
GRID_INSETS
Used for doing doLayout calls -
SHARE_POSITION
Probe position property- See Also:
-
SHARE_TRANSECT
Transect Line position property- See Also:
-
SHARE_DISPLAYUNIT
Display unit property- See Also:
-
SHARE_VISIBILITY
Visiblity property- See Also:
-
SHARE_COLORTABLE
Color table property- See Also:
-
SHARE_COLORSCALE
Color scale property- See Also:
-
SHARE_COLOR
Color property- See Also:
-
SHARE_SELECTRANGE
select range property- See Also:
-
SHARE_CHOICES
data choices property- See Also:
-
SHARE_SKIPVALUE
Probe position property- See Also:
-
FLAG_CONTOUR
public static final int FLAG_CONTOURBitmask for controls that use contour interval information- See Also:
-
FLAG_COLOR
public static final int FLAG_COLORBitmask for controls that use colors- See Also:
-
FLAG_COLORTABLE
public static final int FLAG_COLORTABLEBitmask for controls that use color tables- See Also:
-
FLAG_DATACONTROL
public static final int FLAG_DATACONTROLBitmask for controls that have the "Set data" button capability enabled- See Also:
-
FLAG_DISPLAYUNIT
public static final int FLAG_DISPLAYUNITBitmask for controls that can change their display units- See Also:
-
FLAG_COLORUNIT
public static final int FLAG_COLORUNITBitmask for controls that can change their color units- See Also:
-
FLAG_ZPOSITION
public static final int FLAG_ZPOSITIONBitmask for controls that have a fixed z position- See Also:
-
FLAG_SELECTRANGE
public static final int FLAG_SELECTRANGEBitmask for controls that allow selecting a data range- See Also:
-
FLAG_TIMERANGE
public static final int FLAG_TIMERANGEBitmask for controls that allow selecting a time range- See Also:
-
FLAG_LINEWIDTH
public static final int FLAG_LINEWIDTHBitmask for controls that allow line width setting- See Also:
-
FLAG_SKIPFACTOR
public static final int FLAG_SKIPFACTORBitmask for controls that allow skip factor setting- See Also:
-
FLAG_TEXTUREQUALITY
public static final int FLAG_TEXTUREQUALITYBitmask for controls that allow texture quality setting- See Also:
-
FLAG_SMOOTHING
public static final int FLAG_SMOOTHINGBitmask for controls that allow grid smoothing setting- See Also:
-
FLAG_GRIDTRAJECTORY
public static final int FLAG_GRIDTRAJECTORYflag for the trackcontrol to add marker widget or not- See Also:
-
FLAG_NONE
public static final int FLAG_NONENo-op for attributeFlags- See Also:
-
DEFAULT_POINT_SIZE
public static final int DEFAULT_POINT_SIZEDefault selector point size.- See Also:
-
LABEL_NONE
A label for None- See Also:
-
FIND_THIS
search string for this- See Also:
-
FIND_ALL
search string for all- See Also:
-
FIND_CLASS
search string for class:- See Also:
-
FIND_CATEGORY
search string for category- See Also:
-
FIND_WITHDATA
search string for displays with data- See Also:
-
FIND_WITHTHISDATA
search string for display like this with data- See Also:
-
FIND_WITHTHISFIELD
search string for display with this data- See Also:
-
FIND_SPECIAL
search string for special- See Also:
-
FIND_WITHTHISVIEW
search string with displays in this view- See Also:
-
SETTINGS_GROUP_DISPLAY
display group setting- See Also:
-
SETTINGS_GROUP_FLAGS
group flags- See Also:
-
-
Constructor Details
-
DisplayControlBase
public DisplayControlBase()ctor
-
-
Method Details
-
getTmpProperty
Get the tmp property.- Parameters:
key
- key- Returns:
- property
-
putTmpProperty
put the tmp property. These are not persisted off- Parameters:
key
- keyvalue
- value
-
removeTmpProperty
remove the tmp property- Parameters:
key
- key- Returns:
- the value or null if not found
-
setStations
A utility that takes a list of NamedStationImpl-s, wraps each of them in a TwoFacedObject, truncates their label and adds them to the given combobox.- Parameters:
stationList
- Station listbox
- Combo box to set
-
setStations
A utility that takes a list of NamedStationImpl-s, wraps each of them in a TwoFacedObject, truncates their label and adds them to the given combobox.- Parameters:
stationList
- Station listbox
- Combo box to setaddMessage
- true to add an entry message
-
createStationTfo
A utility to wrap the given object (which should be a NamedStationImpl) in a TwoFacedObject, truncating the label to a fixed size.- Parameters:
o
- The station- Returns:
- The tfo
-
getSelectedStation
A utility to find and return the NamedStationImpl which is selected in the given combobox. May return null.- Parameters:
box
- The box.- Returns:
- The selected station or null.
-
isLeftButtonDown
Is the left button pressed- Parameters:
event
- The event- Returns:
- Is the left button pressed
-
toEarth
Map the screen x/y of the event to an earth location- Parameters:
event
- The event- Returns:
- The earth location
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
boxToEarth
Map the visad box to an earth location- Parameters:
boxCoords
- The box point- Returns:
- The earth location
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
boxToEarth
public EarthLocation boxToEarth(double[] boxCoords, boolean setZToZeroIfOverhead) throws VisADException, RemoteException Map the visad box to an earth location- Parameters:
boxCoords
- The box pointsetZToZeroIfOverhead
- If in the overhead view then set Z to 0- Returns:
- The earth location
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
boxToEarth
public EarthLocation boxToEarth(double x, double y, double z) throws VisADException, RemoteException Map the visad box to an earth location- Parameters:
x
- xy
- yz
- z- Returns:
- The earth location
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
boxToEarth
public EarthLocation boxToEarth(double x, double y, double z, boolean setZToZeroIfOverhead) throws VisADException, RemoteException Map the visad box to an earth location- Parameters:
x
- xy
- yz
- zsetZToZeroIfOverhead
- If in the overhead view then set Z to 0- Returns:
- The earth location
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
boxToEarth
Map the visad box points to earth locations- Parameters:
boxPoints
- The box points- Returns:
- The earth locations
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
earthToBox
Map the earth locations to box points- Parameters:
earthLocations
- list of earth locations- Returns:
- The box points
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
earthToBox
Map an earth location to a visad box point- Parameters:
el
- The earth location- Returns:
- The box point
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
earthToBoxTuple
Map an earth location to a visad box tuple- Parameters:
el
- The earth location- Returns:
- The tuple
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
makeEarthLocation
public static EarthLocation makeEarthLocation(double lat, double lon, double alt) throws VisADException, RemoteException Make an earth location from the given lat,on and alt- Parameters:
lat
- the latlon
- the lonalt
- the alt- Returns:
- The earth location
- Throws:
RemoteException
- On badnessVisADException
- On badness
-
toBox
Map the screen x/y to a visad box point- Parameters:
event
- The event- Returns:
- The box point
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
screenToBox
Map the screen x/y to a visad box point- Parameters:
screenX
- xscreenY
- y- Returns:
- The box point
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
screenToBox
public double[] screenToBox(int screenX, int screenY, double zPosition) throws VisADException, RemoteException Map the screen x/y to a visad box point- Parameters:
screenX
- screen xscreenY
- screen yzPosition
- The visad Z position to use- Returns:
- The box point
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
getScreenCenter
Return the x/y coordinate of the center of the display- Returns:
- The box point
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
boxToScreen
Map a visad box point to the screen coords.- Parameters:
xyz
- Visad box point- Returns:
- Screen coords
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
screenToEarth
Map screen position to earth location- Parameters:
screenX
- xscreenY
- y- Returns:
- The earth location
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
earthToScreen
Map earth to screen- Parameters:
el
- Earth location- Returns:
- Screen xy
- Throws:
RemoteException
- When bad things happenVisADException
- When bad things happen
-
calculateRectangle
Calculates the rectangle that is the bounds of the VisAD display.- Returns:
- bounds of the display
-
userMessage
Utility method for creating user messages- Parameters:
msg
- message to display
-
userErrorMessage
A utility method to show an error message to the user.- Parameters:
message
- The message
-
logException
Utility method for logging exceptions.- Parameters:
exc
- Exception to handle
-
logException
Utility method for logging exceptions with the given description. This is just a wrapper around theLogUtil
call printException.- Parameters:
desc
- description for exceptionexc
- Exception to handle
-
formatLevels
Format the levels to make them look presentable- Parameters:
levels
- array of levels- Returns:
- formatted levels. Currently an array of TwoFacedObjects with formatted values as the label.
-
getLabeledReal
Get a labeled Real- Parameters:
level
- the level object- Returns:
- a labeled level as a TwoFacedObject
-
getLevelReal
Get the real value from a level object- Parameters:
level
- the level (TwoFacedObject, Real or number String);- Returns:
- a corresponding Real or null
-