Package ucar.unidata.idv.control
Class CrossSectionControl
java.lang.Object
ucar.unidata.collab.SharableImpl
ucar.unidata.idv.control.DisplayControlBase
ucar.unidata.idv.control.DisplayControlImpl
ucar.unidata.idv.control.GridDisplayControl
ucar.unidata.idv.control.CrossSectionControl
- All Implemented Interfaces:
ActionListener,ItemListener,PropertyChangeListener,EventListener,HyperlinkListener,Sharable,DataChangeListener,DisplayControl,Prototypable,DisplayableData.DragAdapter,ControlListener,DisplayListener
- Direct Known Subclasses:
ColorCrossSectionControl,ContourCrossSectionControl,DataTransectControl,FlowCrossSectionControl
public abstract class CrossSectionControl
extends GridDisplayControl
implements DisplayableData.DragAdapter
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
FieldsModifier and TypeFieldDescriptionprotected AnimationInfoanimation info for the crossSectionViewprotected JPanel_more_protected CoordinateSystemtransform to altitudeprotected CrossSectionViewManagerthe control window's view managerprotected CrossSectionSelectorthe cross section selectorprotected booleanflag for 3D dataprotected booleanflag for 3D displayprotected double[]Keep around to reset zoom/panprotected Coordending coordinate for the cross section selectorprotected EarthLocationending location in earth coordinatesprotected RealTupleinitial ending pointprotected RealTupleinitial starting pointprotected Listlist of levelsprotected boolean_more_static final StringIdentifier for sharing cross-section positionprotected intX and Y sizeprotected intX and Y sizeprotected Coordstarting coordinate for the cross section selectorprotected EarthLocationstarting location in earth coordinatesprotected DisplayableDataDisplayable for depicting cross section in the control windowprotected Rangerange for Y axisprotected DisplayableDataDisplayable for depicting cross section in the main windowFields inherited from class ucar.unidata.idv.control.GridDisplayControl
CMD_CONTOURDIALOG, CMD_SETLEVELS, gridDataInstance, INITIAL_PROBE_EARTHLOCATION, log_, settingLevelFields 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, isProgressiveResolution, matchDisplayRegion, noteTextArea, noteWrapper, paramName, reloadFromBounds, requestProperties, resolutionReadout, selectRangeWidget, settingVisibility, sharables, showNoteText, skipSlider, version, viewManagers, ZFUDGEFields inherited from class ucar.unidata.idv.control.DisplayControlBase
APPEARANCE_DARK, APPEARANCE_IDV, APPEARANCE_LIGHT, 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_GRIDTRAJECTORY, 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, MACRO_DATASOURCENAME, MACRO_DISPLAYNAME, MACRO_DISPLAYUNIT, MACRO_FHOUR, MACRO_FHOUR2, MACRO_LONGNAME, MACRO_POSITION, MACRO_RESOLUTION, 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_AVERAGEFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdd display settings for cross section controlsprotected voidaddLabelMacros(String template, List patterns, List values) Add any macro name/value pairs.protected voidaddNewData(List newChoices) Handle the newly added data from view or edit menuvoidAdd tabs to the properties dialog.protected voidWrapper aroundGridDisplayControl.addTopographyMap(int)to allow subclasses to set their own index.voidApply preferences to this control.protected voidUse the value of the smoothing type and weight to subset the data.protected voidApply the Z position.boxToEarth(RealTuple tuple) Transform VisAD box coordinates to and EarthLocationbooleanCan this display control write out data.booleanconstrainDragPoint(float[] position) Constrain the drag pointconvertToDisplay(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 voidMake a Selector line which shows and controls where cross section isprotected voidcreateCrossSectionSelector(EarthLocation loc1, EarthLocation loc2) Create the cross section selectorprotected voidcreateCrossSectionSelector1(RealTuple start, RealTuple end) Create the cross section selectorprotected abstract DisplayableDataCreate theDisplayableDatathat 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 DisplayableDataCreate theDisplayableDatathat will be used to depict the data in the main display.voidLoad or reload data for a cross section.booleanApply the propertiesvoidCalled by ISL.protected JMenuItemUtility to make the menu item for changing the data choiceCalled by doMakeWindow in DisplayControlImpl, which then calls its doMakeMainButtonPanel(), which makes more buttons.voiddoRemove()Remove the cross section view component from the gui to fix the funny lock up problem on linuxbooleanGet the AutoScale property.get the altUnit property.Get the AnimationInfo property.booleanGet the AutoScale property.booleanGet the AutoUpdate property.protected StringReturn the appropriate label text for the menu.get the controlList property.voidgetControlWidgets(List controlWidgets) Get the control widgets specific to this controlGet the selector used to position the cross section.getCrossSectionVerticalRange(GriddedSet domainSet) _more_Get the CrossSectionView property.protected StringGet the label for the CrossSectionViewprotected CrossSectionViewManagerGet the view manager for the control window.getCursorReadoutInner(EarthLocation el, Real animationValue, int animationStep, List<ReadoutInfo> samples) Get the cursor readout infoGet the projection of the data._more__more_protected DataGet the DisplayedDataprotected JComponentCreate the component that goes into the 'Display' tabprotected voidgetEditMenuItems(List items, boolean forMenuBar) Get edit menu itemSet the probe position property; used by XML persistence.Get theGridDisplayableused for setting the data.protected doubleGet the initial Z positionprotected EarthLocation[]Get the line coordinates as an array of EarthLocationsget line range -- should be overridden by sub classes that actually set the valuebooleanGet the LineVisible property.protected voidgetMacroNames(List names, List labels) Add any macro name/label pairsgetPressureLabels(String[] labels) get y (altitude) axis pressure values hashtabledoubleGet the selector altitude from the Z positionprotected intReturn the attribute flags to apply to the cross section selector.Set the probe position property; used by XML persistence.Get the range on the vertical Axis of the cross sectionGet theDisplayableDataused for depicting data in the control's display.Get the view manager for captureprotected voidgetViewMenuItems(List menus, boolean forMenuBar) Add the relevant view menu items into the listGet theDisplayableDataused for depicting data in the main display.protected StringGet the label for the Z position slider.booleanhandleAddPoint(float[] x) Handle adding a pointbooleanhandleDragDirect(VisADRay ray, boolean first, int mouseModifiers) Implementation of the DisplayableData.DragAdapterbooleaninit(DataChoice dataChoice) Initialize the control using the data choicevoidinitAfterUnPersistence(ControlContext vc, Hashtable properties, List preSelectedDataChoices) Called by theIntegratedDataViewerto initialize after this control has been unpersistedvoidinitDone()Called after all initialization is finished.protected voidload2DData(FieldImpl twoDData) Load the 2D data into the appropriate display(s)protected voidLoad the external display and the local display with this data of a vertical cross section.protected voidCreate and loads a 2D FieldImpl from the existing getGridDataInstance() at the position indicated by the controlling Selector line end points;protected FieldImplmake2DData(FieldImpl xsectSequence) Make a FieldImpl suitable for the plain 2D vert cross section display; of form (time -> ((x) -> parm)); new x axis positions are in distance along cross section from one end.protected GriddedSetmake2DDomainSet(GriddedSet domainSet) Make the domain for the 2D gridprotected voidprocessNewData(List newChoices) Override base class method which is called when the user has selected new data choices.protected voidprocessNewData(DataChoice dc, CrossSectionControl csc) Override base class method which is called when the user has selected new data choices.voidprocessNewDataV(List newChoices) Override base class method which is called when the user has selected new data choices.voidprocessNewDataV(DataChoice dc, CrossSectionControl csc) Override base class method which is called when the user has selected new data choices.voidRespond to a change in the display's projection.voidHandle property changevoidreceiveShareData(Sharable from, Object dataId, Object[] data) Called when shared data is received.voidrelocateDisplay(ucar.unidata.geoloc.LatLonRect originalBounds, ucar.unidata.geoloc.LatLonRect newBounds, boolean useDataProjection) When we relocate a bundle this gets called to relocate the display This method gets overwritten by the probe and cross section displays so they can move their selection points to a new locationvoidremoveControl(String name) Remove the datachoice from controlvoidremoveDisplayables(String dcName) Remove the naming displays from controlprotected voidreScale()Call to reScale the display.protected voidreSetTimeHeightAltitudeUnit(Unit aUnit) This gets called by changing the altitude unitvoidsetAllowAutoScale(boolean value) Set the AutoScale property.voidsetAltUnit(Unit unit) set the altUnit property.voidsetAnimationInfo(AnimationInfo value) Set the AnimationInfo property.voidsetAutoScaleYAxis(boolean value) Set the AutoScale property.voidsetAutoUpdate(boolean value) Set the AutoUpdate property.voidsetBackground(Color color) Set the background colorvoidSet the controlList property.voidSet the CrossSectionView property.protected booleansetData(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.voidsetDisplayMatrix(double[] value) Set the DisplayMatrix property.voidsetEndCoord(Coord c) Set the ending coordinate of the cross section selector.voidSet the probe position property; used by XML persistence.voidsetForeground(Color color) Set the foreground colorvoidsetInitAlt(double value) _more_voidsetInitLat1(double value) Set the InitLat1 property.voidsetInitLat2(double value) Set the Lat2 property.voidsetInitLon1(double value) Set the Lon1 property.voidsetInitLon2(double value) Set the Lon2 property.voidsetLineVisible(boolean value) Set the LineVisible property.protected voidsetPosition(EarthLocation startLoc, EarthLocation endLoc) Set the position of the selectorvoidSet the starting coordinate of the cross section selector.voidSet the probe position property; used by XML persistence.voidsetVerticalAxisRange(Range range) Set the range on the Y Axis of the cross sectionprotected voidsetYAxisRange(XSDisplay display, Range range) Methods to do the things that need to be done when the data range changes.protected booleanA hook to allow derived classes to tell us to add this as a control listenervoidMethod called when a transect changes.protected voidCalled when a change in position occursprotected voidThis method is used to update anything that needs to be updated in the CrossSectionViewManager.voidNoop for the ControlListener interfaceMethods inherited from class ucar.unidata.idv.control.GridDisplayControl
actionPerformed, addTopographyMap, addTopographyMap, applyForecastHourMacro, canDoProgressiveResolution, convertColorRange, doMakeContourLevelControl, doMakeDataInstance, doMakeLevelControl, doMakeLevelControl, exportDisplayedData, getColorParamName, getColorRangeFromData, getColorRangeIndex, getColorUnit, getContourInfo, getCursorReadoutData, getDataRangeInColorUnits, getDefaultContourInfo, getDisplayUnit, getGridDataInstance, getInitialColorTable, getInitialRange, getRawDataUnit, haveMultipleFields, initializeDefaultContourInfo, isDisplayUnitAlsoColorUnit, normalizeRectangle, setLevel, setLevel, setLevelFromUser, shouldAddDisplayListenerMethods inherited from class ucar.unidata.idv.control.DisplayControlImpl
activateDisplays, addAttributedDisplayable, addAttributedDisplayable, addAttributedDisplayable, addAttributeFlags, addCheckBoxSettings, addDataChoice, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayMaster, addNoteText, 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, applyTextureQuality, applyTimeRange, boundsClose, canBeDocked, canSaveDataInCache, captureWindow, centerOnDisplay, changeColorUnit, changeDisplayUnit, checkBoundsChange, checkFlag, checkIfDataOk, checkImageSize, clearDataInstance, clearPrototype, clearViewManagers, close, colorUnitChanged, controlChanged, convertColorRange, convertRange, createDisplayListDisplayable, createIdvWindow, dataChanged, deactivateDisplays, debug, displayableToFront, displayChanged, displayControlFailed, displayUnitChanged, doInitialUpdateLegendAndList, doMakeBottomLegendComponent, doMakeChangeColorMenu, doMakeChangeColorMenu, doMakeColorControl, doMakeColorControl, doMakeColorScales, doMakeMenuBar, doMakeMenuBarMenus, doMakePointSizeWidget, doMakeRemoveControl, doMakeSideLegendComponent, doMakeSkipFactorSlider, doMakeSmoothingWidget, doMakeTextureSlider, doMakeVisibilityControl, doMakeWidgetComponent, doMakeWindow, doMakeZPositionSlider, findDisplayInfo, findDisplays, findDisplays, firePropertyChangeEvent, firstFrameDone, formatForCursorReadout, getActive, getAnimation, getAnimation, getAnimation, getAnimation, getAnimationWidget, getAttributeFlags, getCachedData, getCanDoRemoveAll, getCategories, getCollapseLegend, getColor, getColorDimness, getColorScaleInfo, getColorTable, getColorTableForDisplayable, getColorTableToApply, getColorTableWidget, getColorUnitName, getColorWidgetLabel, getComponentHolder, getContents, getControlChangeSleepTime, getControlContext, getControlMenus, getCursorReadout, getCursorReadoutInner, getData, getDataChoice, getDataChoices, getDataForDisplayList, getDataInstance, getDataInstance, getDataProjectionForMenu, getDataProjectionLabel, getDataSelection, getDataSources, getDataTimeRange, getDataTimeRange, getDataTimeSet, getDebugDetails, getDefaultColorScaleInfo, getDefaultDisplayListTemplate, 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, getGrid, getGrid, getHadDataChoices, getHaveInitialized, getHelpIds, getHelpMenuItems, getId, getIdv, getImage, getImage, getInitDataChoices, getInitialFastRendering, getInternalAnimation, getInternalAnimation, getIsProgressiveResolution, getIsRaster, getIsTimeDriver, getLabel, getLastFileMenuItems, getLatLonPoints, getLegendButtons, getLegendComponent, getLegendLabel, getLegendLabels, getLegendLabelTemplate, getLegendToolTip, getLineWidth, getLineWidthWidget, getLineWidthWidgetLabel, getLockVisibilityToggle, getLongParamName, getMainPanel, getMainPanelSize, getMakeWindow, getMapDisplay, getMapViewManager, getMapViewProjection, getMatchDisplayRegion, getMenuLabel, getMyDataChoices, getNavigatedDisplay, getNoteText, getObjectStore, getOkToFireEvents, getOldColorTableOrInitialColorTable, getOriginalDataChoicesLabel, getOuterContents, getPointSize, getProperty, getProperty, getPropertyDisplayName, getRange, getRangeForColorTable, getRangeToApply, getRequestProperties, getSamplingModeName, getSamplingModeValue, getSamplingModeValue, getSaveMenuItems, getSelectRange, getSelectRangeEnabled, getSelectRangeWidget, getSettingsPanel, getShortParamName, getShoulDoProgressiveResolution, 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, getViewManagers, getViewMenuItems, getVisbilityAnimationPause, getWasUnPersisted, getWindow, getWindowSize, getWindowVisible, getWindowX, getWindowY, getZPosition, guiExported, guiImported, handleDisplayChanged, handleWindowClosing, hasForecastHourMacro, hasMapProjection, hasTimeMacro, haveDataTimes, haveParameterDefaults, hide, hyperlinkUpdate, inGlobeDisplay, init, init, init, initAfterUnPersistence, initAsPrototype, initAsTemplate, initBasic, initializeWithNewData, initWindow, isDisplay3D, isGuiShown, isInitDone, isInTransectView, isInViewManager, itemStateChanged, loadDataFromViewBounds, makeChangeColorMenuItems, makeLegendLabel, makeLockButton, makeRemoveButton, moveTo, notifyViewManagersOfChange, parseProperties, popup, popupDataDialog, popupDataDialog, popupDataDialog, processRequestProperties, putTransientProperty, reallySetAttributeFlags, redoGuiLayout, reloadDataSource, reloadDataSourceInThread, relocateDisplay, removeDataChoice, removeDisplayable, removeDisplayables, removeDisplayables, removeOnWindowClose, removePropertyChangeListener, resetData, resetDimness, resetViewManager, revertToDefaultColorTable, revertToDefaultColorTable, revertToDefaultRange, revertToDefaultRange, saveAsFavorite, saveAsParameterDefaults, saveAsPrototype, saveAsTemplate, saveDataChoiceInCache, saveImage, saveProjection, selectDataChoices, 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, setDisplayAreaSubset, setDisplayCategory, setDisplayId, setDisplayInactive, setDisplayListColor, setDisplayListColor, setDisplayListProperties, setDisplayListTemplate, setDisplayListTimeZone, setDisplayName, setDisplayUnit, setDisplayUnitName, setDisplayVisibility, setDoCursorReadout, setExpandedInTabs, setExtraLabelTemplate, setHadDataChoices, setHelpUrl, setId, setInitDataChoices, setInitialSettings, setInitialViewManager, setIsProgressiveResolution, setIsRaster, setIsTimeDriver, setLabelAsPreference, setLegendBackground, setLegendForeground, setLegendLabel, setLegendLabelTemplate, setLineWidth, setLockVisibilityToggle, setMainPanelDimensions, setMainPanelSize, setMakeWindow, setMatchDisplayRegion, setName, setNameFromUser, setNewColorUnit, setNewDisplayUnit, setNoteText, setOkToFireEvents, setOriginalDataChoicesLabel, setParamName, setPersistedVisadData, setPointSize, setProjectionInView, 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, timeChanged, toFront, toggleNoteTextArea, toggleVisibilityForVectorGraphicsRendering, toggleWindow, toString, updateAnimation, updateDataInstance, updateDataSelection, updateDisplayList, updateGridDataInstance, updateLegendAndList, updateLegendLabel, updateLockButton, useSmoothingFactor, useZPosition, viewManagerChanged, viewManagerDestroyed, writeTestArchive, xxxsetDisplayActive, zSliderChangedMethods 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, userMessageMethods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialogMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ucar.unidata.idv.DisplayControl
getTmpProperty, putTmpProperty, removeTmpPropertyMethods inherited from interface ucar.unidata.collab.Sharable
getReceiveShareTime, getShareGroup, getSharing, getUniqueId, setReceiveShareTime
-
Field Details
-
SHARE_XSLINE
Identifier for sharing cross-section position- See Also:
-
vcsDisplay
Displayable for depicting cross section in the control window -
xsDisplay
Displayable for depicting cross section in the main window -
csSelector
the cross section selector -
initStartPoint
initial starting point -
initEndPoint
initial ending point -
lineVisible
protected boolean lineVisible_more_ -
crossSectionView
the control window's view manager -
displayMatrix
protected double[] displayMatrixKeep around to reset zoom/pan -
animationInfo
animation info for the crossSectionView -
coordTrans
transform to altitude -
sizeX
protected int sizeXX and Y size -
sizeY
protected int sizeYX and Y size -
displayIs3D
protected boolean displayIs3Dflag for 3D display -
dataIs3D
protected boolean dataIs3Dflag for 3D data -
startCoord
starting coordinate for the cross section selector -
endCoord
ending coordinate for the cross section selector -
startLocation
starting location in earth coordinates -
endLocation
ending location in earth coordinates -
verticalAxisRange
range for Y axis -
levelsList
list of levels -
controlPane
_more_
-
-
Constructor Details
-
CrossSectionControl
public CrossSectionControl()Default constructor. Sets the appropriate attribute flags.
-
-
Method Details
-
createXSDisplay
Create theDisplayableDatathat will be used to depict the data in the main display.- Returns:
- depictor for data in main display
- Throws:
VisADException- unable to create depictorRemoteException- unable to create depictor (shouldn't happen)
-
createVCSDisplay
Create theDisplayableDatathat will be used to depict the data in the control's display.- Returns:
- depictor for data in main display
- Throws:
VisADException- unable to create depictorRemoteException- unable to create depictor (shouldn't happen)
-
getGridDisplayable
Get theGridDisplayableused for setting the data.- Returns:
- data's
GridDisplayable
-
getVerticalCSDisplay
Get theDisplayableDataused for depicting data in the control's display.- Returns:
- control's display depictor
-
getXSDisplay
Get theDisplayableDataused for depicting data in the main display.- Returns:
- main display depictor
-
getCrossSectionSelector
Get the selector used to position the cross section.- Returns:
- this controls selector
-
initAfterUnPersistence
public void initAfterUnPersistence(ControlContext vc, Hashtable properties, List preSelectedDataChoices) Called by theIntegratedDataViewerto initialize after this control has been unpersisted- Specified by:
initAfterUnPersistencein interfaceDisplayControl- Overrides:
initAfterUnPersistencein classDisplayControlImpl- Parameters:
vc- The context in which this control existsproperties- Properties that may hold thingspreSelectedDataChoices- set of preselected data choices
-
getCrossSectionViewManager
Get the view manager for the control window.- Returns:
- control window's view manager
-
getViewManagerForCapture
Get the view manager for capture- Overrides:
getViewManagerForCapturein classDisplayControlImpl- Parameters:
what- the name- Returns:
- the ViewManager to use
- Throws:
Exception- problem getting the view manager
-
init
Initialize the control using the data choice- Overrides:
initin classDisplayControlImpl- Parameters:
dataChoice- choice specifying the data- Returns:
- true if successful
- Throws:
RemoteException- Java RMI errorVisADException- VisAD error
-
addDisplaySettings
Add display settings for cross section controls- Overrides:
addDisplaySettingsin classDisplayControlImpl- Parameters:
dsd- the dialog to add to
-
getCursorReadoutInner
public List getCursorReadoutInner(EarthLocation el, Real animationValue, int animationStep, List<ReadoutInfo> samples) throws Exception Get the cursor readout info- Overrides:
getCursorReadoutInnerin classGridDisplayControl- Parameters:
el- earth locationanimationValue- animation valueanimationStep- animation stepsamples- the list of samples- Returns:
- the list of items
- Throws:
Exception- problem reading the data
-
getSelectorAttributeFlags
protected int getSelectorAttributeFlags()Return the attribute flags to apply to the cross section selector. This allows derived classes to set their own, e.g., use z position.- Returns:
- Flags to use
-
getDataProjection
Get the projection of the data.- Specified by:
getDataProjectionin interfaceDisplayControl- Overrides:
getDataProjectionin classGridDisplayControl- Returns:
- data projection or null
-
initDone
public void initDone()Called after all initialization is finished. This sets the end points of the csSelector to the correct position and adds this as a property change listener to the csSelector.- Overrides:
initDonein classDisplayControlImpl
-
handleDragDirect
Implementation of the DisplayableData.DragAdapter- Specified by:
handleDragDirectin interfaceDisplayableData.DragAdapter- Parameters:
ray- the view rayfirst- if this is the first timemouseModifiers- the mouse modifiers- Returns:
- true
-
handleAddPoint
public boolean handleAddPoint(float[] x) Handle adding a point- Specified by:
handleAddPointin interfaceDisplayableData.DragAdapter- Parameters:
x- the coords- Returns:
- true
-
doExport
Called by ISL. Write out some data defined by the what parameter to the given file.- Overrides:
doExportin classGridDisplayControl- Parameters:
what- What is to be written outfilename- To what file- Throws:
Exception- _more_
-
boxToEarth
Transform VisAD box coordinates to and EarthLocation- Parameters:
tuple- the tuple of VisAD coordinates- Returns:
- the corresponding EarthLocation
- Throws:
RemoteException- Java RMI ExceptionVisADException- VisAD Exception
-
constrainDragPoint
public boolean constrainDragPoint(float[] position) Constrain the drag point- Specified by:
constrainDragPointin interfaceDisplayableData.DragAdapter- Parameters:
position- the position- Returns:
- true
-
getMacroNames
Add any macro name/label pairs- Overrides:
getMacroNamesin classDisplayControlImpl- Parameters:
names- List of macro nameslabels- List of macro labels
-
addLabelMacros
Add any macro name/value pairs.- Overrides:
addLabelMacrosin classDisplayControlImpl- Parameters:
template- The template to usepatterns- The macro namesvalues- The macro values
-
propertyChange
Handle property change- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classDisplayControlImpl- Parameters:
evt- The event
-
doRemove
Remove the cross section view component from the gui to fix the funny lock up problem on linux- Specified by:
doRemovein interfaceDisplayControl- Overrides:
doRemovein classDisplayControlImpl- Throws:
RemoteException- On badnessVisADException- On badness
-
addPropertiesComponents
Add tabs to the properties dialog.- Overrides:
addPropertiesComponentsin classDisplayControlImpl- Parameters:
jtp- the JTabbedPane to add to
-
doApplyProperties
public boolean doApplyProperties()Apply the properties- Overrides:
doApplyPropertiesin classDisplayControlImpl- Returns:
- true if successful
-
doMakeContents
Called by doMakeWindow in DisplayControlImpl, which then calls its doMakeMainButtonPanel(), which makes more buttons.- Overrides:
doMakeContentsin classDisplayControlImpl- Returns:
- container of contents
-
getEditMenuItems
Get edit menu item- Overrides:
getEditMenuItemsin classDisplayControlImpl- Parameters:
items- list of items to add toforMenuBar- for the menu bar
-
getDisplayTabComponent
Create the component that goes into the 'Display' tab- Returns:
- Display tab component
-
getControlWidgets
Get the control widgets specific to this control- Overrides:
getControlWidgetsin classDisplayControlImpl- Parameters:
controlWidgets- list of widgets to add to.- Throws:
RemoteException- Java RMI errorVisADException- VisAD error
-
setData
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. Reset new parameter choice's data into the displayables. Do over everything necessary to load in a new kind of data.- Overrides:
setDatain classDisplayControlImpl- Parameters:
dataChoice- specification of the data- Returns:
- true if successful
- Throws:
RemoteException- Java RMI errorVisADException- VisAD error
-
updateViewParameters
This method is used to update anything that needs to be updated in the CrossSectionViewManager. Subclasses should override this if they need to do anything special.- Throws:
RemoteException- Java RMI errorVisADException- VisAD error
-
setStartCoord
Set the starting coordinate of the cross section selector. Used by XML persistence.- Parameters:
c- starting coordinate
-
setEndCoord
Set the ending coordinate of the cross section selector. Used by XML persistence.- Parameters:
c- ending coordinate
-
relocateDisplay
public void relocateDisplay(ucar.unidata.geoloc.LatLonRect originalBounds, ucar.unidata.geoloc.LatLonRect newBounds, boolean useDataProjection) When we relocate a bundle this gets called to relocate the display This method gets overwritten by the probe and cross section displays so they can move their selection points to a new location- Overrides:
relocateDisplayin classDisplayControlImpl- Parameters:
originalBounds- The original bounds of the datasourcenewBounds- The relocated bounds of the datasourceuseDataProjection- _more_
-
createCrossSectionSelector
Make a Selector line which shows and controls where cross section is- Throws:
RemoteException- Java RMI errorVisADException- VisAD error
-
createCrossSectionSelector
protected void createCrossSectionSelector(EarthLocation loc1, EarthLocation loc2) throws VisADException, RemoteException Create the cross section selector- Parameters:
loc1- the starting locationloc2- the ending location- Throws:
RemoteException- Java RMI ExceptionVisADException- VisAD Exception
-
createCrossSectionSelector1
protected void createCrossSectionSelector1(RealTuple start, RealTuple end) throws VisADException, RemoteException Create the cross section selector- Parameters:
start- the starting locationend- the ending location- Throws:
RemoteException- Java RMI ExceptionVisADException- VisAD Exception
-
convertToDisplay
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. Goes via intermediate lat,long,altitude position.- Parameters:
from- a Coord (x, y, z) in grid index values.- Returns:
- converted coordinates
- Throws:
RemoteException- Java RMI errorVisADException- VisAD error
-
applyZPosition
Apply the Z position. If the selector is in lat/lon/alt space, we need to transform from XYZ- Overrides:
applyZPositionin classDisplayControlImpl- Throws:
RemoteException- Java RMI ExceptionVisADException- VisADException
-
setPosition
protected void setPosition(EarthLocation startLoc, EarthLocation endLoc) throws VisADException, RemoteException Set the position of the selector- Parameters:
startLoc- Start locationendLoc- End location- Throws:
RemoteException- Java RMI errorVisADException- VisAD error
-
getSelectorAltitude
public double getSelectorAltitude()Get the selector altitude from the Z position- Returns:
- the altitude
-
crossSectionChanged
public void crossSectionChanged()Load or reload data for a cross section. -
projectionChanged
public void projectionChanged()Respond to a change in the display's projection. In this case we resample at the new location.- Specified by:
projectionChangedin interfaceDisplayControl- Overrides:
projectionChangedin classDisplayControlImpl
-
viewpointChanged
public void viewpointChanged()Noop for the ControlListener interface- Overrides:
viewpointChangedin classDisplayControlImpl
-
getViewMenuItems
Add the relevant view menu items into the list- Overrides:
getViewMenuItemsin classDisplayControlImpl- Parameters:
menus- List of menu itemsforMenuBar- Is this for the menu in the window's menu bar or for a popup menu in the legend
-
getCrossSectionViewLabel
Get the label for the CrossSectionView- Returns:
- return the name of the cross section view
-
shouldAddControlListener
protected boolean shouldAddControlListener()A hook to allow derived classes to tell us to add this as a control listener- Overrides:
shouldAddControlListenerin classGridDisplayControl- Returns:
- Add as control listener
-
transectChanged
public void transectChanged()Method called when a transect changes.- Specified by:
transectChangedin interfaceDisplayControl- Overrides:
transectChangedin classDisplayControlImpl
-
getLineCoords
Get the line coordinates as an array of EarthLocations- Returns:
- the locations
- Throws:
RemoteException- Java RMI ExceptionVisADException- Problem creating EarthLocations
-
loadDataFromLine
Create and loads a 2D FieldImpl from the existing getGridDataInstance() at the position indicated by the controlling Selector line end points;- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
loadData
Load the external display and the local display with this data of a vertical cross section.- Parameters:
fieldImpl- the data for the depiction- Throws:
RemoteException- Java RMI errorVisADException- VisAD error
-
load2DData
Load the 2D data into the appropriate display(s)- Parameters:
twoDData- cross section slice converted to 2D- Throws:
RemoteException- Java RMI errorVisADException- VisAD error
-
applySmoothing
Use the value of the smoothing type and weight to subset the data.- Overrides:
applySmoothingin classDisplayControlImpl- Throws:
RemoteException- Java RMI problemVisADException- VisAD problem
-
reScale
Call to reScale the display. Does the right thing depending on the value of autoScaleYAxis.- Throws:
RemoteException- Java RMI errorVisADException- VisAD error
-
setVerticalAxisRange
Set the range on the Y Axis of the cross section- Parameters:
range- Range of values in units of Y Axis. May be null
-
getVerticalAxisRange
Get the range on the vertical Axis of the cross section- Returns:
- range of values in units of Y Axis. May be null
-
setYAxisRange
Methods to do the things that need to be done when the data range changes.- Parameters:
display- the display to modifyrange- Range of values in units of Y Axis. May be null- Throws:
RemoteException- Java RMI errorVisADException- VisAD error
-
make2DData
Make a FieldImpl suitable for the plain 2D vert cross section display; of form (time -> ((x) -> parm)); new x axis positions are in distance along cross section from one end. override from superclass since we are dealing only with 2D data.- Parameters:
xsectSequence- the time sequence of cross section data- Returns:
- xsectSequence transformed to 2D
- Throws:
RemoteException- Java RMI errorVisADException- VisAD error
-
getCrossSectionVerticalRange
_more_- Parameters:
domainSet- _more_- Returns:
- _more_
- Throws:
VisADException- _more_
-
getDefaultVerticalRange
_more_- Returns:
- _more_
-
getDataVerticalRange
_more_- Returns:
- _more_
-
make2DDomainSet
Make the domain for the 2D grid- Parameters:
domainSet- the domain to be 2D'ized- Returns:
- the 2D ized grid
- Throws:
RemoteException- Java RMI errorVisADException- VisAD error
-
getZPositionSliderLabel
Get the label for the Z position slider.- Overrides:
getZPositionSliderLabelin classDisplayControlImpl- Returns:
- label
-
setAnimationInfo
Set the AnimationInfo property.- Overrides:
setAnimationInfoin classDisplayControlImpl- Parameters:
value- The new value for AnimationInfo
-
getAnimationInfo
Get the AnimationInfo property.- Overrides:
getAnimationInfoin classDisplayControlImpl- Returns:
- The AnimationInfo
-
createXFromLatLon
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. NB: In this implementation, the distance from the origin is calculated as the sum of the distances between each point in between.- Parameters:
latlon- array of lat lon values in degrees (order doesn't matter)numNeeded- number of distances to calculatelonIndex- which of the indices in latlon is longitude- Returns:
- array of distances each lat/lon point is from the origin.
-
applyPreferences
public void applyPreferences()Apply preferences to this control. Subclasses should override if needed. This is a noop in this class.- Specified by:
applyPreferencesin interfaceDisplayControl- Overrides:
applyPreferencesin classDisplayControlImpl
-
addTopographyMap
Wrapper aroundGridDisplayControl.addTopographyMap(int)to allow subclasses to set their own index.- Throws:
RemoteException- Java RMI errorVisADException- VisAD error
-
updateLocationLabel
protected void updateLocationLabel()Called when a change in position occurs -
setAllowAutoScale
public void setAllowAutoScale(boolean value) Set the AutoScale property.- Parameters:
value- The new value for AutoScale
-
getAllowAutoScale
public boolean getAllowAutoScale()Get the AutoScale property.- Returns:
- The AutoScale
-
setAutoScaleYAxis
public void setAutoScaleYAxis(boolean value) Set the AutoScale property.- Parameters:
value- The new value for AutoScale
-
getAutoScaleYAxis
public boolean getAutoScaleYAxis()Get the AutoScale property.- Returns:
- The AutoScale
-
getLineRange
get line range -- should be overridden by sub classes that actually set the value- Returns:
- _more_
-
setAutoUpdate
public void setAutoUpdate(boolean value) Set the AutoUpdate property.- Parameters:
value- The new value for AutoUpdate
-
getAutoUpdate
public boolean getAutoUpdate()Get the AutoUpdate property.- Returns:
- The AutoUpdate
-
setCrossSectionView
Set the CrossSectionView property.- Parameters:
value- The new value for CrossSectionView
-
getCrossSectionView
Get the CrossSectionView property.- Returns:
- The CrossSectionView
-
setForeground
Set the foreground color- Parameters:
color- new color deprecated Keep this around for old bundles
-
setBackground
Set the background color- Parameters:
color- new color deprecated Keep this around for old bundles
-
setDisplayMatrix
public void setDisplayMatrix(double[] value) Set the DisplayMatrix property.- Parameters:
value- The new value for DisplayMatrix deprecated Keep this around for old bundles
-
canExportData
public boolean canExportData()Can this display control write out data.- Overrides:
canExportDatain classDisplayControlImpl- Returns:
- true if it can
-
getDisplayedData
Get the DisplayedData- Overrides:
getDisplayedDatain classDisplayControlImpl- Returns:
- the data or null
- Throws:
RemoteException- problem reading remote dataVisADException- problem gettting data
-
getInitialZPosition
protected double getInitialZPosition()Get the initial Z position- Overrides:
getInitialZPositionin classDisplayControlImpl- Returns:
- the position in Z space
-
setStartPoint
Set the probe position property; used by XML persistence.- Parameters:
p- probe position
-
getStartPoint
Set the probe position property; used by XML persistence.- Returns:
- probe position - may be
null. - Throws:
RemoteException- Java RMI errorVisADException- VisAD Error
-
setEndPoint
Set the probe position property; used by XML persistence.- Parameters:
p- probe position
-
getEndPoint
Set the probe position property; used by XML persistence.- Returns:
- probe position - may be
null. - Throws:
RemoteException- Java RMI errorVisADException- VisAD Error
-
setLineVisible
public void setLineVisible(boolean value) Set the LineVisible property.- Parameters:
value- The new value for LineVisible
-
getLineVisible
public boolean getLineVisible()Get the LineVisible property.- Returns:
- The LineVisible
-
setInitAlt
public void setInitAlt(double value) _more_- Parameters:
value- _more_
-
setInitLat2
public void setInitLat2(double value) Set the Lat2 property.- Parameters:
value- The new value for Lat2
-
setInitLon2
public void setInitLon2(double value) Set the Lon2 property.- Parameters:
value- The new value for Lon2
-
setInitLat1
public void setInitLat1(double value) Set the InitLat1 property.- Parameters:
value- The new value for InitLat1
-
setInitLon1
public void setInitLon1(double value) Set the Lon1 property.- Parameters:
value- The new value for Lon1
-
getChangeParameterLabel
Return the appropriate label text for the menu.- Overrides:
getChangeParameterLabelin classDisplayControlImpl- Returns:
- the label text
-
addNewData
Handle the newly added data from view or edit menu- Overrides:
addNewDatain classDisplayControlImpl- Parameters:
newChoices- new list of choices- Throws:
RemoteException- Java RMI errorVisADException- VisAD Error
-
doMakeChangeParameterMenuItem
Utility to make the menu item for changing the data choice- Overrides:
doMakeChangeParameterMenuItemin classDisplayControlImpl- Returns:
- The menu item
-
processNewDataV
Override base class method which is called when the user has selected new data choices.- Parameters:
newChoices- new list of choices- Throws:
RemoteException- Java RMI errorVisADException- VisAD Error
-
processNewDataV
public void processNewDataV(DataChoice dc, CrossSectionControl csc) throws VisADException, RemoteException Override base class method which is called when the user has selected new data choices.- Parameters:
dc- new datachoice- Throws:
RemoteException- Java RMI errorVisADException- VisAD Error
-
processNewData
protected void processNewData(DataChoice dc, CrossSectionControl csc) throws VisADException, RemoteException Override base class method which is called when the user has selected new data choices.- Parameters:
dc- new choice- Throws:
RemoteException- Java RMI errorVisADException- VisAD Error
-
processNewData
Override base class method which is called when the user has selected new data choices.- Parameters:
newChoices- new choice- Throws:
RemoteException- Java RMI errorVisADException- VisAD Error
-
removeDisplayables
Remove the naming displays from control- Throws:
RemoteExceptionVisADException
-
removeControl
Remove the datachoice from control- Throws:
RemoteExceptionVisADException
-
getControlList
get the controlList property.- Returns:
- controlList
-
setControlList
Set the controlList property.- Parameters:
cList- The new value for controlList
-
reSetTimeHeightAltitudeUnit
This gets called by changing the altitude unit- Parameters:
aUnit- _more_- Throws:
VisADException
-
getPressureLabels
get y (altitude) axis pressure values hashtable- Parameters:
labels- pressure labels- Throws:
VisADException- VisAD error
-
getAltUnit
get the altUnit property.- Returns:
- unit
-
setAltUnit
set the altUnit property.
-