use of jmri.implementation.VirtualSignalHead in project JMRI by JMRI.
the class VirtualSignalHeadXml method store.
/**
* Default implementation for storing the contents of a VirtualSignalHead
*
* @param o Object to store, of type TripleTurnoutSignalHead
* @return Element containing the complete info
*/
@Override
public Element store(Object o) {
VirtualSignalHead p = (VirtualSignalHead) o;
Element element = new Element("signalhead");
element.setAttribute("class", this.getClass().getName());
// include contents
element.addContent(new Element("systemName").addContent(p.getSystemName()));
storeCommon(p, element);
return element;
}
use of jmri.implementation.VirtualSignalHead in project JMRI by JMRI.
the class VirtualSignalHeadXml method load.
@Override
public boolean load(Element shared, Element perNode) {
// put it together
String sys = getSystemName(shared);
String uname = getUserName(shared);
SignalHead h;
if (uname == null) {
h = new VirtualSignalHead(sys);
} else {
h = new VirtualSignalHead(sys, uname);
}
loadCommon(h, shared);
InstanceManager.getDefault(jmri.SignalHeadManager.class).register(h);
return true;
}
Aggregations