ucar.unidata.idv.control
Class PlanViewControl

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.PlanViewControl
All Implemented Interfaces:
ActionListener, ItemListener, PropertyChangeListener, EventListener, HyperlinkListener, Sharable, DataChangeListener, DisplayControl, Prototypable, ControlListener, DisplayListener
Direct Known Subclasses:
ColorPlanViewControl, ContourPlanViewControl, FlowPlanViewControl, ImagePlanViewControl, TopographyControl, ValuePlanViewControl

public abstract class PlanViewControl
extends GridDisplayControl

Class to handle all kinds of PlanViews. A plan view is a horizontal slice at a level.

Version:
$Revision: 1.185 $
Author:
Unidata Development Team

Nested Class Summary
 class PlanViewControl.VerticalRangeWidget
          A widget for the control window for setting the vertical range properties
 
Nested classes/interfaces inherited from class ucar.unidata.idv.control.DisplayControlImpl
DisplayControlImpl.SideLegendLabel
 
Field Summary
protected  Object currentLevel
          current level
protected  Object[] currentLevels
          list of current levels
protected  FieldImpl currentSlice
          current slice
protected  DataChoice datachoice
          data choice for the data
protected  boolean haveEnsemble
          flag for ensembles
protected  JLabel levelReadout
          level readout label
static String MACRO_LEVEL
          Macro for the short parameter name for the label
static String SHARE_LEVEL
          property for sharing levels
 
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, 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_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_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
PlanViewControl()
          Cstr; does nothing.
 
Method Summary
protected  void addDisplaySettings(DisplaySettingsDialog dsd)
          Add DisplaySettings appropriate for this display
protected  void addLabelMacros(String template, List patterns, List values)
          Add any macro name/value pairs.
protected  void addParameterTopographyMap()
          Add a topography map for the parameter
protected  void addTopographyMap()
          Wrapper around GridDisplayControl.addTopographyMap(int) to allow subclasses to set their own index.
 void addToRangeMenu(RangeWidget rw, List items)
          Add an entry into the range menu
protected  void applySkipFactor()
          Use the value of the skip factor to subset the data.
protected  void applySmoothing()
          Use the value of the smoothing type and weight to subset the data.
 boolean canExportData()
          Can this display control write out data.
protected  boolean checkFlag(int f)
          Test if the given flag is set in the attrbiuteFlags
protected abstract  DisplayableData createPlanDisplay()
          Method for creating the DisplayableData object that is the main depiction for the data controlled by this PlanViewControl; implemented by each subclass.
protected  void displayUnitChanged(Unit oldUnit, Unit newUnit)
          A hook that is called when the display unit is changed.
 Container doMakeContents()
          Make some Plan view controls for the UI.
 void doRemove()
          Remove this control
protected  String formatLevel(Object level)
          Format the level for labelling.
protected  int getColorRangeIndex()
          Returns the index to use in the GridDataInstance array of ranges for color ranges.
 void getControlWidgets(List<ControlWidget> controlWidgets)
          Add in any special control widgets to the current list of widgets.
protected  FieldImpl getCurrentSlice()
          Get the current slice
protected  Data getCursorReadoutData()
          Get the cursor readout data
protected  List getCursorReadoutInner(EarthLocation el, Real animationValue, int animationStep, List<ReadoutInfo> samples)
          Get the cursor data
protected  String getDataProjectionLabel()
          Get the Data projection label
protected  Data getDisplayedData()
          Get the DisplayedData
protected  void getEditMenuItems(List items, boolean forMenuBar)
          Overwrite the base class method to add a Levels menu to the edit menu
 GridDisplayable getGridDisplayable()
          Return the Displayable of the Plan View as a GridDisplayable.
 boolean getIgnoreVerticalDimension()
          get the Ignore Vertical Dimension property
 void getLegendLabels(List labels, int legendType)
          Append any label information to the list of labels.
 Object getLevel()
          Return active level value.
protected  Range getLevelColorRange()
          Get the range for the current slice.
 String getLevelsLabel()
          Get the label for the levels box.
