Class OptionsFile
- All Implemented Interfaces:
InstanceManagerAutoDefault
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.jmrit.XmlFile
XmlFile.Validate -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DispatcherFrame(package private) static final AbstractXmlAdapter.EnumIO<DispatcherFrame.TrainsFrom>Fields inherited from class jmri.jmrit.XmlFile
dtdLocation, xsltLocation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRead Dispatcher Options from a file in the user's preferences directory.static voidsetDefaultFileName(String testLocation) voidWrite out Dispatcher options to a file in the user's preferences directory.Methods inherited from class jmri.jmrit.XmlFile
addDefaultInfo, backupFileName, checkFile, createFileNameWithDate, dumpElement, findFile, getBuilder, getDefaultDtdLocation, getDefaultValidate, getDtdLocation, getProcessingInstructionHRef, getProcessingInstructionType, getRoot, getValidate, makeBackupFile, makeBackupFile, newDocument, newDocument, revertBackupFile, rootFromFile, rootFromInputStream, rootFromName, rootFromURL, setDefaultDtdLocation, setDefaultValidate, setDtdLocation, setValidate, userFileChooser, userFileChooser, writeXML, xmlDir
-
Field Details
-
trainsFromEnumMap
-
dispatcher
-
-
Constructor Details
-
OptionsFile
public OptionsFile()
-
-
Method Details
-
setDefaultFileName
-
readDispatcherOptions
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 incorrectIOException- 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
-