ucar.unidata.idv.control
Class LineProbeControl

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.LineProbeControl
All Implemented Interfaces:
ActionListener, ItemListener, PropertyChangeListener, EventListener, HyperlinkListener, Sharable, DataChangeListener, DisplayControl, Prototypable, ControlListener, DisplayListener
Direct Known Subclasses:
ProfileControl, TimeHeightControl, TimeSeriesControl, VerticalProfileControl

public abstract class LineProbeControl
extends GridDisplayControl

An abstract base class that manages a vertical probe To create a probe call doMakeProbe To be notified of changes override: void probePositionChanged (double x, double y);

Version:
$Revision: 1.48 $Date: 2007/04/11 18:56:03 $
Author:
IDV development team

Nested Class Summary
 
Nested classes/interfaces inherited from class ucar.unidata.idv.control.DisplayControlImpl
DisplayControlImpl.SideLegendLabel
 
Field Summary
protected  String positionText
          Keep around for the label macros
static String SHARE_PROFILE
          profile sharing property
 
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
LineProbeControl()
          Default Constructor.
 
Method Summary
protected  void addLabelMacros(String template, List patterns, List values)
          Add any macro name/value pairs.
 void decreaseProbeSize()
          Decrease the probe size
 void doMakeProbe()
          Default doMakeProbe method.
 void doMakeProbe(Color c)
          Make the probe with the specific Color.
 void doMakeProbe(Color probeColor, ViewDescriptor view)
          Make the probe with the specific Color and ViewDescriptor.
 void doMakeProbe(ViewDescriptor view)
          Make the probe with the specific ViewDescriptor.
 JMenu doMakeProbeMenu(JMenu probeMenu)
          Make a menu for controlling the probe size, shape and position.
protected  void doMoveProbe()
          Method called when probe is moved.
protected  void getEditMenuItems(List items, boolean forMenuBar)
          Get edit menu items
 RealTuple getGridCenterPosition()
          Get initial XY position from grid data.
 RealTuple getInitialLinePosition()
          Get initial XY position from the screen
 RealTuple getInitialPosition()
          Get the initial position of the probe set during unpersistence.
 void getLegendLabels(List labels, int legendType)
          Append any label information to the list of labels.
protected  void getMacroNames(List names, List labels)
          Add any macro name/label pairs
 String getMarker()
          Get the Marker property.
 float getPointSize()
          Get the PointSize property.
 RealTuple getPosition()
          Get the position of the probe.
 void increaseProbeSize()
          Increase the probe size
protected  void probePositionChanged(RealTuple position)
          This gets called when either the user moves the probe point or when we get a sharable event to move the probe point.
 void projectionChanged()
          Respond to a change in the display's projection.
 void propertyChange(PropertyChangeEvent evt)
          Handle changes
 void receiveShareData(Sharable from, Object dataId, Object[] data)
          Method called when sharing is enabled.
 void resetProbePosition()
          Reset the position of the probe to the center.
 void setMarker(String value)
          Set the Marker property.
 void setPointSize(float value)
          Set the PointSize property.
 void setPosition(RealTuple p)
          Set the initial position of the probe.
 void setProbePosition(double x, double y)
          Set the probe position from display x and y positions.
 void setProbePosition(RealTuple xy)
          Set the probe position.
protected  void updateLegendLabel()
          This method is called to update the legend labels when some state has changed in this control that is reflected in the labels.
 
Methods inherited from class ucar.unidata.idv.control.GridDisplayControl
actionPerformed, addTopographyMap, convertColorRange, doMakeContourLevelControl, doMakeDataInstance, doMakeLevelControl, doMakeLevelControl, getColorParamName, getColorRangeFromData, getColorRangeIndex, getColorUnit, getContourInfo, getCursorReadoutData, getCursorReadoutInner, getDataProjection, 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, addPropertiesComponents, addPropertyChangeListener, addSharable, addToRangeMenu, addToRangeMenu, addToRangeMenu, addViewManager, appendDataChoices, applyAttributesToDisplayables, applyColor, applyColorScaleInfo, applyColorTable, applyColorUnit, applyContourInfo, applyDisplaySetting, applyDisplayUnit, applyLineWidth, applyPreferences, applyProperties, applyProperties, applyPropertyValues, applyRange, applySelectRange, applySkipFactor, applyTimeRange, applyZPosition, boundsClose, canBeDocked, canExportData, canSaveDataInCache, captureWindow, changeColorUnit, changeDisplayUnit, checkFlag, checkIfDataOk, checkImageSize, clearDataInstance, clearPrototype, clearViewManagers, close, colorUnitChanged, controlChanged, convertColorRange, convertRange, createDisplayListDisplayable, createIdvWindow, dataChanged, deactivateDisplays, debug, displayableToFront, displayChanged, displayControlFailed, displayUnitChanged, doApplyProperties, doMakeBottomLegendComponent, doMakeChangeColorMenu, doMakeChangeColorMenu, doMakeChangeParameterMenuItem, doMakeColorControl, doMakeColorControl, doMakeColorScales, doMakeContents, doMakeMenuBar, doMakeMenuBarMenus, doMakeRemoveControl, doMakeSideLegendComponent, doMakeSkipFactorSlider, doMakeVisibilityControl, doMakeWidgetComponent, doMakeWindow, doMakeZPositionSlider, doRemove, exportDisplayedData, 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, getControlWidgets, 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, getDisplayedData, 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, getInitialZPosition, 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, 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, getViewMenuItems, getWasUnPersisted, getWindow, getWindowSize, getWindowVisible, getWindowX, getWindowY, getZPosition, getZPositionSliderLabel, guiExported, guiImported, handleDisplayChanged, handleWindowClosing, hasMapProjection, haveDataTimes, haveParameterDefaults, hide, hyperlinkUpdate, init, init, init, init, initAfterUnPersistence, initAfterUnPersistence, initAsPrototype, initAsTemplate, initBasic, initDone, 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, setAnimationInfo, setAnimationSet, setAttributeFlags, setCachedData, setCanDoRemoveAll, setCategories, setCollapseLegend, setColor, setColorBrighter, setColorDimmer, setColorDimness, setColorScaleInfo, setColorScaleVisible, setColorTable, setColorTable, setColorTableName, setColorUnit, setColorUnitName, setComponentHolder, setContents, setContourInfo, setContourInfoParams, setData, 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, shouldAddControlListener, 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, transectChanged, updateAnimation, updateDisplayList, updateLegendAndList, updateLockButton, 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, 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, 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.collab.Sharable
getShareGroup, getSharing, getUniqueId
 

Field Detail

SHARE_PROFILE

public static final String SHARE_PROFILE
profile sharing property

See Also:
Constant Field Values

positionText

protected String positionText
Keep around for the label macros

Constructor Detail

LineProbeControl

public LineProbeControl()
Default Constructor.

Method Detail

doMakeProbe

public void doMakeProbe()
                 throws VisADException,
                        RemoteException
Default doMakeProbe method.

Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

doMakeProbe

public void doMakeProbe(Color c)
                 throws VisADException,
                        RemoteException
Make the probe with the specific Color.

Parameters:
c - color for probe.
Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

doMakeProbe

public void doMakeProbe(ViewDescriptor view)
                 throws VisADException,
                        RemoteException
Make the probe with the specific ViewDescriptor.

Parameters:
view - view descriptor
Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

doMakeProbe

public void doMakeProbe(Color probeColor,
                        ViewDescriptor view)
                 throws VisADException,
                        RemoteException
Make the probe with the specific Color and ViewDescriptor.

Parameters:
probeColor - color for the probe
view - view descriptor
Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Handle changes

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

resetProbePosition

public void resetProbePosition()
Reset the position of the probe to the center.


getEditMenuItems

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

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

setProbePosition

public void setProbePosition(RealTuple xy)
                      throws VisADException,
                             RemoteException
Set the probe position. Probes are set in XY space.

Parameters:
xy - X and Y position of the probe.
Throws:
VisADException - problem setting probe position
RemoteException - problem setting probe position on remote display

setProbePosition

public void setProbePosition(double x,
                             double y)
                      throws VisADException,
                             RemoteException
Set the probe position from display x and y positions.

Parameters:
x - X position of the probe.
y - Y position of the probe.
Throws:
VisADException - problem setting probe position
RemoteException - problem setting probe position on remote display

setPosition

public void setPosition(RealTuple p)
Set the initial position of the probe. This is used by the XML persistense.

Parameters:
p - position

getPosition

public RealTuple getPosition()
                      throws VisADException,
                             RemoteException
Get the position of the probe. This is used by the XML persistense.

Returns:
current probe position or null if probe has not been created.
Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

getInitialPosition

public RealTuple getInitialPosition()
Get the initial position of the probe set during unpersistence.

Returns:
initial position or null if not set during initialization.

receiveShareData

public void receiveShareData(Sharable from,
                             Object dataId,
                             Object[] data)
Method called when sharing is enabled.

Specified by:
receiveShareData in interface Sharable
Overrides:
receiveShareData in class DisplayControlImpl
Parameters:
from - Sharable that send the data.
dataId - identifier for data to be shared
data - data to be shared.

doMoveProbe

protected void doMoveProbe()
Method called when probe is moved.


probePositionChanged

protected void probePositionChanged(RealTuple position)
This gets called when either the user moves the probe point or when we get a sharable event to move the probe point. Subclasses need to implement this.

Parameters:
position - new position for the probe.

projectionChanged

public void projectionChanged()
Respond to a change in the display's projection. In this case we fire the probePositionChanged() method with the probe's position.

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

doMakeProbeMenu

public JMenu doMakeProbeMenu(JMenu probeMenu)
Make a menu for controlling the probe size, shape and position.

Parameters:
probeMenu - The menu to add to
Returns:
The menu

increaseProbeSize

public void increaseProbeSize()
Increase the probe size


decreaseProbeSize

public void decreaseProbeSize()
Decrease the probe size


setPointSize

public void setPointSize(float value)
Set the PointSize property.

Parameters:
value - The new value for PointSize

getPointSize

public float getPointSize()
Get the PointSize property.

Returns:
The PointSize

getGridCenterPosition

public RealTuple getGridCenterPosition()
                                throws VisADException,
                                       RemoteException
Get initial XY position from grid data.

Returns:
initial XY position of grid center point in VisAD space
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

getInitialLinePosition

public RealTuple getInitialLinePosition()
                                 throws VisADException,
                                        RemoteException
Get initial XY position from the screen

Returns:
initial XY position in VisAD space
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

setMarker

public void setMarker(String value)
Set the Marker property.

Parameters:
value - The new value for Marker

getMarker

public String getMarker()
Get the Marker property.

Returns:
The Marker

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 an