ucar.unidata.idv.control
Class StationModelControl

java.lang.Object
  extended by ucar.unidata.collab.SharableImpl
      extended by ucar.unidata.idv.control.DisplayControlBase
          extended by ucar.unidata.idv.control.DisplayControlImpl
              extended by ucar.unidata.idv.control.ObsDisplayControl
                  extended by ucar.unidata.idv.control.StationModelControl
All Implemented Interfaces:
ActionListener, ItemListener, PropertyChangeListener, EventListener, HyperlinkListener, Sharable, DataChangeListener, DisplayControl, Prototypable, ControlListener, DisplayListener
Direct Known Subclasses:
StationLocationControl

public class StationModelControl
extends ObsDisplayControl

A DisplayControl for station models

Version:
$Revision: 1.228 $
Author:
MetApps Development Team

Nested Class Summary
 
Nested classes/interfaces inherited from class ucar.unidata.idv.control.ObsDisplayControl
ObsDisplayControl.RealWrapper
 
Nested classes/interfaces inherited from class ucar.unidata.idv.control.DisplayControlImpl
DisplayControlImpl.SideLegendLabel
 
Field Summary
protected  FieldImpl currentStationData
          The currently displayed data
protected  List densityComps
          List of components to disable when not delcuttering
protected  List filters
          filters for showing data
protected  FieldImpl lastDeclutteredData
          Keep around the last set of decluttered data
protected  LayoutModelWidget layoutModelWidget
          The widget to show the layout model in the gui
protected static ImageIcon lockIcon
          The icon used to show locked legend components
protected  boolean stationsLocked
          Do we not declutter and just use the last set of decluttered stations
protected  List timeDeclutterComps
          List of components to disable when not delcuttering
protected static ImageIcon unlockIcon
          The icon used to show unlocked legend components
protected  JPanel zPositionPanel
          holds the z position slider
 
Fields inherited from class ucar.unidata.idv.control.ObsDisplayControl
colNames, colString, FIELD_ALL, format, LABEL_ALT, LABEL_LAT, LABEL_LON, LABEL_TIME
 
Fields inherited from class ucar.unidata.idv.control.DisplayControlImpl
categories, colorScaleInfo, colorScales, contourInfo, contourInfoParams, contourWidget, controlContext, ctw, dataSelection, defaultView, defaultViewManager, DISPLAY_LIST_NAME, displayListTable, displayListUsesColor, displayMasters, displayUnit, helpUrl, initNoteText, instantiatedWithNoData, noteTextArea, noteWrapper, paramName, requestProperties, selectRangeWidget, settingVisibility, sharables, showNoteText, skipSlider, version, viewManagers, ZFUDGE
 
Fields inherited from class ucar.unidata.idv.control.DisplayControlBase
CMD_BARBSIZE, CMD_COLORS, CMD_COLORTABLE, CMD_INTERVAL, CMD_LEVEL, CMD_LINEWIDTH, CMD_POPUP, CMD_REMOVE, DEFAULT_POINT_SIZE, DEFAULT_SAMPLING_MODE, FIND_ALL, FIND_CATEGORY, FIND_CLASS, FIND_SPECIAL, FIND_THIS, FIND_WITHDATA, FIND_WITHTHISDATA, FIND_WITHTHISFIELD, FIND_WITHTHISVIEW, FLAG_COLOR, FLAG_COLORTABLE, FLAG_COLORUNIT, FLAG_CONTOUR, FLAG_DATACONTROL, FLAG_DISPLAYUNIT, FLAG_LINEWIDTH, FLAG_NONE, FLAG_SELECTRANGE, FLAG_SKIPFACTOR, FLAG_SMOOTHING, FLAG_TEXTUREQUALITY, FLAG_TIMERANGE, FLAG_ZPOSITION, GRID_INSETS, ICON_LOCK, ICON_REMOVE, ICON_UNLOCK, LABEL_NONE, log_, MACRO_DATASOURCENAME, MACRO_DISPLAYNAME, MACRO_DISPLAYUNIT, MACRO_FHOUR, MACRO_LONGNAME, MACRO_POSITION, MACRO_SHORTNAME, MACRO_STATION, MACRO_TIMESTAMP, MACRO_VALUE, NEAREST_NEIGHBOR, PREF_DISPLAYLIST_TEMPLATE, PREF_EXTRALABEL_TEMPLATE, PREF_LEGENDLABEL_TEMPLATE, PROP_REMOVED, SETTINGS_GROUP_DISPLAY, SETTINGS_GROUP_FLAGS, SHARE_CHOICES, SHARE_COLOR, SHARE_COLORSCALE, SHARE_COLORTABLE, SHARE_DISPLAYUNIT, SHARE_POSITION, SHARE_SELECTRANGE, SHARE_SKIPVALUE, SHARE_TRANSECT, SHARE_VISIBILITY, WEIGHTED_AVERAGE
 
Fields inherited from interface ucar.unidata.idv.DisplayControl
BOTTOM_LEGEND, DEFAULT_PROBEFORMAT, PREF_PREFIX, PREF_PROBEFORMAT, PREF_REMOVEONWINDOWCLOSE, PREF_SAMPLING_MODE, PREF_STANDALONE_REMOVEONCLOSE, PREF_STANDALONE_REMOVEONCLOSE_ASK, PROP_LEGENDICON, RASTERMODE_SHOWALL, RASTERMODE_SHOWNONRASTER, RASTERMODE_SHOWRASTER, SIDE_LEGEND
 
Constructor Summary
StationModelControl()
          Default constructor.
 
Method Summary
 void addChartParam(String paramName)
          Add a chart parametere
protected  JComponent addDensityComp(JComponent comp)
          Add the given component into the list of density components that are to be enabled/disabled when the declutter checkbox is toggled.
protected  void addDisplaySettings(DisplaySettingsDialog dsd)
          Add properties to the display settings dialog
protected  JComponent addTimeDeclutterComp(JComponent comp)
          Add the given component into the list of time declutter components that are to be enabled/disabled when the declutter checkbox is toggled.
 void applyFilters()
          Apply the vis filters
 void applyTimeRange()
          Handle some sort of time change.
