ucar.unidata.ui.symbol
Class StationModelManager

java.lang.Object
  extended by ucar.unidata.util.ResourceManager
      extended by 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 Summary
static PatternFileFilter FILTER_ISM
          The file pattern for selecting station model files
protected  XmlResourceCollection symbolTypes
          This defines where we get the symbol definition xml files
 
Fields inherited from class ucar.unidata.util.ResourceManager
listOfResourceLists, log_, LU, nameToObject, PROP_RESOURCECHANGE, PROP_RESOURCEREMOVE, resources, usersList, writablePath
 
Constructor Summary
StationModelManager()
          ctor
StationModelManager(XmlEncoder encoder)
          ctor
 
Method Summary
 void addStationModel(StationModel stationModel)
          Add the station model into the list of user SMS
 boolean checkCloseWindow()
          Check if there has been a change to the currently edited station model.
 StationModel getDefaultStationModel()
          Get the default station model.
 List getFileFilters()
          Get the file filters to use for selecting files.
 JFrame getFrame()
          Get the frame.
 StationModel getSelectedStationModel()
          Get the station model to use for selected locations
 StationModel getStationModel()
          Return the currently station model being edited.
 StationModel getStationModel(String name)
          Get the named station model
 String getStationModelName()
          Return the name of currently station model being edited.
 List getStationModels()
          Get the list of all station models.
 String getTitle()
          Override the ResourceManager method to get the title to use
 void init(XmlResourceCollection symbolTypes, ResourceCollection stationModels)
          Initialize.
static void main(String[] args)
          test
 void show()
          Show the editor window
 void show(StationModel initModel)
          Show the editor dialog for the station model.
 void show(String modelName)
          Show the editor dialog for the named station model
 
Methods inherited from class ucar.unidata.util.ResourceManager
addPropertyChangeListener, addUsers, doExport, doExport, doImport, doImport, doImport, doNew, doNew, doNew, doSaveAs, firePropertyChange, firePropertyChange, getDefault, getEncoder, getExportContents, getFileSuffix, getObject, getReadFileFilters, getResources, getResourceTimestamp, getUsersIndex, getUsersObject, getWriteFileFilters, hasUsers, init, initDone, initResource, isUsers, processObject, reloadResources, removePropertyChangeListener, removeUsers, resourceExists, shouldWeIgnoreThisXml, toObject, toObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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 Detail

StationModelManager

public StationModelManager()
ctor


StationModelManager

public StationModelManager(XmlEncoder encoder)
ctor

Parameters:
encoder - The XML encoder to use
Method Detail

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