Class StationModelManager

java.lang.Object
ucar.unidata.util.ResourceManager
ucar.unidata.ui.symbol.StationModelManager

public class StationModelManager extends ResourceManager
This manages the set of station models. It provides a wrapper around a StationModelCan
  • Field Details

    • FILTER_ISM

      public static final PatternFileFilter FILTER_ISM
      The file pattern for selecting station model files
    • symbolTypes

      protected XmlResourceCollection symbolTypes
      This defines where we get the symbol definition xml files
  • Constructor Details

    • StationModelManager

      public StationModelManager()
      ctor
    • StationModelManager

      public StationModelManager(XmlEncoder encoder)
      ctor
      Parameters:
      encoder - The XML encoder to use
  • Method Details

    • init

      public void init(XmlResourceCollection symbolTypes, ResourceCollection stationModels)
      Initialize.
      Parameters:
      symbolTypes - This defines where we get the symbol definition xml files
      stationModels - Where we get the station model files
    • addStationModel

      public void addStationModel(StationModel stationModel)
      Add the station model into the list of user SMS
      Parameters:
      stationModel - Station model to add
    • getFileFilters

      public List getFileFilters()
      Get the file filters to use for selecting files.
      Overrides:
      getFileFilters in class ResourceManager
      Returns:
      List of file filters
    • getTitle

      public String getTitle()
      Override the ResourceManager method to get the title to use
      Overrides:
      getTitle in class ResourceManager
      Returns:
      The title
    • show

      public void show()
      Show the editor window
    • show

      public void show(String modelName)
      Show the editor dialog for the named station model
      Parameters:
      modelName - Station model
    • checkCloseWindow

      public boolean checkCloseWindow()
      Check if there has been a change to the currently edited station model. If there is ask the user if they want to save it. If they cancel then don't close the window.
      Returns:
      true if it is ok to close, false if the user hits cancel
    • show

      public void show(StationModel initModel)
      Show the editor dialog for the station model. This may be null.
      Parameters:
      initModel - Initial model to show. May be null.
    • getFrame

      public JFrame getFrame()
      Get the frame.
      Returns:
      The frame
    • getDefaultStationModel

      public StationModel getDefaultStationModel()
      Get the default station model.
      Returns:
      Default station model.
    • getStationModel

      public StationModel getStationModel()
      Return the currently station model being edited.
      Returns:
      the station model being edited
    • getStationModelName

      public String getStationModelName()
      Return the name of currently station model being edited.
      Returns:
      the station model name being edited
    • getSelectedStationModel

      public StationModel getSelectedStationModel()
      Get the station model to use for selected locations
      Returns:
      selected station model
    • getStationModel

      public StationModel getStationModel(String name)
      Get the named station model
      Parameters:
      name - station model name
      Returns:
      The station model or null if none found.
    • getStationModels

      public List getStationModels()
      Get the list of all station models.
      Returns:
      All station models
    • main

      public static void main(String[] args)
      test
      Parameters:
      args - cmd line args