Class OptionsFile

java.lang.Object
jmri.jmrit.XmlFile
jmri.jmrit.dispatcher.OptionsFile
All Implemented Interfaces:
InstanceManagerAutoDefault

public class OptionsFile extends XmlFile implements InstanceManagerAutoDefault
Handles reading and writing of Dispatcher options to disk as an XML file called "dispatcher-options.xml" in the user's preferences area.

This class manipulates the files conforming to the dispatcher-options DTD

The file is written when the user requests that options be saved. If the dispatcheroptions.xml file is present when Dispatcher is started, it is read and options set accordingly

This file is part of JMRI.

JMRI is open source software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

  • Field Details

  • Constructor Details

  • Method Details

    • setDefaultFileName

      public static void setDefaultFileName(String testLocation)
    • readDispatcherOptions

      public void readDispatcherOptions(DispatcherFrame f) throws org.jdom2.JDOMException, IOException
      Read Dispatcher Options from a file in the user's preferences directory. The default location is within the dispatcher directory. The previous location is also supported. If the file containing Dispatcher Options does not exist, this routine returns quietly.

      The lename attribute is deprecated at 5.1.3. The current value will be retained.

      Parameters:
      f - The dispatcher instance.
      Throws:
      org.jdom2.JDOMException - if dispatcher parameter logically incorrect
      IOException - if dispatcher parameter not found
    • writeDispatcherOptions

      Write out Dispatcher options to a file in the user's preferences directory.

      The lename attribute is deprecated at 5.1.3. The current value will be retained.

      Parameters:
      f - Dispatcher instance.
      Throws:
      IOException - Thrown if dispatcher option file not found