ucar.unidata.idv.control
Class CrossSectionControl

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.GridDisplayControl
                  extended by ucar.unidata.idv.control.CrossSectionControl
All Implemented Interfaces:
ActionListener, ItemListener, PropertyChangeListener, EventListener, HyperlinkListener, Sharable, DataChangeListener, DisplayControl, Prototypable, ControlListener, DisplayListener
Direct Known Subclasses:
ColorCrossSectionControl, ContourCrossSectionControl, DataTransectControl, FlowCrossSectionControl

public abstract class CrossSectionControl
extends GridDisplayControl

TODO: We need to be able to persist/unpersist the ViewManager so its state is saved. Class to make one vertical cross section display and its contents and controls. Also makes a JFrame with buttons used for control of the vertical cross section of one parameter in another display. Also includes contents of a CrossSectionViewManager, a local small vertical cross section display in its own window in this control frame.

Version:
$Revision: 1.173 $
Author:
IDV development team

Nested Class Summary
 
Nested classes/interfaces inherited from class ucar.unidata.idv.control.DisplayControlImpl
DisplayControlImpl.SideLegendLabel
 
Field Summary
protected  CoordinateSystem coordTrans
          transform to altitude
protected  CrossSectionViewManager crossSectionView
          the control window's view manager
protected  CrossSectionSelector csSelector
          the cross section selector
protected  boolean dataIs3D
          flag for 3D data
protected  boolean displayIs3D
          flag for 3D display
protected  Coord endCoord
          ending coordinate for the cross section selector
protected  EarthLocation endLocation
          ending location in earth coordinates
static String SHARE_XSLINE
          Identifier for sharing cross-section position
protected  int sizeX
          X and Y size
protected  int sizeY
          X and Y size
protected  Coord startCoord
          starting coordinate for the cross section selector
protected  EarthLocation startLocation
          starting location in earth coordinates
protected  DisplayableData vcsDisplay
          Displayable for depicting cross section in the control window
protected  DisplayableData xsDisplay
          Displayable for depicting cross section in the main window
 
Fields inherited from class ucar.unidata.idv.control.GridDisplayControl
CMD_CONTOURDIALOG, CMD_SETLEVELS, gridDataInstance, INITIAL_PROBE_EARTHLOCATION, log_, settingLevel
 
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, 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
CrossSectionControl()
          Default constructor.
 
Method Summary
protected  void addLabelMacros(String template, List patterns, List values)
          Add any macro name/value pairs.
 void addPropertiesComponents(JTabbedPane jtp)
          Add tabs to the properties dialog.
protected  void addTopographyMap()
          Wrapper around GridDisplayControl.addTopographyMap(int) to allow subclasses to set their own index.
 void applyPreferences()
          Apply preferences to this control.
 boolean canExportData()
          Can this display control write out data.
 Coord convertToDisplay(Coord from)
          Convert a Coord (x, y, z) in grid index values to a Coord in VisAD internal values; -1.0 to 1.0 in VisAD box.
protected  void createCrossSectionSelector()
          Make a Selector line which shows and controls where cross section is
protected abstract  DisplayableData createVCSDisplay()
          Create the DisplayableData that will be used to depict the data in the control's display.
protected  float[] createXFromLatLon(float[][] latlon, int numNeeded, int lonIndex)
          From an array of latitudes and longitudes, calculate an array of distance (in km) that corresponds to the distance from the first point to the numNeeded point.
protected abstract  DisplayableData createXSDisplay()
          Create the DisplayableData that will be used to depict the data in the main display.
 void crossSectionChanged()
          Load or reload data for a cross section.
 boolean doApplyProperties()
          Apply the properties
 Container doMakeContents()
          Called by doMakeWindow in DisplayControlImpl, which then calls its doMakeMainButtonPanel(), which makes more buttons.
 void doRemove()
          Remove the cross section view component from the gui to fix the funny lock up problem on linux
 boolean getAllowAutoScale()
          Get the AutoScale property.
 AnimationInfo getAnimationInfo()
          Get the AnimationInfo property.
 boolean getAutoScaleYAxis()
          Get the AutoScale property.
 boolean getAutoUpdate()
          Get the AutoUpdate property.
 void getControlWidgets(List controlWidgets)
          Get the control widgets specific to this control
 CrossSectionSelector getCrossSectionSelector()
          Get the selector used to position the cross section.
 CrossSectionViewManager getCrossSectionView()
          Get the CrossSectionView property.