protected  LinearLatLonSet calculateLatLonBounds(Rectangle2D screenBounds)
          Calculate the LatLonBounds based on the VisAD screen bound.
 void chartChanged()
          Handle a chart changed event
protected  StationModelDisplayable createStationModelDisplayable()
          Create the StationModelDisplayable used by this DisplayControl.
protected  float decodeFilterString(String filter)
          Decode the selected filter string and return the corresponding filter.
protected  void doInitialUpdateLegendAndList()
          Do the initial update legend and list
protected  Container doMakeContents()
          Make Gui contents
protected  JComponent doMakeFilterGui(boolean includeAll)
          Make the filter GUI
protected  JComponent doMakeSideLegendComponent()
          Make the side legend component
protected  JPanel doMakeVerticalPositionPanel()
          Make the gui panel for vertical position
 void doRemove()
          Remove this DisplayControl from the system.
 void editStationTable()
          Popup the station model editor
 void exportAsCsv()
          Export the table as csv
 void exportAsKmz()
          _more_
protected  void fieldSelectorChanged()
          Handle when the value in the column field has changed.
protected  FieldImpl filterData(FieldImpl obs)
          Apply the filters to the given data
protected  PointOb findClosestOb(EarthLocation el, FieldImpl theField)
          Find the closest ob in the field to the particular EarthLocation
 void firstFrameDone()
          Have we been unpersisted into a view manager that has not been displayed yet?
 boolean getAskedUserToDeclutterTime()
          Get the AskedUserToDeclutterTime property.
protected  Rectangle2D getBounds()
          Get the bounds for the visible portion of the screen.
 TimeSeriesChart getChart()
          Get the chart
 List getChartParams()
          Get the ChartParams property.
protected  ColorTable getColorTableToApply()
          Get the color table to use when applying to displayables
 String getColorWidgetLabel()
          Return the label that is to be used for the color widget
 void getControlWidgets(List controlWidgets)
          Get any control widgets special to this control and add them to the list.
 MapProjection getDataProjection()
          Get the MapProjection for this data; if have a single point data object make synthetic map projection for location
protected  String getDataProjectionLabel()
          What label should be used for the data projection
 boolean getDeclutter()
          Get whether this DisplayControl should be decluttered or not.
 float getDeclutterFilter()
          Get whether this DisplayControl should be decluttered or not.
protected  JPanel getDensityControl()
          Create the 'Low' slider 'High' jpanel for the density slider.
 float getDisplayableScale()
          Get the scale the user can enter
protected  void getEditMenuItems(List items, boolean forMenuBar)
          Get edit menu items
protected  JComponent getExtraLegendComponent(int legendType)
          Assume that any display controls that have a color table widget will want the color table to show up in the legend.
protected  List getFilterNames()
          Return the list of names that shows up in the filter gui names combob box.
 List getFilters()
          Get the Filters property.
 boolean getFiltersEnabled()
          Get the FiltersEnabled property.
 Image getImage(String what)
          Get the image of "what".
protected  ColorTable getInitialColorTable()
          Overwrite base class method so we don't have any color table.
 JButton getLockButton()
          Create and return the lcok button
 boolean getMatchAll()
          Get the MatchAll property.
 boolean getOnlyShowFiltered()
          Get the OnlyShowFiltered property.
 Range getRangeToApply()
          Overwrite base class method to return the color range to use when applying to displayables.
protected  void getSaveMenuItems(List items, boolean forMenuBar)
          Add the relevant file menu items into the list
protected  float getScale()
          Get the scaling used for this object to control the size of the shapes.
protected  float getScaleFromDisplayable()
          A utility to get the scale from the dislayable
 String getSelectedObId()
          Get the SelectedObId property.
 LatLonPoint getSelectedObLocation()
          Get the SelectedObLocation property.
 boolean getShouldUseAltitude()
          Get the ShouldUseAltitude property.
 StationModel getStationModel()
          Get the current station model view.
 String getStationModelName()
          Gets the name of the StationModel.
 boolean getStationsLocked()
          Get the locking of the stations parameter
 StationModel getTheStationModel()
          Get the StationModel property.
 TimeSeriesChart getTimeSeries()
          Get the TimeSeries property.
protected  TupleType getTupleType()
          Provide to the base class the type of the obs
 boolean getUseDataTimes()
          Get the use data times property.
 boolean getUseLastTime()
          Get the UseLastTime property.
protected  void getViewMenuItems(List items, boolean forMenuBar)
          Add a few things to the View Menu specific to this control
protected  void handleChangedStationModel(StationModel changedModel)
          The station model changed
 void handleDisplayChanged(DisplayEvent evt)
          Listen for DisplayEvents
protected  void handleMousePressed(EarthLocation el, DisplayEvent evt)
          Handle the mouse pressed event in the main display
 void handleOnlyShow(int index)
          call back from radio buttons in gui for filters
protected  boolean haveFilters()
          Do we have any filters
 boolean init(DataChoice dataChoice)
          Call to help make this kind of Display Control; also calls code to made the Displayable (empty of data thus far).
 void initAfterUnPersistence(ControlContext vc, Hashtable properties)
          Initailize after we have been unpersisted.
protected  void initDisplayable(StationModelDisplayable myDisplay)
          Initialize the displayable with another
 void initDone()
          Init is done
 void initFilters()
          Init the vis filters
protected  boolean isChartEnabled()
          Is the chart enabled?
 boolean isInitDone()
          Are we fully initialized
protected  void loadData()
          Load data into the Displayable.
protected  void loadDataInAWhile()
          This checks to see if we have a pending loadData call (from a prior event).
protected  void loadDataInThread()
          A utility method that sets the wait cursor and calls loadData in a separate thread .
protected  void makeStationModelEditMenuItems(List items, boolean forMenuBar)
          Get edit menu items
 void projectionChanged()
          Method to call if projection changes.
 void propertyChange(PropertyChangeEvent evt)
          Property change method.
 void removeChartParam(PointParam pointParam)
          Remove a parameters from the chart
protected  void resetData()
          This gets called when the control has received notification of a dataChange event.
 void setAskedUserToDeclutterTime(boolean value)
          Set the AskedUserToDeclutterTime property.
 void setChartParams(List value)
          Set the PlotVars property.
 void setChartSettings(TwoFacedObject tfo)
          recieve the chart display settings
