Class 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
  • Field Details

  • Constructor Details

    • LineProbeControl

      public LineProbeControl()
      Default Constructor.
  • 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, 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.
      Overrides:
      setPointSize in class DisplayControlImpl
      Parameters:
      value - The new value for 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
    • canDoProgressiveResolution

      protected boolean canDoProgressiveResolution()
      Description copied from class: DisplayControlImpl
      Does this control support progressive resolution? Subclasses should override.
      Overrides:
      canDoProgressiveResolution in class GridDisplayControl
      Returns:
      _more_
    • shouldAddControlListener

      protected boolean shouldAddControlListener()
      Description copied from class: GridDisplayControl
      Signal base class to add this as a control listener
      Overrides:
      shouldAddControlListener in class GridDisplayControl
      Returns:
      _more_
    • viewpointChanged

      public void viewpointChanged()
      _more_
      Overrides:
      viewpointChanged in class DisplayControlImpl
    • hasMapProjection

      public boolean hasMapProjection()
      _more_
      Overrides:
      hasMapProjection in class DisplayControlImpl
      Returns:
      _more_
    • 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:
      relocateDisplay in class DisplayControlImpl
      Parameters:
      originalBounds - The original bounds of the datasource
      newBounds - The relocated bounds of the datasource