protected  String getCrossSectionViewLabel()
          Get the label for the CrossSectionView
protected  CrossSectionViewManager getCrossSectionViewManager()
          Get the view manager for the control window.
 List getCursorReadoutInner(EarthLocation el, Real animationValue, int animationStep)
          Get the list of items, subclasses should override
 MapProjection getDataProjection()
          Get the projection of the data.
protected  Data getDisplayedData()
          Get the DisplayedData
protected  JComponent getDisplayTabComponent()
          Create the component that goes into the 'Display' tab
protected  void getEditMenuItems(List items, boolean forMenuBar)
          Get edit menu item
 Coord getEndCoord()
          Get the ending coordinate of the cross section selector.
 GridDisplayable getGridDisplayable()
          Get the GridDisplayable used for setting the data.
protected  double getInitialZPosition()
          Get the initial Z position
protected  EarthLocation[] getLineCoords()
          Get the line coordinates as an array of EarthLocations
protected  void getMacroNames(List names, List labels)
          Add any macro name/label pairs
protected  int getSelectorAttributeFlags()
          Return the attribute flags to apply to the cross section selector.
 Coord getStartCoord()
          Get the starting coordinate of the cross section selector.
 Range getVerticalAxisRange()
          Get the range on the vertical Axis of the cross section
 DisplayableData getVerticalCSDisplay()
          Get the DisplayableData used for depicting data in the control's display.
protected  void getViewMenuItems(List menus, boolean forMenuBar)
          Add the relevant view menu items into the list
 DisplayableData getXSDisplay()
          Get the DisplayableData used for depicting data in the main display.
protected  String getZPositionSliderLabel()
          Get the label for the Z position slider.
 boolean init(DataChoice dataChoice)
          Initialize the control using the data choice
 void initAfterUnPersistence(ControlContext vc, Hashtable properties, List preSelectedDataChoices)
          Called by the IntegratedDataViewer to initialize after this control has been unpersisted
 void initDone()
          Called after all initialization is finished.
protected  void load2DData(FieldImpl twoDData)
          Load the 2D data into the appropriate display(s)
protected  void loadData(FieldImpl fieldImpl)
          Load the external display and the local display with this data of a vertical cross section.
protected  void loadDataFromLine()
          Create and loads a 2D FieldImpl from the existing getGridDataInstance() at the position indicated by the controlling Selector line end points;
protected  FieldImpl make2DData(FieldImpl xsectSequence)
          Make a FieldImpl suitable for the plain 2D vert cross section display; of form (time -> ((x,z) -> parm)).
 void projectionChanged()
          Respond to a change in the display's projection.
 void propertyChange(PropertyChangeEvent evt)
          Handle property change
 void receiveShareData(Sharable from, Object dataId, Object[] data)
          Called when shared data is received.
protected  void reScale()
          Call to reScale the display.
 void setAllowAutoScale(boolean value)
          Set the AutoScale property.
 void setAnimationInfo(AnimationInfo value)
          Set the AnimationInfo property.
 void setAutoScaleYAxis(boolean value)
          Set the AutoScale property.
 void setAutoUpdate(boolean value)
          Set the AutoUpdate property.
 void setBackground(Color color)
          Deprecated. Keep this around for old bundles
 void setCrossSectionView(CrossSectionViewManager value)
          Set the CrossSectionView property.
protected  boolean setData(DataChoice dataChoice)
          Called when the user asked for a new kind of parameter to be displayed in a pre-existing display of this class, with other kind of data already displayed there.
 void setDisplayMatrix(double[] value)
          Deprecated. Keep this around for old bundles
 void setEndCoord(Coord c)
          Set the ending coordinate of the cross section selector.
 void setForeground(Color color)
          Deprecated. Keep this around for old bundles
 void setStartCoord(Coord c)
          Set the starting coordinate of the cross section selector.
 void setVerticalAxisRange(Range range)
          Set the range on the Y Axis of the cross section
protected  void setYAxisRange(XSDisplay display, Range range)
          Methods to do the things that need to be done when the data range changes.
protected  boolean shouldAddControlListener()
          A hook to allow derived classes to tell us to add this as a control listener
 void transectChanged()
          Method called when a transect changes.
protected  void updateLocationLabel()
          Called when a change in position occurs