protected  boolean setData(DataChoice choice)
          Set the data for this instance from the choice supplied.
 void setDeclutter(boolean v)
          Set whether this DisplayControl should be decluttered or not.
 void setDeclutterFilter(float filter)
          Set whether the filtering for decluttering.
 void setDisplayableScale(float f)
          Set the scale the user can enter
 void setFilters(List value)
          Set the Filters property.
 void setFiltersEnabled(boolean value)
          Set the FiltersEnabled property.
protected  void setLayoutModel(String id, StationModel stationModel)
          Set layout model
 void setMatchAll(boolean value)
          Set the MatchAll property.
 void setOnlyShowFiltered(boolean value)
          Set the OnlyShowFiltered property.
 void setScaleOnDisplayable()
          A utility to set the scale on the dislayable
protected  void setScaleOnDisplayable(float f)
          A utility to set the scale on the dislayable
 void setSelectedObId(String value)
          Set the SelectedObId property.
 void setSelectedObLocation(LatLonPoint value)
          Set the SelectedObLocation property.
 void setShouldUseAltitude(boolean value)
          Set the ShouldUseAltitude property.
 void setShouldUseAltitudeIndex(int index)
          Set the ShouldUseAltitude property.
 void setShowAllTimes(boolean value)
          Set the show all times property.
 void setShowThumbNail(boolean value)
          Set the ShowThumbNail property.
 void setStationModelFromWidget(StationModel sm)
          Set the station model
 void setStationModelName(String n)
          Sets the name of the StationModel.
 void setStationsLocked(boolean v)
          Set the locking of the stations parameter
 void setTheStationModel(StationModel value)
          Set the StationModel property.
 void setTimeSeries(TimeSeriesChart value)
          Set the TimeSeries property.
 void setUseDataTimes(boolean value)
          Set the use data times times property.
 void setUseLastTime(boolean value)
          Set the UseLastTime property.
protected  boolean shouldAddControlListener()
          Signal base class to add this as a control listener
protected  boolean shouldAddDisplayListener()
          Signal base class to add this as a display listener
 void showLineProperties(PointParam pointParam)
          Show the line properties for the PointParam
 void test()
          test method
protected  void timeChanged(Real time)
          Respond to a timeChange event
protected  void timeDeclutterChanged()
          Handle when the time decluttering state has changed
 void toFront(PointParam pointParam)
          Bring the chart parameter to the front
 void transectChanged()
          Method called when a transect changes.
protected  void updateLockButton()
          Set the icon and the tooltip on the lock button
protected  void updateTable(PointOb ob)
          Extract the observation values from the given ob and update the table.
 void viewpointChanged()
          Respond to changes in the control.
 
Methods inherited from class ucar.unidata.idv.control.ObsDisplayControl
applyPreferences, doDeclutterTime, doMakeDataInstance, doMakeFieldSelector, doMakeShowRawSelector, exportAsNetcdf, getColString, getColValue, getColValue, getDisplayUnit, getDisplayUnitName, getFieldsToShow, getIndex, getIndicesToShow, getParamLabel, getShowDataRaw, getTimeDeclutterComps, getTimeDeclutterEnabled, getTimeDeclutterMinutes, isIdParam, setColString, setShowDataRaw, setTimeDeclutterEnabled, setTimeDeclutterMinutes, showFieldSelector
 
