Class RadarGridControl

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

public class RadarGridControl extends DisplayControlImpl implements ActionListener
Display control for a "RadarGrid," radar range-rings plus radial lines.
Version:
$Revision: 1.103 $
  • Constructor Details

    • RadarGridControl

      public RadarGridControl()
      Default constructor; does nothing. See init() for creation actions. Need to have a parameter-less constructor for the reflection-based object creation in the IDV to call.
  • Method Details

    • init

      public boolean init(DataChoice dataChoice) throws VisADException, RemoteException
      Called to make this kind of Display Control; also makes the Displayable. This method is called from inside DisplayControlImpl.init(several args). If the DataChoice arg is null, a default location is used.
      Overrides:
      init in class DisplayControlImpl
      Parameters:
      dataChoice - the DataChoice of the moment; may be null.
      Returns:
      true if successful
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • shouldAddDisplayListener

      protected boolean shouldAddDisplayListener()
      Signal base class to add this as a display listener
      Overrides:
      shouldAddDisplayListener in class DisplayControlImpl
      Returns:
      Add as display listener
    • doRemove

      public void doRemove() throws VisADException, RemoteException
      Remove the display control
      Specified by:
      doRemove in interface DisplayControl
      Overrides:
      doRemove in class DisplayControlImpl
      Throws:
      RemoteException - Badness
      VisADException - Badness
    • setData

      protected boolean setData(LatLonPoint llp) throws VisADException, RemoteException
      reposition center of radar grid.
      Parameters:
      llp - new center point
      Returns:
      true if okay
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • getRadarGrid

      public RadarGrid getRadarGrid()
      Return the RadarGrid displayable
      Returns:
      the RadarGrid displayable
    • getEditMenuItems

      protected void getEditMenuItems(List items, boolean forMenuBar)
      Add the relevant edit menu items into the list
      Overrides:
      getEditMenuItems in class DisplayControlImpl
      Parameters:
      items - List of menu items
      forMenuBar - Is this for the menu in the window's menu bar or for a popup menu in the legend
    • doMakeContents

      public Container doMakeContents()
      Make the panel of controls in a vertical box.
      Overrides:
      doMakeContents in class DisplayControlImpl
      Returns:
      Container that holds the widgets for this control
    • setDisplayVisibility

      public void setDisplayVisibility(boolean on)
      Override base class method (used for legend bar clicks) so we can control the visiblity of the three items - rings, radials, labels - according to user-clicked gui items
      Specified by:
      setDisplayVisibility in interface DisplayControl
      Overrides:
      setDisplayVisibility in class DisplayControlImpl
      Parameters:
      on - true to display
    • getLegendLabels

      public void getLegendLabels(List labels, int legendType)
      Get the extra label used for the legend.
      Overrides:
      getLegendLabels in class DisplayControlImpl
      Parameters:
      labels - labels for legend
      legendType - The type of legend, BOTTOM_LEGEND or SIDE_LEGEND
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Deal with action events from the controls made by this class.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class DisplayControlImpl
      Parameters:
      event - event to check
    • shouldAddControlListener

      protected boolean shouldAddControlListener()
      A hook to allow derived classes to tell us to add this as a control listener
      Overrides:
      shouldAddControlListener in class DisplayControlImpl
      Returns:
      Add as control listener
    • handleDisplayChanged

      public void handleDisplayChanged(DisplayEvent event)
      Listen for DisplayEvents
      Overrides:
      handleDisplayChanged in class DisplayControlImpl
      Parameters:
      event - The event
    • setRadColor

      public void setRadColor(Color value)
      Set the color of the radials. (used by persistence)
      Parameters:
      value - Color of radials
    • getRadColor

      public Color getRadColor()
      Get the color of the radials. (used by persistence)
      Returns:
      Color of radials
    • setRrColor

      public void setRrColor(Color value)
      Set the color of the range rings. (used by persistence)
      Parameters:
      value - Color of range rings
    • getRrColor

      public Color getRrColor()
      Get the color of the range rings. (used by persistence)
      Returns:
      Color of range rings
    • setLblColor

      public void setLblColor(Color value)
      Set the color of the labels. (used by persistence)
      Parameters:
      value - Color of labels
    • getLblColor

      public Color getLblColor()
      Get the color of the labels. (used by persistence)
      Returns:
      Color of labels
    • setRrSpacing

      public void setRrSpacing(double value)
      Set the spacing of the range rings. (used by persistence)
      Parameters:
      value - spacing (km)
    • getRrSpacing

      public double getRrSpacing()
      Get the spacing of the range rings. (used by persistence)
      Returns:
      spacing (km)
    • setLblSpacing

      public void setLblSpacing(double value)
      Set the spacing of the labels. (used by persistence)
      Parameters:
      value - spacing (degrees)
    • getLblSpacing

      public double getLblSpacing()
      Get the spacing of the labels. (used by persistence)
      Returns:
      spacing (degrees)
    • setRadSpacing

      public void setRadSpacing(double value)
      Set the spacing of the radials. (used by persistence)
      Parameters:
      value - spacing (degrees)
    • getRadSpacing

      public double getRadSpacing()
      Get the spacing of the radials. (used by persistence)
      Returns:
      spacing (degrees)
    • setRrVisible

      public void setRrVisible(boolean value)
      Set whether range rings are visible. (used by persistence)
      Parameters:
      value - true if visible
    • getRrVisible

      public boolean getRrVisible()
      Get whether range rings are visible. (used by persistence)
      Returns:
      true if visible
    • setLblVisible

      public void setLblVisible(boolean value)
      Set whether distance labels are visible. (used by persistence)
      Parameters:
      value - true if visible
    • getLblVisible

      public boolean getLblVisible()
      Get whether distance labels are visible. (used by persistence)
      Returns:
      true if visible
    • setRadVisible

      public void setRadVisible(boolean value)
      Set whether radii are visible. (used by persistence)
      Parameters:
      value - true if visible
    • getRadVisible

      public boolean getRadVisible()
      Get whether radii are visible. (used by persistence)
      Returns:
      true if visible
    • setLat

      public void setLat(double value)
      Set the latitude (degrees) of the center point. (used by persistence)
      Parameters:
      value - center point latitude
    • getLat

      public double getLat()
      Get the latitude (degrees) of the center point. (used by persistence)
      Returns:
      center point latitude
    • setLon

      public void setLon(double value)
      Set the longitude (degrees) of the center point. (used by persistence)
      Parameters:
      value - center point longitude
    • getLon

      public double getLon()
      Get the longitude (degrees) of the center point. (used by persistence)
      Returns:
      center point longitude
    • getStationIdx

      public int getStationIdx()
      Get the station index in the list. (used by persistence)
      Returns:
      station index
    • setStationIdx

      public void setStationIdx(int idx)
      Set the station index in the list. (used by persistence)
      Parameters:
      idx - station index
    • setMaxRadius

      public void setMaxRadius(double value)
      Set the maximum radius value for the range rings. (used by persistence)
      Parameters:
      value - radius in kilometers
    • getMaxRadius

      public double getMaxRadius()
      Get the maximum radius value for the range rings. (used by persistence)
      Returns:
      radius in kilometers
    • setRadWidth

      public void setRadWidth(int width)
      Set the width of the radial lines. (used by persistence)
      Parameters:
      width - width in pixels
    • getRadWidth

      public int getRadWidth()
      Get the width of the radial lines. (used by persistence)
      Returns:
      width in pixels
    • getLblWidth

      public int getLblWidth()
      Get the width of the labels. (used by persistence)
      Returns:
      width in pixels
    • setLblWidth

      public void setLblWidth(int width)
      Set the width of the labels. (used by persistence)
      Parameters:
      width - width in pixels
    • getRrWidth

      public int getRrWidth()
      Get the width of the range rings. (used by persistence)
      Returns:
      width in pixels
    • setRrWidth

      public void setRrWidth(int width)
      Set the width of the range rings. (used by persistence)
      Parameters:
      width - width in pixels
    • setVerticalValue

      public void setVerticalValue(double value) throws RemoteException, VisADException
      Set the VerticalValue property.
      Parameters:
      value - The new value for VerticalValue deprecated Keep this around for legacy bundles.
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • setStationTableName

      public void setStationTableName(String value)
      Set the StationTableName property.
      Parameters:
      value - The new value for StationTableName
    • getStationTableName

      public String getStationTableName()
      Get the StationTableName property.
      Returns:
      The StationTableName
    • setLabelFont

      public void setLabelFont(Font value)
      Set the LabelFont property.
      Parameters:
      value - The new value for LabelFont
    • getLabelFont

      public Font getLabelFont()
      Get the LabelFont property.
      Returns:
      The LabelFont
    • setInitStationLocation

      public void setInitStationLocation(String l)
      For setting the property when this object is created
      Parameters:
      l - the initial station to use
    • setDisplayUnit

      public void setDisplayUnit(Unit newUnit)
      Set the display unit
      Overrides:
      setDisplayUnit in class DisplayControlImpl
      Parameters:
      newUnit - the new display unit