Package jmri.jmrit.ctc.configurexml
Class CtcManagerXml
- java.lang.Object
-
- jmri.configurexml.AbstractXmlAdapter
-
- jmri.managers.configurexml.AbstractNamedBeanManagerConfigXML
-
- jmri.jmrit.ctc.configurexml.CtcManagerXml
-
- All Implemented Interfaces:
XmlAdapter
public class CtcManagerXml extends AbstractNamedBeanManagerConfigXML
Provides the functionality for persistence of the CTC tool data. The data is stored in the PanelPro data xml file using the standard Load/Store process.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.configurexml.AbstractXmlAdapter
AbstractXmlAdapter.EnumIO<T extends java.lang.Enum<T>>, AbstractXmlAdapter.EnumIoMapped<T extends java.lang.Enum<T>>, AbstractXmlAdapter.EnumIoNames<T extends java.lang.Enum<T>>, AbstractXmlAdapter.EnumIoNamesNumbers<T extends java.lang.Enum<T>>, AbstractXmlAdapter.EnumIoOrdinals<T extends java.lang.Enum<T>>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) CtcManager
cm
-
Constructor Summary
Constructors Constructor Description CtcManagerXml()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
convertCallOnSensorNamesToNBHSensors(CtcManager cm)
(package private) org.jdom2.Element
createAdditionalTurnoutEntry(NBHTurnout turnout, boolean turnoutFeedback)
(package private) java.util.ArrayList<CallOnData>
getCallOnList(org.jdom2.Element element)
(package private) java.util.ArrayList<java.lang.String>
getCallOnSensorNames(org.jdom2.Element element)
(package private) java.util.ArrayList<NBHSensor>
getSensorList(org.jdom2.Element element)
(package private) java.util.ArrayList<NBHSignal>
getSignalList(org.jdom2.Element element)
(package private) java.util.ArrayList<TrafficLockingData>
getTrafficLocking(org.jdom2.Element element)
(package private) java.util.ArrayList<TrafficLockingData.TRLSwitch>
getTRLSwitchList(org.jdom2.Element element)
void
load(org.jdom2.Element element, java.lang.Object o)
Create a set of configured objects from their XML description, using an auxiliary object.boolean
load(org.jdom2.Element sharedCtcData, org.jdom2.Element perNodeCtcData)
Implementation for loading the contents of the CTC configuration.(package private) void
loadAdditionalTurnouts(org.jdom2.Element element, CodeButtonHandlerData cbhd)
(package private) NamedBeanHandle<Block>
loadBlock(org.jdom2.Element element)
(package private) boolean
loadBoolean(org.jdom2.Element element)
(package private) int
loadInt(org.jdom2.Element element)
int
loadOrder()
(package private) void
loadOtherData(CtcManager cm, org.jdom2.Element el)
Load the OtherData class.(package private) void
loadProperties(CtcManager cm, org.jdom2.Element el)
Load the ProgramProperties class.(package private) NBHSensor
loadSensor(org.jdom2.Element element, boolean isInternal)
(package private) NBHSignal
loadSignal(org.jdom2.Element element)
(package private) java.lang.String
loadString(org.jdom2.Element element)
(package private) NBHTurnout
loadTurnout(org.jdom2.Element element, org.jdom2.Element feedback)
void
setStoreElementClass(org.jdom2.Element ctcdata)
Subclass provides implementation to create the correct top element, including the type information.org.jdom2.Element
store(java.lang.Object o)
Implementation for storing the contents of the CTC configuration.(package private) org.jdom2.Element
storeBlock(java.lang.String elementName, NamedBeanHandle<Block> block)
(package private) org.jdom2.Element
storeBoolean(java.lang.String elementName, boolean elementValue)
(package private) org.jdom2.Element
storeCallOnList(java.lang.String elementName, java.util.List<CallOnData> callOnList)
(package private) org.jdom2.Element
storeInt(java.lang.String elementName, int elementValue)
(package private) org.jdom2.Element
storeOtherData(CtcManager cm)
(package private) org.jdom2.Element
storeProperties(CtcManager cm)
(package private) org.jdom2.Element
storeSensor(java.lang.String elementName, NBHSensor sensor)
(package private) org.jdom2.Element
storeSensorList(java.lang.String elementName, java.util.List<NBHSensor> sensors)
(package private) org.jdom2.Element
storeSignal(java.lang.String elementName, NBHSignal signal)
(package private) org.jdom2.Element
storeSignalList(java.lang.String elementName, java.util.List<NBHSignal> signals)
(package private) org.jdom2.Element
storeString(java.lang.String elementName, java.lang.String elementValue)
(package private) org.jdom2.Element
storeTRLRules(java.lang.String elementName, java.util.List<TrafficLockingData> trlList)
(package private) org.jdom2.Element
storeTRLSwitches(java.lang.String elementName, java.util.List<TrafficLockingData.TRLSwitch> trlSwitches)
(package private) org.jdom2.Element
storeTULAdditionalTurnouts(java.lang.String elementName, CodeButtonHandlerData cbhd)
(package private) org.jdom2.Element
storeTurnout(java.lang.String elementName, NBHTurnout turnout)
-
Methods inherited from class jmri.managers.configurexml.AbstractNamedBeanManagerConfigXML
checkedNamedBeanHandle, checkedNamedBeanName, checkedNamedBeanReference, getSystemName, getUserName, getUserName, loadCommon, storeCommon
-
Methods inherited from class jmri.configurexml.AbstractXmlAdapter
getAttributeBooleanValue, getAttributeDoubleValue, getAttributeFloatValue, getAttributeIntegerValue, getExceptionHandler, handleException, load, load, loadDeferred, setExceptionHandler, store
-
-
-
-
Field Detail
-
cm
CtcManager cm
-
-
Constructor Detail
-
CtcManagerXml
public CtcManagerXml()
-
-
Method Detail
-
store
public org.jdom2.Element store(java.lang.Object o)
Implementation for storing the contents of the CTC configuration.- Parameters:
o
- Object to store, of type CtcManager- Returns:
- Element containing the complete info
-
setStoreElementClass
public void setStoreElementClass(org.jdom2.Element ctcdata)
Subclass provides implementation to create the correct top element, including the type information. Default implementation is to use the local class here.- Parameters:
ctcdata
- The top-level element being created
-
storeProperties
org.jdom2.Element storeProperties(CtcManager cm)
-
storeOtherData
org.jdom2.Element storeOtherData(CtcManager cm)
-
storeString
org.jdom2.Element storeString(java.lang.String elementName, java.lang.String elementValue)
-
storeInt
org.jdom2.Element storeInt(java.lang.String elementName, int elementValue)
-
storeBoolean
org.jdom2.Element storeBoolean(java.lang.String elementName, boolean elementValue)
-
storeSensor
org.jdom2.Element storeSensor(java.lang.String elementName, NBHSensor sensor)
-
storeSignal
org.jdom2.Element storeSignal(java.lang.String elementName, NBHSignal signal)
-
storeTurnout
org.jdom2.Element storeTurnout(java.lang.String elementName, NBHTurnout turnout)
-
storeBlock
org.jdom2.Element storeBlock(java.lang.String elementName, NamedBeanHandle<Block> block)
-
storeSensorList
org.jdom2.Element storeSensorList(java.lang.String elementName, java.util.List<NBHSensor> sensors)
-
storeSignalList
org.jdom2.Element storeSignalList(java.lang.String elementName, java.util.List<NBHSignal> signals)
-
storeCallOnList
org.jdom2.Element storeCallOnList(java.lang.String elementName, java.util.List<CallOnData> callOnList)
-
storeTRLRules
org.jdom2.Element storeTRLRules(java.lang.String elementName, java.util.List<TrafficLockingData> trlList)
-
storeTRLSwitches
org.jdom2.Element storeTRLSwitches(java.lang.String elementName, java.util.List<TrafficLockingData.TRLSwitch> trlSwitches)
-
storeTULAdditionalTurnouts
org.jdom2.Element storeTULAdditionalTurnouts(java.lang.String elementName, CodeButtonHandlerData cbhd)
-
createAdditionalTurnoutEntry
org.jdom2.Element createAdditionalTurnoutEntry(NBHTurnout turnout, boolean turnoutFeedback)
-
load
public void load(org.jdom2.Element element, java.lang.Object o)
Description copied from class:AbstractXmlAdapter
Create a set of configured objects from their XML description, using an auxiliary object.For example, the auxilary object o might be a manager or GUI of some type that needs to be informed as each object is created.
- Specified by:
load
in interfaceXmlAdapter
- Overrides:
load
in classAbstractXmlAdapter
- Parameters:
element
- Top-level XML element containing the descriptiono
- Implementation-specific Object needed for the conversion
-
load
public boolean load(org.jdom2.Element sharedCtcData, org.jdom2.Element perNodeCtcData)
Implementation for loading the contents of the CTC configuration.- Specified by:
load
in interfaceXmlAdapter
- Overrides:
load
in classAbstractXmlAdapter
- Parameters:
sharedCtcData
- Element to loaded.perNodeCtcData
- Element to loaded (same as sharedCtcData).- Returns:
- true for successful load.
-
loadProperties
void loadProperties(CtcManager cm, org.jdom2.Element el)
Load the ProgramProperties class.- Parameters:
cm
- The CTC manager.el
- The "ctcProperties" element.
-
loadOtherData
void loadOtherData(CtcManager cm, org.jdom2.Element el)
Load the OtherData class.- Parameters:
cm
- The CTC manager.el
- The "ctcOtherData" element.
-
loadString
java.lang.String loadString(org.jdom2.Element element)
-
loadInt
int loadInt(org.jdom2.Element element)
-
loadBoolean
boolean loadBoolean(org.jdom2.Element element)
-
loadSensor
NBHSensor loadSensor(org.jdom2.Element element, boolean isInternal)
-
loadSignal
NBHSignal loadSignal(org.jdom2.Element element)
-
loadTurnout
NBHTurnout loadTurnout(org.jdom2.Element element, org.jdom2.Element feedback)
-
loadBlock
NamedBeanHandle<Block> loadBlock(org.jdom2.Element element)
-
getSensorList
java.util.ArrayList<NBHSensor> getSensorList(org.jdom2.Element element)
-
getSignalList
java.util.ArrayList<NBHSignal> getSignalList(org.jdom2.Element element)
-
getCallOnList
java.util.ArrayList<CallOnData> getCallOnList(org.jdom2.Element element)
-
getCallOnSensorNames
java.util.ArrayList<java.lang.String> getCallOnSensorNames(org.jdom2.Element element)
-
convertCallOnSensorNamesToNBHSensors
void convertCallOnSensorNamesToNBHSensors(CtcManager cm)
-
getTrafficLocking
java.util.ArrayList<TrafficLockingData> getTrafficLocking(org.jdom2.Element element)
-
getTRLSwitchList
java.util.ArrayList<TrafficLockingData.TRLSwitch> getTRLSwitchList(org.jdom2.Element element)
-
loadAdditionalTurnouts
void loadAdditionalTurnouts(org.jdom2.Element element, CodeButtonHandlerData cbhd)
-
loadOrder
public int loadOrder()
Description copied from class:AbstractXmlAdapter
- Specified by:
loadOrder
in interfaceXmlAdapter
- Overrides:
loadOrder
in classAbstractXmlAdapter
-
-