Methods inherited from class ucar.unidata.idv.control.DisplayControlImpl
actionPerformed, activateDisplays, addAttributedDisplayable, addAttributedDisplayable, addAttributedDisplayable, addAttributeFlags, addCheckBoxSettings, addDataChoice, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayMaster, addLabelMacros, addNewData, addNoteText, addPropertiesComponents, addPropertyChangeListener, addRemovable, addSharable, addTimeModeWidget, addToControlContext, addToRangeMenu, addToRangeMenu, addToRangeMenu, addViewManager, appendDataChoices, applyAttributesToDisplayables, applyColor, applyColorScaleInfo, applyColorTable, applyColorUnit, applyContourInfo, applyDisplaySetting, applyDisplayUnit, applyLineWidth, applyProperties, applyProperties, applyPropertyValues, applyRange, applySelectRange, applySkipFactor, applySmoothing, applyTextureQuality, applyZPosition, boundsClose, canBeDocked, canExportData, canSaveDataInCache, captureWindow, centerOnDisplay, changeColorUnit, changeDisplayUnit, checkFlag, checkIfDataOk, checkImageSize, clearDataInstance, clearPrototype, clearViewManagers, close, colorUnitChanged, controlChanged, convertColorRange, convertRange, createDisplayListDisplayable, createIdvWindow, dataChanged, deactivateDisplays, debug, displayableToFront, displayChanged, displayControlFailed, displayUnitChanged, doApplyProperties, doExport, doMakeBottomLegendComponent, doMakeChangeColorMenu, doMakeChangeColorMenu, doMakeChangeParameterMenuItem, doMakeColorControl, doMakeColorControl, doMakeColorScales, doMakeMenuBar, doMakeMenuBarMenus, doMakePointSizeWidget, doMakeRemoveControl, doMakeSkipFactorSlider, doMakeTextureSlider, doMakeVisibilityControl, doMakeWidgetComponent, doMakeWindow, doMakeZPositionSlider, exportDisplayedData, findDisplayInfo, findDisplays, findDisplays, firePropertyChangeEvent, formatForCursorReadout, getActive, getAnimation, getAnimation, getAnimation, getAnimation, getAnimationInfo, getAnimationWidget, getAttributeFlags, getCachedData, getCanDoRemoveAll, getCategories, getChangeParameterLabel, getCollapseLegend, getColor, getColorDimness, getColorScaleInfo, getColorTable, getColorTableForDisplayable, getColorTableWidget, getColorUnit, getColorUnitName, getComponentHolder, getContents, getContourInfo, getControlChangeSleepTime, getControlContext, getControlMenus, getCursorReadout, getCursorReadoutInner, getCursorReadoutInner, getData, getDataChoice, getDataChoices, getDataForDisplayList, getDataInstance, getDataInstance, getDataProjectionForMenu, getDataSelection, getDataSources, getDataTimeRange, getDataTimeRange, getDataTimeSet, getDebugDetails, getDefaultColorScaleInfo, getDefaultDisplayListTemplate, getDefaultDistanceUnit, getDefaultFastRendering, getDefaultSamplingMode, getDefaultSamplingModeValue, getDefaultView, getDefaultViewDescriptor, getDefaultViewManager, getDetailsContents, getDisplayAltitudeType, getDisplayCategory, getDisplayCenter, getDisplayConventions, getDisplayedData, getDisplayId, getDisplayInfos, getDisplayListColor, getDisplayListData, getDisplayListDisplayable, getDisplayListTemplate, getDisplayMaster, getDisplayName, getDisplayScale, getDisplayUnit, getDisplayUnit, getDisplayUnitName, getDisplayVisibility, getDoCursorReadout, getEditMenuItems, getExpandedInTabs, getExtraLabelTemplate, getExtraMenus, getFileMenuItems, getFileMenuItems, getGraphicsConfiguration, getGrid, getGrid, getHadDataChoices, getHaveInitialized, getHelpIds, getHelpMenuItems, getId, getIdv, getImage, getInitDataChoices, getInitialFastRendering, getInitialRange, getInitialZPosition, getInternalAnimation, getInternalAnimation, getIsRaster, getIsTimeDriver, getLabel, getLastFileMenuItems, getLegendButtons, getLegendComponent, getLegendLabel, getLegendLabels, getLegendLabelTemplate, getLegendToolTip, getLineWidth, getLineWidthWidget, getLineWidthWidgetLabel, getLockVisibilityToggle, getLongParamName, getMacroNames, getMainPanel, getMainPanelSize, getMakeWindow, getMapDisplay, getMapViewManager, getMapViewProjection, getMenuLabel, getMyDataChoices, getNavigatedDisplay, getNoteText, getObjectStore, getOkToFireEvents, getOldColorTableOrInitialColorTable, getOriginalDataChoicesLabel, getOuterContents, getPointSize, getProperty, getProperty, getPropertyDisplayName, getRange, getRangeForColorTable, getRawDataUnit, getRequestProperties, getSamplingModeName, getSamplingModeValue, getSamplingModeValue, getSelectRange, getSelectRangeEnabled, getSelectRangeWidget, getSettingsPanel, getShortParamName, getShowInDisplayList, getShowInLegend, getShowInTabs, getShowNoteText, getSkipValue, getSkipWidgetLabel, getSmoothingFactor, getSmoothingType, getSomeAnimation, getStore, getTemplateName, getTextureQuality, getTextureQualityLabel, getTimeSet, getTitle, getTransientProperty, getUnitForColor, getUseFastRendering, getUsesTimeDriver, getUseTimesInAnimation, getVersion, getVerticalValue, getViewAnimation, getViewContext, getViewer, getViewManager, getViewManager, getViewManager, getViewManagerClassNames, getViewManagerForCapture, getViewManagers, getViewMenuItems, getVisbilityAnimationPause, getWasUnPersisted, getWindow, getWindowSize, getWindowVisible, getWindowX, getWindowY, getZPosition, getZPositionSliderLabel, guiExported, guiImported, handleWindowClosing, hasMapProjection, hasTimeMacro, haveDataTimes, haveParameterDefaults, hide, hyperlinkUpdate, inGlobeDisplay, init, init, init, initAfterUnPersistence, initAsPrototype, initAsTemplate, initBasic, initializeWithNewData, initWindow, isDisplay3D, isDisplayUnitAlsoColorUnit, isGuiShown, isInTransectView, isInViewManager, itemStateChanged, makeChangeColorMenuItems, makeLegendLabel, makeLockButton, makeRemoveButton, moveTo, notifyViewManagersOfChange, parseProperties, popup, popupDataDialog, popupDataDialog, popupDataDialog, processRequestProperties, putTransientProperty, reallySetAttributeFlags, receiveShareData, redoGuiLayout, reloadDataSource, reloadDataSourceInThread, removeDataChoice, removeDisplayable, removeDisplayables, removeDisplayables, removeOnWindowClose, removePropertyChangeListener, resetDimness, resetViewManager, revertToDefaultColorTable, revertToDefaultColorTable, revertToDefaultRange, revertToDefaultRange, saveAsFavorite, saveAsParameterDefaults, saveAsPrototype, saveAsTemplate, saveDataChoiceInCache, saveImage, selectDataChoices, setAnimationInfo, setAnimationSet, setAttributeFlags, setCachedData, setCanDoRemoveAll, setCategories, setCollapseLegend, setColor, setColorBrighter, setColorDimmer, setColorDimness, setColorScaleInfo, setColorScaleVisible, setColorTable, setColorTable, setColorTableName, setColorUnit, setColorUnitName, setComponentHolder, setContents, setContourInfo, setContourInfoParams, setData, setDataChoices, setDataInstance, setDataInstances, setDataSelection, setDataTimeRange, setDefaultSamplingMode, setDefaultView, setDisplayableVisibility, setDisplayableVisiblity, setDisplayActive, setDisplayCategory, setDisplayId, setDisplayInactive, setDisplayListColor, setDisplayListColor, setDisplayListProperties, setDisplayListTemplate, setDisplayName, setDisplayUnit, setDisplayUnitName, setDisplayVisibility, setDoCursorReadout, setExpandedInTabs, setExtraLabelTemplate, setHadDataChoices, setHelpUrl, setId, setInitDataChoices, setInitialSettings, setInitialViewManager, setIsRaster, setIsTimeDriver, setLabelAsPreference, setLegendBackground, setLegendForeground, setLegendLabel, setLegendLabelTemplate, setLineWidth, setLockVisibilityToggle, setMainPanelDimensions, setMainPanelSize, setMakeWindow, setName, setNameFromUser, setNewColorUnit, setNewDisplayUnit, setNoteText, setOkToFireEvents, setOriginalDataChoicesLabel, setParamName, setPersistedVisadData, setPointSize, setProjectionInView, setProjectionInView, setProperty, setRange, setRange, setSelectRange, setSelectRangeEnabled, setSettingsDisplayUnit, setSharedColorScaleInfo, setShowInDisplayList, setShowInLegend, setShowInTabs, setShowNoteText, setSkipValue, setSmoothingFactor, setSmoothingType, setTemplateName, setTextureQuality, setTitle, setUnitForColor, setUseFastRendering, setUsesTimeDriver, setUseTimesInAnimation, setVersion, setViewer, setViewManagerClassNames, setVisbilityAnimationPause, setWindowSize, setWindowVisible, setWindowX, setWindowY, setZPosition, setZPosition, shouldAddAnimationListener, shouldApplyFastRendering, shouldBeDocked, shouldWindowBeVisible, show, showColorControlWidget, showColorDialog, showColorDialog, showColorScaleDialog, showColorScales, showColorSwatches, showContourPropertiesDialog, showDetails, showDisplaySettingsDialog, showHelp, showLegendMenu, showNormalCursor, showProperties, showTimeRangeDialog, showWaitCursor, toFront, toggleNoteTextArea, toggleVisibilityForVectorGraphicsRendering, toggleWindow, toString, updateAnimation, updateDataInstance, updateDataSelection, updateDisplayList, updateGridDataInstance, updateLegendAndList, updateLegendLabel, updateLockButton, useSmoothingFactor, useZPosition, viewManagerChanged, viewManagerDestroyed, writeTestArchive, xxxsetDisplayActive, zSliderChanged
 
