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 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, controlContext, ctw, cw, dataSelection, defaultView, defaultViewManager, DISPLAY_LIST_NAME, displayListTable, displayMasters, displayUnit, helpUrl, initNoteText, instantiatedWithNoData, noteTextArea, noteWrapper, paramName, requestProperties, settingVisibility, sharables, showNoteText, skipSlider, srw, version, viewManagers
 
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_TIMERANGE, FLAG_ZPOSITION, GRID_INSETS, ICON_LOCK, ICON_REMOVE, ICON_UNLOCK, LABEL_NONE, log_, MACRO_DATASOURCENAME, MACRO_DISPLAYNAME, MACRO_DISPLAYUNIT, MACRO_LONGNAME, MACRO_POSITION, MACRO_SHORTNAME, 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, 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  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
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.
 void initDone()
          Init is done
 void initFilters()
          Init the vis filters
protected  boolean isChartEnabled()
          Is the chart enabled?
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
protected  JPanel makeStationModelWidget()
          Make the gui widget for setting the station model
 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.
 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 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, 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, addSharable, addToRangeMenu, addToRangeMenu, addToRangeMenu, addViewManager, appendDataChoices, applyAttributesToDisplayables, applyColor, applyColorScaleInfo, applyColorTable, applyColorUnit, applyContourInfo, applyDisplaySetting, applyDisplayUnit, applyLineWidth, applyProperties, applyProperties, applyPropertyValues, applyRange, applySelectRange, applySkipFactor, applyZPosition, boundsClose, canBeDocked, canExportData, canSaveDataInCache, captureWindow, changeColorUnit, changeDisplayUnit, checkFlag, checkIfDataOk, checkImageSize, clearDataInstance, clearPrototype, clearViewManagers, close, colorUnitChanged, controlChanged, convertColorRange, convertRange, createDisplayListDisplayable, createIdvWindow, dataChanged, deactivateDisplays, debug, displayableToFront, displayChanged, displayControlFailed, displayUnitChanged, doApplyProperties, doMakeBottomLegendComponent, doMakeChangeColorMenu, doMakeChangeColorMenu, doMakeChangeParameterMenuItem, doMakeColorControl, doMakeColorControl, doMakeColorScales, doMakeMenuBar, doMakeMenuBarMenus, doMakeRemoveControl, doMakeSkipFactorSlider, 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, getCursorReadout, getCursorReadoutInner, getDataChoice, getDataChoices, getDataInstance, getDataInstance, getDataProjectionForMenu, getDataSelection, getDataSources, getDataTimeRange, getDataTimeRange, getDataTimeSet, getDebugDetails, getDefaultColorScaleInfo, 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, getHadDataChoices, getHaveInitialized, getHelpIds, getHelpMenuItems, getId, getIdv, getImage, getInitDataChoices, getInitialRange, getInitialZPosition, 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, getProperty, getProperty, getPropertyDisplayName, getRange, getRangeForColorTable, getRawDataUnit, getRequestProperties, getSamplingModeName, getSamplingModeValue, getSelectRange, getSelectRangeEnabled, getSelectRangeWidget, getSettingsPanel, getShortParamName, getShowInDisplayList, getShowInLegend, getShowInTabs, getShowNoteText, getSkipValue, getSkipWidgetLabel, getStore, getTemplateName, getTimeSet, getTitle, getTransientProperty, getUnitForColor, getUseFastRendering, getUseTimesInAnimation, getVersion, getVerticalValue, getViewContext, getViewer, getViewManager, getViewManager, getViewManager, getViewManagerClassNames, getViewManagers, getViewMenuItems, getWasUnPersisted, getWindow, getWindowSize, getWindowVisible, getWindowX, getWindowY, getZPosition, getZPositionSliderLabel, guiExported, guiImported, handleWindowClosing, hasMapProjection, haveDataTimes, haveParameterDefaults, hide, hyperlinkUpdate, init, init, init, initAfterUnPersistence, initAsPrototype, initAsTemplate, initBasic, initializeWithNewData, initWindow, isDisplay3D, isDisplayUnitAlsoColorUnit, isGuiShown, isInitDone, isInTransectView, isInViewManager, itemStateChanged, makeChangeColorMenuItems, makeLegendLabel, makeLockButton, makeRemoveButton, moveTo, notifyViewManagersOfChange, parseProperties, popup, popupDataDialog, popupDataDialog, popupDataDialog, processRequestProperties, putTransientProperty, receiveShareData, redoGuiLayout, reloadDataSource, reloadDataSourceInThread, removeDataChoice, removeDisplayable, removeDisplayables, removeOnWindowClose, removePropertyChangeListener, resetDimness, resetViewManager, revertToDefaultColorTable, revertToDefaultColorTable, revertToDefaultRange, revertToDefaultRange, saveAsFavorite, saveAsParameterDefaults, saveAsPrototype, saveAsTemplate, saveDataChoiceInCache, saveImage, 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, setDataT