Class ParamDefaultsEditor

All Implemented Interfaces:
ActionListener, EventListener, IdvConstants

public class ParamDefaultsEditor extends IdvManager implements ActionListener
This class provides 2 facilities. First, there is a set of static methods: init (XmlResourceCollection resources); Range getParamRange (String paramName); getParamColorTable (String paramName); that provide basic lookup of parameter defaults. The init method is called once. It is passed an XmlResourceCollection that holds the list of xml files to be used. The first resource in the list is taken to be the user's "writable" resource. These resources are read in, first to last, and a static collection of ParamInfo-s are is created that is used to do the subsequent param default lookups. This class is also used to provide an end-user editing facility.
Version:
$Revision: 1.78 $Date: 2007/06/22 13:03:56 $
Author:
IDV development team
  • Field Details

  • Constructor Details

    • ParamDefaultsEditor

      public ParamDefaultsEditor(IntegratedDataViewer idv)
      Create the editor with the given collection of xml resources
      Parameters:
      idv - The IDV
  • Method Details

    • exportSelectedToPlugin

      public void exportSelectedToPlugin()
      Export the selected param infos to the plugin manager
    • exportToPlugin

      public void exportToPlugin()
      Export allthe param infos to the plugin manager
    • addNewRow

      public void addNewRow()
      add a new row to users table
    • getParamInfos

      public List getParamInfos(boolean justFirst)
      Get the param infos
      Parameters:
      justFirst - if true then just get the first table
      Returns:
      param infos
    • getResources

      public List getResources()
      Get the list of resources
      Returns:
      the list of resources
    • loadResources

      public void loadResources(XmlResourceCollection resources)
      Load in the xml resources
      Parameters:
      resources - The resources
    • getCurrentTable

      public ParamDefaultsEditor.ParamDefaultsTable getCurrentTable()
      Return the ParamDefaultsTable which is currently being shown in the tabbed pane
      Returns:
      The current ParamDefaultsTable
    • doImport

      public void doImport()
      Import an xml param defaults file
    • doOpen

      public void doOpen()
      Open an xml param defaults file
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Handle the CLOSEANCEL, OK, HELP, events.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class WindowHolder
      Parameters:
      event - The event
    • showHelp

      public void showHelp()
      show help
    • doClose

      public void doClose()
      Close the window (and the color table editor if it is open)
    • getWindowTitle

      protected String getWindowTitle()
      Get the window title to use
      Overrides:
      getWindowTitle in class WindowHolder
      Returns:
      Window title
    • doSave

      public void doSave(List infoList, String filename)
      Save the list of ParamInfo-s into the given file
      Parameters:
      infoList - List of infos
      filename - The filename to write to
    • doSaveAs

      public void doSaveAs()
      Save the param infos
    • doSaveAs

      public void doSaveAs(List infoList)
      Prompt for a file and write out the ParamInfo-s from the given list.
      Parameters:
      infoList - List of ParamInfo-s
    • copyToUsers

      protected void copyToUsers(ParamInfo i)
      Copy the given ParamInfo object into the user's editable table
      Parameters:
      i - the param fino object to copy
    • saveDefaults

      public void saveDefaults(DisplayControlImpl displayControl)
      Get the color table, range, etc, from the given display control and save them as the param defaults for its data choice
      Parameters:
      displayControl - the display control to get state from
    • getParamRange

      public Range getParamRange(String paramName)
      Returns a Range based on the parameter name (e.g., rh, t, etc.)
      Parameters:
      paramName - Name to look for
      Returns:
      The Range found or null
    • getParamContourInfo

      public ContourInfo getParamContourInfo(String paramName)
      Returns a ContourInfo based on the parameter name (e.g., rh, t, etc.)
      Parameters:
      paramName - Name to look for
      Returns:
      The ContourInfo found or null
    • getParamDisplayUnit

      public Unit getParamDisplayUnit(String paramName)
      Returns a Unit based on the parameter name (e.g., rh, t, etc.)
      Parameters:
      paramName - Name to look for
      Returns:
      The Unit found or null
    • getParamColorTable

      public ColorTable getParamColorTable(String paramName)
      Returns a color table based on the parameter name (e.g., rh, t, etc.)
      Parameters:
      paramName - Name to look for
      Returns:
      The ColorTable found or null
    • getParamColorTable

      public ColorTable getParamColorTable(String paramName, boolean useDefault)
      Get the color table for the parameters
      Parameters:
      paramName - parameter name
      useDefault - true to use the default color table if not found
      Returns:
      the associated color table