protected  void updateViewParameters()
          This method is used to update anything that needs to be updated in the CrossSectionViewManager.
 void viewpointChanged()
          Noop for the ControlListener interface
 
Methods inherited from class ucar.unidata.idv.control.GridDisplayControl
actionPerformed, addTopographyMap, convertColorRange, doMakeContourLevelControl, doMakeDataInstance, doMakeLevelControl, doMakeLevelControl, getColorParamName, getColorRangeFromData, getColorRangeIndex, getColorUnit, getContourInfo, getCursorReadoutData, getDefaultContourInfo, getDisplayUnit, getGridDataInstance, getInitialColorTable, getInitialRange, getRawDataUnit, haveMultipleFields, initializeDefaultContourInfo, isDisplayUnitAlsoColorUnit, setLevel, setLevel, setLevelFromUser
 
Methods inherited from class ucar.unidata.idv.control.DisplayControlImpl
activateDisplays, addAttributedDisplayable, addAttributedDisplayable, addAttributedDisplayable, addAttributeFlags, addCheckBoxSettings, addDataChoice, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayMaster, addDisplaySettings, addNewData, addNoteText, addPropertyChangeListener, addSharable, addToRangeMenu, addToRangeMenu, addToRangeMenu, addViewManager, appendDataChoices, applyAttributesToDisplayables, applyColor, applyColorScaleInfo, applyColorTable, applyColorUnit, applyContourInfo, applyDisplaySetting, applyDisplayUnit, applyLineWidth, applyProperties, applyProperties, applyPropertyValues, applyRange, applySelectRange, applySkipFactor, applyTimeRange, applyZPosition, boundsClose, canBeDocked, canSaveDataInCache, captureWindow, changeColorUnit, changeDisplayUnit, checkFlag, checkIfDataOk, checkImageSize, clearDataInstance, clearPrototype, clearViewManagers, close, colorUnitChanged, controlChanged, convertColorRange, convertRange, createDisplayListDisplayable, createIdvWindow, dataChanged, deactivateDisplays, debug, displayableToFront, displayChanged, displayControlFailed, displayUnitChanged, doMakeBottomLegendComponent, doMakeChangeColorMenu, doMakeChangeColorMenu, doMakeChangeParameterMenuItem, doMakeColorControl, doMakeColorControl, doMakeColorScales, doMakeMenuBar, doMakeMenuBarMenus, doMakeRemoveControl, doMakeSideLegendComponent, doMakeSkipFactorSlider, doMakeVisibilityControl, doMakeWidgetComponent, doMakeWindow, doMakeZPositionSlider, exportDisplayedData, findDisplayInfo, findDisplays, findDisplays, firePropertyChangeEvent, firstFrameDone, formatForCursorReadout, getActive, getAnimation, getAnimation, getAnimation, getAnimation, getAnimationWidget, getAttributeFlags, getCachedData, getCanDoRemoveAll, getCategories, getChangeParameterLabel, getCollapseLegend, getColor, getColorDimness, getColorScaleInfo, getColorTable, getColorTableForDisplayable, getColorTableToApply, getColorTableWidget, getColorUnitName, getColorWidgetLabel, getComponentHolder, getContents, getControlChangeSleepTime, getControlContext, getCursorReadout, getDataChoice, getDataChoices, getDataInstance, getDataInstance, getDataProjectionForMenu, getDataProjectionLabel, getDataSelection, getDataSources, getDataTimeRange, getDataTimeRange, getDataTimeSet, getDebugDetails, getDefaultColorScaleInfo, getDefaultDistanceUnit, getDefaultFastRendering, getDefaultSamplingMode, getDefaultSamplingModeValue, getDefaultView, getDefaultViewDescriptor, getDefaultViewManager, getDetailsContents, getDisplayAltitudeType, getDisplayCategory, getDisplayCenter, getDisplayConventions, getDisplayId, getDisplayInfos, getDisplayListColor, getDisplayListData, getDisplayListDisplayable, getDisplayListTemplate, getDisplayMaster, getDisplayName, getDisplayScale, getDisplayUnit, getDisplayUnitName, getDisplayVisibility, getDoCursorReadout, getEditMenuItems, getExpandedInTabs, getExtraLabelTemplate, getExtraLegendComponent, getExtraMenus, getFileMenuItems, getFileMenuItems, getGraphicsConfiguration, getHadDataChoices, getHaveInitialized, getHelpIds, getHelpMenuItems, getId, getIdv, getImage, getImage, getInitDataChoices, getLabel, getLastFileMenuItems, getLegendButtons, getLegendComponent, getLegendLabel, getLegendLabels, getLegendLabelTemplate, getLegendToolTip, getLineWidth, getLineWidthWidget, getLineWidthWidgetLabel, getLockVisibilityToggle, getLongParamName, getMainPanel, getMainPanelSize, getMakeWindow, getMapDisplay, getMapViewManager, getMapViewProjection, getMenuLabel, getMyDataChoices, getNavigatedDisplay, getNoteText, getObjectStore, getOkToFireEvents, getOldColorTableOrInitialColorTable, getOriginalDataChoicesLabel, getOuterContents, getProperty, getProperty, getPropertyDisplayName, getRange, getRangeForColorTable, getRangeToApply, getRequestProperties, getSamplingModeName, getSamplingModeValue, getSaveMenuItems, 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, guiExported, guiImported, handleDisplayChanged, handleWindowClosing, hasMapProjection, haveDataTimes, haveParameterDefaults, hide, hyperlinkUpdate, init, init, init, initAfterUnPersistence, initAsPrototype, initAsTemplate, initBasic, initializeWithNewData, initWindow, isDisplay3D, isGuiShown, isInitDone, isInTransectView, isInViewManager, itemStateChanged, makeChangeColorMenuItems, makeLegendLabel, makeLockButton, makeRemoveButton, moveTo, notifyViewManagersOfChange, parseProperties, popup, popupDataDialog, popupDataDialog, popupDataDialog, processRequestProperties, putTransientProperty, redoGuiLayout, reloadDataSource, reloadDataSourceInThread, removeDataChoice, removeDisplayable, removeDisplayables, removeOnWindowClose, removePropertyChangeListener, resetData, resetDimness, resetViewManager, revertToDefaultColorTable, revertToDefaultColorTable, revertToDefaultRange, revertToDefaultRange, saveAsFavorite, saveAsParameterDefaults, saveAsPrototype, saveAsTemplate, saveDataChoiceInCache, saveImage, 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, setDisplayListProperties, setDisplayListTemplate, setDisplayName, setDisplayUnit, setDisplayUnitName, setDisplayVisibility, setDoCursorReadout, setExpandedInTabs, setExtraLabelTemplate, setHadDataChoices, setHelpUrl, setId, setInitDataChoices, setInitialSettings, setLabelAsPreference, setLegendBackground, setLegendForeground, setLegendLabel, setLegendLabelTemplate, setLineWidth, setLockVisibilityToggle, setMainPanelDimensions, setMainPanelSize, setMakeWindow, setName, setNameFromUser, setNewColorUnit, setNewDisplayUnit, setNoteText, setOkToFireEvents, setOriginalDataChoicesLabel, setParamName, setPersistedVisadData, setProjectionInView, setProjectionInView, setProperty, setRange, setRange, setSelectRange, setSelectRangeEnabled, setSettingsDisplayUnit, setSharedColorScaleInfo, setShowInDisplayList, setShowInLegend, setShowInTabs, setShowNoteText, setSkipValue, setTemplateName, setTitle, setUnitForColor, setUseFastRendering, setUseTimesInAnimation, setVersion, setViewer, setViewManagerClassNames, setWindowSize, setWindowVisible, setWindowX, setWindowY, setZPosition, shouldAddAnimationListener, shouldAddDisplayListener, shouldApplyFastRendering, shouldBeDocked, shouldWindowBeVisible, show, showColorControlWidget, showColorDialog, showColorDialog, showColorScaleDialog, showColorScales, showColorSwatches, showContourPropertiesDialog, showDetails, showDisplaySettingsDialog, showHelp, showLegendMenu, showNormalCursor, showProperties, showTimeRangeDialog, showWaitCursor, timeChanged, toFront, toggleNoteTextArea, toggleWindow, toString, updateAnimation, updateDisplayList, updateLegendAndList, updateLegendLabel, updateLockButton, 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, getScreenCenter, getSelectedStation, isLeftButtonDown, logException, logException, makeEarthLocation, screenToBox, screenToBox, screenToEarth, setStations, setStations, toBox, toEarth, userErrorMessage, userMessage
 
Methods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, removeSharable, setShareGroup,