jmri.jmrit.decoderdefn
Class DecoderFile

java.lang.Object
  extended by jmri.jmrit.XmlFile
      extended by jmri.jmrit.decoderdefn.DecoderFile

public class DecoderFile
extends XmlFile

Represents and manipulates a decoder definition, both as a file and in memory. The internal storage is a JDOM tree.

This object is created by DecoderIndexFile to represent the decoder identification info _before_ the actual decoder file is read.

Author:
Bob Jacobsen Copyright (C) 2001, Howard G. Penny Copyright (C) 2005
See Also:
DecoderIndexFile

Field Summary
static String fileLocation
           
 
Fields inherited from class jmri.jmrit.XmlFile
dtdLocation, xsltLocation
 
Constructor Summary
DecoderFile()
           
DecoderFile(String mfg, String mfgID, String model, String lowVersionID, String highVersionID, String family, String filename, int numFns, int numOuts, Element decoder)
           
 
Method Summary
 String getFamily()
           
 String getFamilyComment()
           
 String getFilename()
           
 String getMfg()
           
 String getMfgID()
           
static String getMfgName(Element decoderElement)
           
 String getModel()
           
 String getModelComment()
           
 Element getModelElement()
           
 int getNumFunctions()
           
 int getNumOutputs()
           
 String getProductID()
           
 boolean[] getVersions()
          return array of versions
 String getVersionsAsString()
           
static boolean isIncluded(Element e, String productID)
           
 boolean isVersion(int i)
          Test for correct decoder version number
 void loadResetModel(Element decoderElement, ResetTableModel resetModel)
           
 void loadVariableModel(Element decoderElement, VariableTableModel variableModel)
           
 void setOneVersion(int i)
           
 void setVersionRange(int low, int high)
           
 void setVersionRange(String lowVersionID, String highVersionID)
           
 String titleString()
          Convert to a cannonical text form for ComboBoxes, etc.
static String titleString(String model, String family)
           
 
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
 

Field Detail

fileLocation

public static String fileLocation
Constructor Detail

DecoderFile

public DecoderFile()

DecoderFile

public DecoderFile(String mfg,
                   String mfgID,
                   String model,
                   String lowVersionID,
                   String highVersionID,
                   String family,
                   String filename,
                   int numFns,
                   int numOuts,
                   Element decoder)
Method Detail

setOneVersion

public void setOneVersion(int i)

setVersionRange

public void setVersionRange(int low,
                            int high)

setVersionRange

public void setVersionRange(String lowVersionID,
                            String highVersionID)

isVersion

public boolean isVersion(int i)
Test for correct decoder version number

Parameters:
i -
Returns:
true if decoder version matches id

getVersions

public boolean[] getVersions()
return array of versions


getVersionsAsString

public String getVersionsAsString()

getMfg

public String getMfg()

getMfgID

public String getMfgID()

getModel

public String getModel()

getFamily

public String getFamily()

getFilename

public String getFilename()

getNumFunctions

public int getNumFunctions()

getNumOutputs

public int getNumOutputs()

getModelComment

public String getModelComment()

getFamilyComment

public String getFamilyComment()

getProductID

public String getProductID()

getModelElement

public Element getModelElement()

getMfgName

public static String getMfgName(Element decoderElement)

isIncluded

public static boolean isIncluded(Element e,
                                 String productID)

loadVariableModel

public void loadVariableModel(Element decoderElement,
                              VariableTableModel variableModel)

loadResetModel

public void loadResetModel(Element decoderElement,
                           ResetTableModel resetModel)

titleString

public String titleString()
Convert to a cannonical text form for ComboBoxes, etc.

Must distinquish identical models in different families.


titleString

public static String titleString(String model,
                                 String family)


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