Methods inherited from class ucar.unidata.idv.control.DisplayControlBase
boxToEarth, boxToEarth, boxToEarth, boxToEarth, boxToEarth, boxToScreen, calculateRectangle, createStationTfo, earthToBox, earthToBox, earthToBoxTuple, earthToScreen, formatLevels, getLabeledReal, getLevelReal, getScreenCenter, getSelectedStation, getTmpProperty, isLeftButtonDown, logException, logException, makeEarthLocation, putTmpProperty, removeTmpProperty, screenToBox, screenToBox, screenToEarth, setStations, setStations, toBox, toEarth, userErrorMessage, userMessage
 
Methods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ucar.unidata.idv.DisplayControl
getTmpProperty, putTmpProperty, removeTmpProperty
 
Methods inherited from interface ucar.unidata.collab.Sharable
getReceiveShareTime, getShareGroup, getSharing, getUniqueId, setReceiveShareTime
 

Field Detail

lockIcon

protected static ImageIcon lockIcon
The icon used to show locked legend components


unlockIcon

protected static ImageIcon unlockIcon
The icon used to show unlocked legend components


zPositionPanel

protected JPanel zPositionPanel
holds the z position slider


layoutModelWidget

protected LayoutModelWidget layoutModelWidget
The widget to show the layout model in the gui


stationsLocked

protected boolean stationsLocked
Do we not declutter and just use the last set of decluttered stations


filters

protected List filters
filters for showing data


densityComps

protected List densityComps
List of components to disable when not delcuttering


timeDeclutterComps

protected List timeDeclutterComps
List of components to disable when not delcuttering


lastDeclutteredData

protected FieldImpl lastDeclutteredData
Keep around the last set of decluttered data


currentStationData

protected FieldImpl currentStationData
The currently displayed data

Constructor Detail

StationModelControl

public StationModelControl()
Default constructor.

Method Detail

initAfterUnPersistence

public void initAfterUnPersistence(ControlContext vc,
                                   Hashtable properties)
Initailize after we have been unpersisted.

Specified by:
initAfterUnPersistence in interface DisplayControl
Overrides:
initAfterUnPersistence in class DisplayControlImpl
Parameters:
vc - The context
properties - properties

init

public boolean init(DataChoice dataChoice)
             throws VisADException,
                    RemoteException
Call to help make this kind of Display Control; also calls code to made the Displayable (empty of data thus far). This method is called from inside DisplayControlImpl.init(several args).

Overrides:
init in class DisplayControlImpl
Parameters:
dataChoice - the DataChoice of the moment.
Returns:
true if successful
Throws:
VisADException - some problem creating a VisAD object
RemoteException - some problem creating a remote VisAD object

doInitialUpdateLegendAndList

protected void doInitialUpdateLegendAndList()
Description copied from class: DisplayControlImpl
Do the initial update legend and list

Overrides:
doInitialUpdateLegendAndList in class DisplayControlImpl

initDisplayable

protected void initDisplayable(StationModelDisplayable myDisplay)
                        throws VisADException,
                               RemoteException
Initialize the displayable with another

Parameters:
myDisplay - the display
Throws:
VisADException - some problem creating a VisAD object
RemoteException - some problem creating a remote VisAD object

initDone

public void initDone()
Init is done

Overrides:
initDone in class DisplayControlImpl

isInitDone

public boolean isInitDone()
Are we fully initialized

Specified by:
isInitDone in interface DisplayControl
Overrides:
isInitDone in class DisplayControlImpl
Returns:
is init done

getImage

public Image getImage(String what)
               throws Exception
Get the image of "what".

Overrides:
getImage in class DisplayControlImpl
Parameters:
what - the thing to get
Returns:
the image
Throws:
Exception - On badness

shouldAddDisplayListener

protected boolean shouldAddDisplayListener()
Signal base class to add this as a display listener

Overrides:
shouldAddDisplayListener in class DisplayControlImpl
Returns:
Add as display listener

shouldAddControlListener

protected boolean shouldAddControlListener()
Signal base class to add this as a control listener

Overrides:
shouldAddControlListener in class DisplayControlImpl
Returns:
Add as control listener

doMakeSideLegendComponent

protected JComponent doMakeSideLegendComponent()
Make the side legend component

Overrides:
doMakeSideLegendComponent in class DisplayControlImpl
Returns:
side legend component

timeChanged

protected void timeChanged(Real time)
Respond to a timeChange event

Overrides:
timeChanged in class DisplayControlImpl
Parameters:
time - new time

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Property change method.

Specified by:
propertyChange in interface PropertyChangeListener
Overrides:
propertyChange in class DisplayControlImpl
Parameters:
evt - event to act on

handleChangedStationModel

protected void handleChangedStationModel(StationModel changedModel)
The station model changed

Parameters:
changedModel - The changed station model_

getDataProjectionLabel

