jmri.jmrit.operations
Class OperationsXml

java.lang.Object
  extended by jmri.jmrit.XmlFile
      extended by jmri.jmrit.operations.OperationsXml
Direct Known Subclasses:
CarManagerXml, EngineManagerXml, LocationManagerXml, OperationsSetupXml, RouteManagerXml, TrainManagerXml

public class OperationsXml
extends XmlFile

Loads and stores the operation setup using xml files.

Author:
Daniel Boudreau Copyright (C) 2008

Field Summary
 
Fields inherited from class jmri.jmrit.XmlFile
dtdLocation, xsltLocation
 
Constructor Summary
OperationsXml()
           
 
Method Summary
 String convertFromXmlComment(String comment)
          Convert xml string comment to standard string format one character at a time, except when
 String convertToXmlComment(String comment)
          Convert standard string to xml string one character at a time expect when a \n is found.
protected  File createFile(String fullPatnName, boolean backupFile)
           
 String getDefaultOperationsFilename()
           
static String getFileLocation()
          Absolute path to location of Operations files.
static String getOperationsDirectoryName()
           
 String getOperationsFileName()
           
 boolean isDirty()
           
protected  void load()
           
protected  void readFile(String filename)
           
 void setDirty(boolean b)
           
static void setOperationsDirectoryName(String name)
           
 void setOperationsFileName(String name)
           
protected  void writeFile(String filename)
           
 void writeFileIfDirty()
           
 void writeOperationsFile()
          Store the all of the operation train objects in the default place, including making a backup if needed
 
Methods inherited from class jmri.jmrit.XmlFile
addDefaultInfo, backupFileName, checkFile, createFileNameWithDate, dumpElement, ensurePrefsPresent, findFile, getBuilder, getRootViaURI, getVerify, makeBackupFile, makeBackupFile, newDocument, newDocument, prefsDir, reportError1, reportError2, resourcesDir, revertBackupFile, rootFromFile, rootFromName, rootFromURL, scriptsDir, setScriptsFileLocationDefault, setUserFileLocationDefault, setVerify, userFileChooser, userFileChooser, userFileChooser, userFileChooser, userFileLocationDefault, writeXML, xmlDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationsXml

public OperationsXml()
Method Detail

writeOperationsFile

public void writeOperationsFile()
Store the all of the operation train objects in the default place, including making a backup if needed


load

protected void load()

createFile

protected File createFile(String fullPatnName,
                          boolean backupFile)

writeFile

protected void writeFile(String filename)
                  throws FileNotFoundException,
                         IOException
Throws:
FileNotFoundException
IOException

readFile

protected void readFile(String filename)
                 throws JDOMException,
                        IOException
Throws:
JDOMException
IOException

setDirty

public void setDirty(boolean b)

isDirty

public boolean isDirty()

writeFileIfDirty

public void writeFileIfDirty()

getDefaultOperationsFilename

public String getDefaultOperationsFilename()

setOperationsDirectoryName

public static void setOperationsDirectoryName(String name)

getOperationsDirectoryName

public static String getOperationsDirectoryName()

setOperationsFileName

public void setOperationsFileName(String name)

getOperationsFileName

public String getOperationsFileName()

getFileLocation

public static String getFileLocation()
Absolute path to location of Operations files.

Default is in the prefsDir, but can be set to anything.

See Also:
XmlFile.prefsDir()

convertToXmlComment

public String convertToXmlComment(String comment)
Convert standard string to xml string one character at a time expect when a \n is found. In that case, insert a "".

Parameters:
comment - standard string
Returns:
string converted to xml format.

convertFromXmlComment

public String convertFromXmlComment(String comment)
Convert xml string comment to standard string format one character at a time, except when is found. In that case, insert a \n and skip over those characters.

Parameters:
comment - input xml comment string
Returns:
output string converted to standard format


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads