Class Grid2DReadoutProbe

All Implemented Interfaces:
ActionListener, ItemListener, PropertyChangeListener, EventListener, HyperlinkListener, Sharable, DataChangeListener, DisplayControl, Prototypable, ControlListener, DisplayListener

public class Grid2DReadoutProbe 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$Date: 2011/03/24 16:06:32 $
Author:
IDV development team
  • Field Details

    • SHARE_PROFILE

      public static final String SHARE_PROFILE
      profile sharing property
      See Also:
    • probe

      protected PointProbe probe
      the line probe
    • positionText

      protected String positionText
      Keep around for the label macros
  • Constructor Details

  • Method Details

    • 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, DisplayMaster master) throws VisADException, RemoteException
      Make the probe with the specific Color and associate it with the given DisplayMaster.
      Parameters:
      probeColor - Color of the probe.
      master - DisplayMaster of the display we will be probing.
      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 newPos)
      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:
      newPos - New position for the probe.
    • updatePosition

      protected void updatePosition(RealTuple position)
    • getNavigatedDisplay

      public NavigatedDisplay getNavigatedDisplay()
      Description copied from class: DisplayControlImpl
      A helper method for finding the NavigatedDisplay of this control's MapViewManager. This iterates through the list of DisplayInfo-s, finding the first one that holds an instance of a MapViewManager. If not found this uses the default MapViewManager
      Overrides:
      getNavigatedDisplay in class DisplayControlImpl
      Returns:
      The NavigatedDisplay that this control displays in.
    • check2DEarthTuple

      public static RealTupleType check2DEarthTuple(FlatField field)
    • 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.
      Overrides:
      setPointSize in class DisplayControlImpl
      Parameters:
      value - The new value for PointSize
    • getPointSize

      public float getPointSize()
      Get the PointSize property.
      Overrides:
      getPointSize in class DisplayControlImpl
      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 any macro name/value pairs.
      Overrides:
      addLabelMacros in class DisplayControlImpl
      Parameters:
      template - template
      patterns - The macro names
      values - The macro values
    • updateLegendLabel

      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.
      Overrides:
      updateLegendLabel in class DisplayControlImpl
    • 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