protected String getDataProjectionLabel()
What label should be used for the data projection

Overrides:
getDataProjectionLabel in class DisplayControlImpl
Returns:
data projection label

getDataProjection

public MapProjection getDataProjection()
Get the MapProjection for this data; if have a single point data object make synthetic map projection for location

Specified by:
getDataProjection in interface DisplayControl
Overrides:
getDataProjection in class DisplayControlImpl
Returns:
MapProjection for the data

handleDisplayChanged

public void handleDisplayChanged(DisplayEvent evt)
Listen for DisplayEvents

Overrides:
handleDisplayChanged in class DisplayControlImpl
Parameters:
evt - The event

handleMousePressed

protected void handleMousePressed(EarthLocation el,
                                  DisplayEvent evt)
Handle the mouse pressed event in the main display

Parameters:
el - Where the mouse is clicked
evt - The event

findClosestOb

protected PointOb findClosestOb(EarthLocation el,
                                FieldImpl theField)
                         throws VisADException,
                                RemoteException
Find the closest ob in the field to the particular EarthLocation

Parameters:
el - the EarthLocation
theField - the data to search
Returns:
the closest ob (may be null);
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

updateTable

protected void updateTable(PointOb ob)
Extract the observation values from the given ob and update the table.

Parameters:
ob - The ob

addChartParam

public void addChartParam(String paramName)
Add a chart parametere

Parameters:
paramName - the name of the parameter

chartChanged

public void chartChanged()
Handle a chart changed event


removeChartParam

public void removeChartParam(PointParam pointParam)
Remove a parameters from the chart

Parameters:
pointParam - the description of the parameter to remove

toFront

public void toFront(PointParam pointParam)
Bring the chart parameter to the front

Parameters:
pointParam - the parameter to frontten.

firstFrameDone

public void firstFrameDone()
Have we been unpersisted into a view manager that has not been displayed yet?

Specified by:
firstFrameDone in interface DisplayControl
Overrides:
firstFrameDone in class DisplayControlImpl

createStationModelDisplayable

protected StationModelDisplayable createStationModelDisplayable()
                                                         throws VisADException,
                                                                RemoteException
Create the StationModelDisplayable used by this DisplayControl. This implementation also adds it to the display. Called during init.

Returns:
StationModelDisplayable used by this instance.
Throws:
VisADException - some problem creating a VisAD object
RemoteException - some problem creating a remote VisAD object

getRangeToApply

public Range getRangeToApply()
                      throws RemoteException,
                             VisADException
Overwrite base class method to return the color range to use when applying to displayables. This is the range from the station model for any symbol that is colored by

Overrides:
getRangeToApply in class DisplayControlImpl
Returns:
Range
Throws:
RemoteException - On badness
VisADException - On badness

getInitialColorTable

protected ColorTable getInitialColorTable()
Overwrite base class method so we don't have any color table. This gets called because we turn on the FLAG_COLORTABLE to enable the color scales but we use the color table from the station model

Overrides:
getInitialColorTable in class DisplayControlImpl
Returns:
color table

getColorTableToApply

protected ColorTable getColorTableToApply()
Get the color table to use when applying to displayables

Overrides:
getColorTableToApply in class DisplayControlImpl
Returns:
color table from the layout model. May be null.

setData

protected boolean setData(DataChoice choice)
                   throws VisADException,
                          RemoteException
Set the data for this instance from the choice supplied.

Overrides:
setData in class DisplayControlImpl
Parameters:
choice - DataChoice that describes the data to be loaded.
Returns:
true if load was successful.
Throws:
VisADException - some problem creating a VisAD object
RemoteException - some problem creating a remote VisAD object
See Also:
DisplayControlImpl.setData(DataChoice)

applyTimeRange

public void applyTimeRange()
Handle some sort of time change. Either the subsetting interval changes or there is a new timestep.

Overrides:
applyTimeRange in class DisplayControlImpl

loadDataInThread

protected void loadDataInThread()
A utility method that sets the wait cursor and calls loadData in a separate thread .


loadData

protected void loadData()
Load data into the Displayable. This is called from setData(DataChoice) and whenever the projection changes. Subclasses should override this to do whatever they need to. This implementation uses a PointDataInstance to manage the data.

See Also:
ObsDisplayControl.doMakeDataInstance(DataChoice)

getTupleType

protected TupleType getTupleType()
                          throws RemoteException,
                                 VisADException
Provide to the base class the type of the obs

Overrides:
getTupleType in class ObsDisplayControl
Returns:
The tuple type
Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

getScaleFromDisplayable

protected float getScaleFromDisplayable()
A utility to get the scale from the dislayable

Returns:
The scale

setScaleOnDisplayable

public void setScaleOnDisplayable()
                           throws RemoteException,
                                  VisADException
A utility to set the scale on the dislayable

Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

setScaleOnDisplayable

protected void setScaleOnDisplayable(float f)
                              throws RemoteException,
                                     VisADException
A utility to set the scale on the dislayable

Parameters:
f - The new scale value
Throws:
RemoteException - When bad things happen
VisADException - When bad things happen

resetData

protected void resetData()
                  throws VisADException,
                         RemoteException
This gets called when the control has received notification of a dataChange event.

Overrides:
resetData in class DisplayControlImpl
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

projectionChanged

public void projectionChanged()
Method to call if projection changes. This will reset the viewScape, bounds and llBounds held by this object and then load data

Specified by:
projectionChanged in interface DisplayControl
Overrides:
projectionChanged in class DisplayControlImpl

transectChanged

public void transectChanged()
Method called when a transect changes.

Specified by:
transectChanged in interface DisplayControl
Overrides:
transectChanged in class DisplayControlImpl

fieldSelectorChanged

protected void fieldSelectorChanged()
Handle when the value in the column field has changed.

Overrides:
fieldSelectorChanged in class ObsDisplayControl

getViewMenuItems

protected void getViewMenuItems(List items,
                                boolean forMenuBar)
Add a few things to the View Menu specific to this control

Overrides:
getViewMenuItems in class DisplayControlImpl
Parameters:
items - the list of items for the menu
forMenuBar - true if for the menubar

filterData

protected FieldImpl filterData(FieldImpl obs)
                        throws Exception
Apply the filters to the given data