protected  void getMacroNames(List names, List labels)
          Add any macro name/label pairs
 boolean getMultipleIsTopography()
          Get the multiple is topography property.
 boolean getParameterIsTopography()
          Get the parameter is topography property.
 DisplayableData getPlanDisplay()
          Return the displayable of the Plan View as a DisplayableData.
 int getPolygonMode()
          Return the type of depiction for this display
protected  JComboBox getPolyModeComboBox()
          Create a jcombobox for setting the polygon mode.
protected  FieldImpl getSliceForDisplay(FieldImpl slice)
          Get the slice for the display
 Range getVerticalRange()
          Get the vertical range
 boolean haveLevels()
          Determine whether the data in this PlanViewControl has levels or not.
protected  boolean haveMultipleFields()
          Return whether the Data held by this display control contains multiple fields (e.g., for the isosurface colored by another parameter
 boolean init(DataChoice dataChoice)
          Called to make this kind of Display Control; also calls code to made the Displayable.
 void initDone()
          What to do when you are done.
 void loadDataAtLevel(Object level)
          Load data at the level specified.
 void projectionChanged()
          Method to call if projection changes.
 void propertyChange(PropertyChangeEvent evt)
          Handle property change
 void receiveShareData(Sharable from, Object dataId, Object[] data)
          Method called by other classes that share the selector.
protected  void setCurrentSlice(FieldImpl slice)
          Set the current slice
protected  boolean setData(DataChoice dataChoice)
          Called to initialize this control from the given dataChoice; sets levels controls to match data; make data slice at first level; set display's color table and display units.
 void setDataSelectionLevel(Object level)
          Set the level in the data selection
 void setIgnoreVerticalDimension(boolean v)
          Set the ignore Vertical Dimension property
 void setLevel(Object pl)
          Set the active level.
protected  void setLevelFromUser(Object pl)
          Set the level from the user
 void setLevelReadoutLabel(String text)
          Set the text for the level readout in the control window.
 void setLevels(Object[] levels)
          If there are, or are not, some levels in the data, set the controls accordingly.
 void setMultipleIsTopography(boolean v)
          Set the other is topography property.
 void setParameterIsTopography(boolean v)
          Set the parameter is topography property.
 void setPointSize(float value)
          Set the point size
 void setPolygonMode(int v)
          Set the type of depiction (solid, line, mesh) for this display
 void setSettingsLevel(Object level)
          Set the active level.
 void setVerticalRange(Range vertRange)
          Set the range on the parameter topography ScalarMap
protected  boolean shouldShowLevelWidget()
          This allows for derived classes to turn this off.
protected  boolean shouldShowZSelector()
          This allows for derived classes to turn this off.
protected  boolean shouldUseZPosition()
          Determine if the display and gui should have a z position.
 
Methods inherited from class ucar.unidata.idv.control.GridDisplayControl
actionPerformed, addTopographyMap, convertColorRange, doMakeContourLevelControl, doMakeDataInstance, doMakeLevelControl, doMakeLevelControl, exportDisplayedData, getColorParamName, getColorRangeFromData, getColorUnit, getContourInfo, getDataProjection, getDataRangeInColorUnits, getDefaultContourInfo, getDisplayUnit, getGridDataInstance, getInitialColorTable, getInitialRange, getRawDataUnit, initializeDefaultContourInfo, isDisplayUnitAlsoColorUnit, setLevel
 
Methods inherited from class ucar.unidata.idv.control.DisplayControlImpl
activateDisplays, addAttributedDisplayable, addAttributedDisplayable, addAttributedDisplayable, addAttributeFlags, addCheckBoxSettings, addDataChoice, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayMaster, addNewData, addNoteText, addPropertiesComponents, addPropertyChangeListener, addRemovable, addSharable, addTimeModeWidget, addToControlContext, addToRangeMenu, addToRangeMenu, addViewManager, appendDataChoices, applyAttributesToDisplayables, applyColor, applyColorScaleInfo, applyColorTable, applyColorUnit, applyContourInfo, applyDisplaySetting, applyDisplayUnit, applyLineWidth, applyPreferences, applyProperties, applyProperties, applyPropertyValues, applyRange, applySelectRange, applyTextureQuality, applyTimeRange, applyZPosition, boundsClose, canBeDocked, canSaveDataInCache, captureWindow, centerOnDisplay, changeColorUnit, changeDisplayUnit, checkIfDataOk, checkImageSize, clearDataInstance, clearPrototype, clearViewManagers, close, colorUnitChanged, controlChanged, convertColorRange, convertRange, createDisplayListDisplayable, createIdvWindow, dataChanged, deactivateDisplays, debug, displayableToFront, displayChanged, displayControlFailed, doApplyProperties, doExport, doInitialUpdateLegendAndList, doMakeBottomLegendComponent, doMakeChangeColorMenu, doMakeChangeColorMenu, doMakeChangeParameterMenuItem, doMakeColorControl, doMakeColorControl, doMakeColorScales, doMakeMenuBar, doMakeMenuBarMenus, doMakePointSizeWidget, doMakeRemoveControl, doMakeSideLegendComponent, doMakeSkipFactorSlider, doMakeTextureSlider, doMakeVisibilityControl, doMakeWidgetComponent, doMakeWindow, doMakeZPositionSlider, findDisplayInfo, findDisplays, findDisplays, firePropertyChangeEvent, firstFrameDone, formatForCursorReadout, getActive, getAnimation, getAnimation, getAnimation, getAnimation, getAnimationInfo, getAnimationWidget, getAttributeFlags, getCachedData, getCanDoRemoveAll, getCategories, getChangeParameterLabel, getCollapseLegend, getColor, getColorDimness, getColorScaleInfo, getColorTable, getColorTableForDisplayable, getColorTableToApply, getColorTableWidget, getColorUnitName, getColorWidgetLabel, getComponentHolder, getContents, getControlChangeSleepTime, getControlContext, getControlMenus, getCursorReadout, 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, 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, getInitialZPosition, getInternalAnimation, getInternalAnimation, getIsRaster, getIsTimeDriver, getLabel, getLastFileMenuItems, getLegendButtons, getLegendComponent, getLegendLabel, getLegendLabelTemplate, getLegendToolTip, getLineWidth, getLineWidthWidget, getLineWidthWidgetLabel, getLockVisibilityToggle, getLongParamName, getMainPanel, getMainPanelSize, getMakeWindow, getMapDisplay, getMapViewManager, getMapViewProjection, 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, 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, getViewMenuItems, getVisbilityAnimationPause, getWasUnPersisted, getWindow, getWindowSize, getWindowVisible, getWindowX, getWindowY, getZPosition, getZPositionSliderLabel, guiExported, guiImported, handleDisplayChanged, handleWindowClosing, hasMapProjection, hasTimeMacro, haveDataTimes, haveParameterDefaults, hide, hyperlinkUpdate, inGlobeDisplay, init, init, init, initAfterUnPersistence, 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, reallySetAttributeFlags, redoGuiLayout, reloadDataSource, reloadDataSourceInThread, removeDataChoice, removeDisplayable, removeDisplayables, removeDisplayables, removeOnWindowClose, removePropertyChangeListener, resetData, 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, 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, shouldAddControlListener, shouldAddDisplayListener, 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, transectChanged, updateAnimation, updateDataInstance, updateDataSelection, updateDisplayList, updateGridDataInstance, updateLegendAndList, updateLegendLabel, updateLockButton, useSmoothingFactor, useZPosition, viewManagerChanged, viewManagerDestroyed, viewpointChanged, 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

MACRO_LEVEL

public static final String MACRO_LEVEL
Macro for the short parameter name for the label

See Also:
Constant Field Values

SHARE_LEVEL

public static final String SHARE_LEVEL
property for sharing levels

See Also:
Constant Field Values

currentLevels

protected Object[] currentLevels
list of current levels


levelReadout

protected JLabel levelReadout
level readout label


currentSlice

protected FieldImpl currentSlice
current slice


currentLevel

protected Object currentLevel
current level


datachoice

protected DataChoice datachoice
data choice for the data


haveEnsemble

protected boolean haveEnsemble
flag for ensembles

Constructor Detail

PlanViewControl

public PlanViewControl()
Cstr; does nothing. See init() for creation actions.

Method Detail

getCursorReadoutData

protected Data getCursorReadoutData()
                             throws Exception
Get the cursor readout data

Overrides:
getCursorReadoutData in class GridDisplayControl
Returns:
the data
Throws:
Exception - problem getting data

setCurrentSlice

protected void setCurrentSlice(FieldImpl slice)
                        throws Exception
Set the current slice

Parameters:
slice - the slice
Throws:
Exception - problem setting the slice

getCurrentSlice

protected FieldImpl getCurrentSlice()
                             throws Exception
Get the current slice

Returns:
the current data for the plan view
Throws:
Exception - problem getting the data

getCursorReadoutInner

protected List getCursorReadoutInner(EarthLocation el,
                                     Real animationValue,
                                     int animationStep,
                                     List<ReadoutInfo> samples)
                              throws Exception
Get the cursor data

Overrides:
getCursorReadoutInner in class GridDisplayControl
Parameters:
el - earth location
animationValue - the animation value
animationStep - the animation step
samples - the list of samples
Returns:
the list of readout data
Throws:
Exception - problem getting the data

getDataProjectionLabel

protected String getDataProjectionLabel()
Get the Data projection label

Overrides:
getDataProjectionLabel in class DisplayControlImpl
Returns:
the label

addDisplaySettings

protected void addDisplaySettings(DisplaySettingsDialog dsd)
Add DisplaySettings appropriate for this display

Overrides:
addDisplaySettings in class DisplayControlImpl
Parameters:
dsd - the dialog to add to

addToRangeMenu

public void addToRangeMenu(RangeWidget rw,
                           List items)
Add an entry into the range menu

Overrides:
addToRangeMenu in class DisplayControlImpl
Parameters:
rw - The widget that manages the range dialog
items - List of menu items

getLevelColorRange

protected Range getLevelColorRange()
Get the range for the current slice.

Returns:
range or null

init

public boolean init(DataChoice dataChoice)
             throws VisADException,
                    RemoteException
Called to make this kind of Display Control; also calls code to made the Displayable. 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:
RemoteException - Java RMI error
VisADException - VisAD Error

initDone

public void initDone()
What to do when you are done.

Overrides:
initDone in class DisplayControlImpl

getPolyModeComboBox

protected JComboBox getPolyModeComboBox()
Create a jcombobox for setting the polygon mode.

Returns:
polygon mode combo box

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Handle property change

Specified by:
propertyChange in interface PropertyChangeListener
Overrides:
propertyChange in class DisplayControlImpl
Parameters:
evt - The event

doRemove

public void doRemove()
              throws RemoteException,
                     VisADException
Remove this control

Specified by:
doRemove in interface DisplayControl
Overrides:
doRemove in class DisplayControlImpl
Throws:
RemoteException - Java RMI problem
VisADException - VisAD data problem

haveMultipleFields

protected boolean haveMultipleFields()
Return whether the Data held by this display control contains multiple fields (e.g., for the isosurface colored by another parameter

Overrides:
haveMultipleFields in class GridDisplayControl
Returns:
true if there are multiple fields

getColorRangeIndex

protected int getColorRangeIndex()
Returns the index to use in the GridDataInstance array of ranges for color ranges. If we are being draped over topography then return 0. Else return the default value from the parent class.

Overrides:
getColorRangeIndex in class GridDisplayControl
Returns:
The index to be used for the color range.

setData

protected boolean setData(DataChoice dataChoice)
                   throws VisADException,
                          RemoteException
Called to initialize this control from the given dataChoice; sets levels controls to match data; make data slice at first level; set display's color table and display units.

Overrides:
setData in class DisplayControlImpl
Parameters:
dataChoice - choice that describes the data to be loaded.
Returns:
true if successful
Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

addTopographyMap

protected void addTopographyMap()
                         throws VisADException,
                                RemoteException
Wrapper around GridDisplayControl.addTopographyMap(int) to allow subclasses to set their own index.

Throws:
RemoteException - Java RMI error
VisADException - VisAD error

addParameterTopographyMap

protected void addParameterTopographyMap()
                                  throws VisADException,
                                         RemoteException
Add a topography map for the parameter

Throws:
RemoteException - Java RMI problem
VisADException - Unable to set the ScalarMap

setVerticalRange

public void setVerticalRange(Range vertRange)
Set the range on the parameter topography ScalarMap

Parameters:
vertRange - the vertical range

getVerticalRange

public Range getVerticalRange()
Get the vertical range

Returns:
the vertical range

haveLevels

public boolean haveLevels()
Determine whether the data in this PlanViewControl has levels or not.

Returns:
true if multi level data

setLevels

public void setLevels(Object[] levels)
If there are, or are not, some levels in the data, set the controls accordingly. If no levels exist, you do not enable the menu to set levels for example.

Parameters:
levels - array of levels

getEditMenuItems

protected void getEditMenuItems(List items,
                                boolean forMenuBar)
Overwrite the base class method to add a Levels menu to the edit menu

Overrides:
getEditMenuItems in class DisplayControlImpl
Parameters:
items - Menu items to add to
forMenuBar - Is this edit menu for the main menu bar

getPlanDisplay

public DisplayableData getPlanDisplay()
Return the displayable of the Plan View as a DisplayableData.

Returns:
DisplayableData that is being used for the main depiction of this PlanDisplay

getGridDisplayable

public GridDisplayable getGridDisplayable()
Return the Displayable of the Plan View as a GridDisplayable.

Returns:
Displayable cast to a GridDisplay

setPointSize

public void setPointSize(float value)
Set the point size

Overrides:
setPointSize in class DisplayControlImpl
Parameters:
value - the size

createPlanDisplay

protected abstract DisplayableData createPlanDisplay()
                                              throws VisADException,
                                                     RemoteException
Method for creating the DisplayableData object that is the main depiction for the data controlled by this PlanViewControl; implemented by each subclass.

Returns:
DisplayableData for the data depiction.
Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

projectionChanged

public void projectionChanged()
Method to call if projection changes. Handle topography changes.

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

getLevel

public Object getLevel()
Return active level value.

Returns:
active level

setLevel

public void setLevel(Object pl)
Set the active level.

Overrides:
setLevel in class GridDisplayControl
Parameters:
pl - present level.

setSettingsLevel

public void setSettingsLevel(Object level)
Set the active level.

Parameters:
level - present level.

setDataSelectionLevel

public void setDataSelectionLevel(Object level)
Set the level in the data selection

Parameters:
level - The level

setLevelFromUser

protected void setLevelFromUser(Object pl)
                         throws VisADException,
                                RemoteException
Set the level from the user

Overrides:
setLevelFromUser in class GridDisplayControl
Parameters:
pl - level
Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

loadDataAtLevel

public void loadDataAtLevel(Object level)
                     throws VisADException,
                            RemoteException
Load data at the level specified. Uses the working grid.

Parameters:
level - level to load at
Throws:
VisADException - illegal level or other VisAD error
RemoteException - RMI error

getSliceForDisplay

protected FieldImpl getSliceForDisplay(FieldImpl slice)
                                throws VisADException
Get the slice for the display

Parameters:
slice - slice to use
Returns:
slice with skip value applied
Throws:
VisADException - problem subsetting the slice

applySmoothing

protected void applySmoothing()
                       throws VisADException,
                              RemoteException
Use the value of the smoothing type and weight to subset the data.

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

checkFlag

protected boolean checkFlag(int f)
Test if the given flag is set in the attrbiuteFlags

Overrides:
checkFlag in class DisplayControlImpl
Parameters:
f - The flag to check
Returns:
Is the given flag set

getMacroNames

protected void getMacroNames(List names,
                             List labels)
Add any macro name/label pairs

Overrides:
getMacroNames in class DisplayControlImpl
Parameters:
names - List of macro names
labels - List of macro labels

addLabelMacros

protected void addLabelMacros(String template,
                              List patterns,
                              List values)
Add any macro name/value pairs.

Overrides:
addLabelMacros in class DisplayControlImpl
Parameters:
template - template
patterns - The macro names
values - The macro values

getLegendLabels

public void getLegendLabels(List labels,
                            int legendType)
Append any label information to the list of labels.

Overrides:
getLegendLabels in class DisplayControlImpl
Parameters:
labels - in/out list of labels
legendType - The type of legend, BOTTOM_LEGEND or SIDE_LEGEND

formatLevel

protected String formatLevel(Object level)
Format the level for labelling. If subclasses want to have different formatting, they can override this method. Check for 'currentLevel' to have a non-numeric: SFC, MSL, or TRO and if so, return just that String...

Parameters:
level - level to format
Returns:
formatted string for level

receiveShareData

public void receiveShareData(Sharable from,
                             Object dataId,
                             Object[] data)
Method called by other classes that share the selector.

Specified by:
receiveShareData in interface Sharable
Overrides:
receiveShareData in class DisplayControlImpl
Parameters:
from - other class.
dataId - type of sharing
data - Array of data being shared. In this case, the first (and only?) object in the array is the level

doMakeContents

public Container doMakeContents()
Make some Plan view controls for the UI.

Overrides:
doMakeContents in class DisplayControlImpl
Returns:
create the contents for the UI.

getControlWidgets

public void getControlWidgets(List<ControlWidget> controlWidgets)
                       throws VisADException,
                              RemoteException
Add in any special control widgets to the current list of widgets.

Overrides:
getControlWidgets in class DisplayControlImpl
Parameters:
controlWidgets - list of control widgets
Throws:
VisADException - VisAD error
RemoteException - RMI error

displayUnitChanged

protected void displayUnitChanged(Unit oldUnit,
                                  Unit newUnit)
A hook that is called when the display unit is changed. Allows derived classes to act accordingly.

Overrides:
displayUnitChanged in class DisplayControlImpl
Parameters:
oldUnit - The old color unit
newUnit - The new color unit

shouldShowLevelWidget

protected boolean shouldShowLevelWidget()
This allows for derived classes to turn this off. Subclasses should override if not true

Returns:
true

shouldShowZSelector

protected boolean shouldShowZSelector()
This allows for derived classes to turn this off. Subclasses should override if not true

Returns:
true

shouldUseZPosition

protected boolean shouldUseZPosition()
Determine if the display and gui should have a z position. This is only used when we are also not showing the level widget

Returns:
Should use z position

setLevelReadoutLabel

public void setLevelReadoutLabel(String text)
Set the text for the level readout in the control window.

Parameters:
text - text for the level readout

setMultipleIsTopography

public void setMultipleIsTopography(boolean v)
Set the other is topography property.

Parameters:
v - true if second parameter is topography

getMultipleIsTopography

public boolean getMultipleIsTopography()
Get the multiple is topography property.

Returns:
true if multiple grid is topography

setParameterIsTopography

public void setParameterIsTopography(boolean v)
Set the parameter is topography property.

Parameters:
v - true if second parameter is topography

getParameterIsTopography

public boolean getParameterIsTopography()
Get the parameter is topography property.

Returns:
true if multiple grid is topography

setIgnoreVerticalDimension

public void setIgnoreVerticalDimension(boolean v)
Set the ignore Vertical Dimension property

Parameters:
v - true if vertical dimension should be ignored

getIgnoreVerticalDimension

public boolean getIgnoreVerticalDimension()
get the Ignore Vertical Dimension property

Returns:
true if vertical dimension should be ignored

getLevelsLabel

public String getLevelsLabel()
Get the label for the levels box.

Returns:
the label

canExportData

public boolean canExportData()
Can this display control write out data.

Overrides:
canExportData in class DisplayControlImpl
Returns:
true if it can

getDisplayedData

protected Data getDisplayedData()
                         throws VisADException,
                                RemoteException
Get the DisplayedData

Overrides:
getDisplayedData in class DisplayControlImpl
Returns:
the data or null
Throws:
RemoteException - problem reading remote data
VisADException - problem gettting data

applySkipFactor

protected void applySkipFactor()
Use the value of the skip factor to subset the data.

Overrides:
applySkipFactor in class DisplayControlImpl

setPolygonMode

public void setPolygonMode(int v)
Set the type of depiction (solid, line, mesh) for this display

Parameters:
v - polygon mode. Used by XML persistence.

getPolygonMode

public int getPolygonMode()
Return the type of depiction for this display

Returns:
true if shading is smoothed.