Parameters:
obs - The data
Returns:
The filtered data.
Throws:
Exception - When bad things happen.

setTheStationModel

public void setTheStationModel(StationModel value)
Set the StationModel property.

Parameters:
value - The new value for StationModel

getTheStationModel

public StationModel getTheStationModel()
Get the StationModel property.

Returns:
The StationModel

getStationModel

public StationModel getStationModel()
Get the current station model view.

Returns:
station model layout

setStationModelFromWidget

public void setStationModelFromWidget(StationModel sm)
Set the station model

Parameters:
sm - station model

setLayoutModel

protected void setLayoutModel(String id,
                              StationModel stationModel)
Set layout model

Parameters:
id - id
stationModel - station model

getExtraLegendComponent

protected JComponent getExtraLegendComponent(int legendType)
Assume that any display controls that have a color table widget will want the color table to show up in the legend.

Overrides:
getExtraLegendComponent in class DisplayControlImpl
Parameters:
legendType - type of legend
Returns:
The extra JComponent to use in legend

getStationModelName

public String getStationModelName()
Gets the name of the StationModel. Used by XML encoding.

Returns:
name of the StationModel

setStationModelName

public void setStationModelName(String n)
Sets the name of the StationModel.

Parameters:
n - name of the StationModel

getLockButton

public JButton getLockButton()
Create and return the lcok button

Returns:
The lock button

getControlWidgets

public void getControlWidgets(List controlWidgets)
                       throws VisADException,
                              RemoteException
Get any control widgets special to this control and add them to the list.

Overrides:
getControlWidgets in class DisplayControlImpl
Parameters:
controlWidgets - default list based on any attributes set for this DisplayControl.
Throws:
VisADException - some problem creating a VisAD object
RemoteException - some problem creating a remote VisAD object

test

public void test()
test method


editStationTable

public void editStationTable()
Popup the station model editor


doMakeVerticalPositionPanel

protected JPanel doMakeVerticalPositionPanel()
Make the gui panel for vertical position

Returns:
gui

doMakeContents

protected Container doMakeContents()
                            throws VisADException,
                                   RemoteException
Make Gui contents

Overrides:
doMakeContents in class DisplayControlImpl
Returns:
User interface contents
Throws:
RemoteException
VisADException

showLineProperties

public void showLineProperties(PointParam pointParam)
Show the line properties for the PointParam

Parameters:
pointParam - the point parameter description

timeDeclutterChanged

protected void timeDeclutterChanged()
Handle when the time decluttering state has changed

Overrides:
timeDeclutterChanged in class ObsDisplayControl

addDensityComp

protected JComponent addDensityComp(JComponent comp)
Add the given component into the list of density components that are to be enabled/disabled when the declutter checkbox is toggled.

Parameters:
comp - The component to add into the lsit
Returns:
The same component. We return it as a convenience.

addTimeDeclutterComp

protected JComponent addTimeDeclutterComp(JComponent comp)
Add the given component into the list of time declutter components that are to be enabled/disabled when the declutter checkbox is toggled.

Parameters:
comp - The component to add into the lsit
Returns:
The same component. We return it as a convenience.

getDensityControl

protected JPanel getDensityControl()
Create the 'Low' slider 'High' jpanel for the density slider.

Returns:
The panel that holds the density slider.

getEditMenuItems

protected void getEditMenuItems(List items,
                                boolean forMenuBar)
Get edit menu items

Overrides:
getEditMenuItems in class DisplayControlImpl
Parameters:
items - list of menu items
forMenuBar - true if for the menu bar

makeStationModelEditMenuItems

protected void makeStationModelEditMenuItems(List items,
                                             boolean forMenuBar)
Get edit menu items

Parameters:
items - list of menu items
forMenuBar - true if for the menu bar

addDisplaySettings

protected void addDisplaySettings(DisplaySettingsDialog dsd)
Add properties to the display settings dialog

Overrides:
addDisplaySettings in class ObsDisplayControl
Parameters:
dsd - display settings dialog

setChartSettings

public void setChartSettings(TwoFacedObject tfo)
recieve the chart display settings

Parameters:
tfo - Holds the chart to apply

isChartEnabled

protected boolean isChartEnabled()
Is the chart enabled?

Returns:
true if it is enabled

getSaveMenuItems

protected void getSaveMenuItems(List items,
                                boolean forMenuBar)
Add the relevant file menu items into the list

Overrides:
getSaveMenuItems in class DisplayControlImpl
Parameters:
items - List of menu items
forMenuBar - Is this for the menu in the window's menu bar or for a popup menu in the legend

exportAsKmz

public void exportAsKmz()
_more_


exportAsCsv

public void exportAsCsv()
Export the table as csv


haveFilters

protected boolean haveFilters()
Do we have any filters

Returns:
have filters

initFilters

public void initFilters()
Init the vis filters


applyFilters

public void applyFilters()
Apply the vis filters


doMakeFilterGui

protected JComponent doMakeFilterGui(boolean includeAll)
Make the filter GUI

Parameters:
includeAll - Include the radio buttons
Returns:
The filter gui

handleOnlyShow

public void handleOnlyShow(int index)
call back from radio buttons in gui for filters

Parameters:
index - Which radio button

getFilterNames

protected List getFilterNames()
Return the list of names that shows up in the filter gui names combob box.

Returns:
List of filter names

updateLockButton

protected void updateLockButton()
Set the icon and the tooltip on the lock button


doRemove

public void doRemove()
              throws VisADException,
                     RemoteException
Remove this DisplayControl from the system. Nulls out any objects for garbage collection, removes any ProjectionControlListeners.

Specified by:
doRemove in interface DisplayControl
Overrides:
doRemove in class ObsDisplayControl
Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

setDeclutter

public void setDeclutter(boolean v)
Set whether this DisplayControl should be decluttered or not. Used by XML persistence.

Parameters:
v - true to declutter

getDeclutter

public boolean getDeclutter()
Get whether this DisplayControl should be decluttered or not.

Returns:
true if set to declutter

setStationsLocked

public void setStationsLocked(boolean v)
Set the locking of the stations parameter

Parameters:
v - true to stationsLocked

getStationsLocked

public boolean getStationsLocked()
Get the locking of the stations parameter

Returns:
true if set to stationsLocked

setDeclutterFilter

public void setDeclutterFilter(float filter)
Set whether the filtering for decluttering. Used by XML persistence.

Parameters:
filter - value of 1 (default) for no overlap (default). 0 < filter < 1 allows some data overlap. filter > 1 causes data to be more widely spaced.

getDeclutterFilter

public float getDeclutterFilter()
Get whether this DisplayControl should be decluttered or not.

Returns:
weighting for decluttering.

getScale

protected float getScale()
Get the scaling used for this object to control the size of the shapes.

Returns:
scaling used for sizing/decluttering shapes.

getBounds

protected Rectangle2D getBounds()
Get the bounds for the visible portion of the screen.

Returns:
bounds in VisAD screen coordinates.

calculateLatLonBounds

protected LinearLatLonSet calculateLatLonBounds(Rectangle2D screenBounds)
Calculate the LatLonBounds based on the VisAD screen bound. This uses the projection for the navigated display and the screen bounds

Parameters:
screenBounds - VisAD screen bounds.
Returns:
LinearLatLonSet of screen bounds in lat/lon coordinates.

decodeFilterString

protected float decodeFilterString(String filter)
Decode the selected filter string and return the corresponding filter. This method allows someone to type in YES and NO for values of 1 and 0 respectively, as in GEMPAK.

Parameters:
filter - filter as a string
Returns:
scaling factor for filtering.

getColorWidgetLabel

public String getColorWidgetLabel()
Return the label that is to be used for the color widget

Overrides:
getColorWidgetLabel in class DisplayControlImpl
Returns:
Label used for the color widget

setFilters

public void setFilters(List value)
Set the Filters property.

Parameters:
value - The new value for Filters

getFilters

public List getFilters()
Get the Filters property.

Returns:
The Filters

setMatchAll

public void setMatchAll(boolean value)
Set the MatchAll property.

Parameters:
value - The new value for MatchAll

getMatchAll

public boolean getMatchAll()
Get the MatchAll property.

Returns:
The MatchAll

setFiltersEnabled

public void setFiltersEnabled(boolean value)
Set the FiltersEnabled property.

Parameters:
value - The new value for FiltersEnabled

getFiltersEnabled

public boolean getFiltersEnabled()
Get the FiltersEnabled property.

Returns:
The FiltersEnabled

setShowAllTimes

public void setShowAllTimes(boolean value)
Set the show all times property.

Parameters:
value - The new value for showAllTimes

setUseDataTimes

public void setUseDataTimes(boolean value)
Set the use data times times property.

Parameters:
value - The new value for use data times

getUseDataTimes

public boolean getUseDataTimes()
Get the use data times property.

Returns:
The use data times property

getDisplayableScale

public float getDisplayableScale()
Get the scale the user can enter

Returns:
The scale

setDisplayableScale

public void setDisplayableScale(float f)
Set the scale the user can enter

Parameters:
f - The scale

setUseLastTime

public void setUseLastTime(boolean value)
Set the UseLastTime property.

Parameters:
value - The new value for UseLastTime

getUseLastTime

public boolean getUseLastTime()
Get the UseLastTime property.

Returns:
The UseLastTime

viewpointChanged

public void viewpointChanged()
Respond to changes in the control.

Overrides:
viewpointChanged in class DisplayControlImpl

loadDataInAWhile

protected void loadDataInAWhile()
This checks to see if we have a pending loadData call (from a prior event). If so then - return. Else, create a runnable that will (in SLEEPTIME_MS time) check if there has been no calls to this method since it started. If so then it loads data. Else it sleeps and keeps checking.

Note: This method does not need to be synchronized because it is called from within a synchronized block above.


setOnlyShowFiltered

public void setOnlyShowFiltered(boolean value)
Set the OnlyShowFiltered property.

Parameters:
value - The new value for OnlyShowFiltered

getOnlyShowFiltered

public boolean getOnlyShowFiltered()
Get the OnlyShowFiltered property.

Returns:
The OnlyShowFiltered

setShouldUseAltitude

public void setShouldUseAltitude(boolean value)
Set the ShouldUseAltitude property.

Parameters:
value - The new value for ShouldUseAltitude

getShouldUseAltitude

public boolean getShouldUseAltitude()
Get the ShouldUseAltitude property.

Returns:
The ShouldUseAltitude property

setShouldUseAltitudeIndex

public void setShouldUseAltitudeIndex(int index)
Set the ShouldUseAltitude property.

Parameters:
index - The index

setAskedUserToDeclutterTime

public void setAskedUserToDeclutterTime(boolean value)
Set the AskedUserToDeclutterTime property.

Parameters:
value - The new value for AskedUserToDeclutterTime

getAskedUserToDeclutterTime

public boolean getAskedUserToDeclutterTime()
Get the AskedUserToDeclutterTime property.

Returns:
The AskedUserToDeclutterTime

setChartParams

public void setChartParams(List value)
Set the PlotVars property.

Parameters:
value - The new value for PlotVars

getChartParams

public List getChartParams()
Get the ChartParams property.

Returns:
The ChartParams

setSelectedObId

public void setSelectedObId(String value)
Set the SelectedObId property.

Parameters:
value - The new value for SelectedObId

getSelectedObId

public String getSelectedObId()
Get the SelectedObId property.

Returns:
The SelectedObId

setTimeSeries

public void setTimeSeries(TimeSeriesChart value)
Set the TimeSeries property.

Parameters:
value - The new value for TimeSeries

getTimeSeries

public TimeSeriesChart getTimeSeries()
Get the TimeSeries property.

Returns:
The TimeSeries

getChart

public TimeSeriesChart getChart()
Get the chart

Returns:
the chart

setShowThumbNail

public void setShowThumbNail(boolean value)
Set the ShowThumbNail property.

Parameters:
value - The new value for ShowThumbNail

setSelectedObLocation

public void setSelectedObLocation(LatLonPoint value)
Set the SelectedObLocation property.

Parameters:
value - The new value for SelectedObLocation

getSelectedObLocation

public LatLonPoint getSelectedObLocation()
Get the SelectedObLocation property.

Returns:
The SelectedObLocation