use of jmri.jmrix.grapevine.SerialSignalHead in project JMRI by JMRI.
the class SerialSignalHeadXml method store.
/**
* Default implementation for storing the contents of a Grapevine
* SerialSignalHead
*
* @param o Object to store, of type SerialSignalHead
* @return Element containing the complete info
*/
@Override
public Element store(Object o) {
SerialSignalHead p = (SerialSignalHead) o;
Element element = new Element("signalhead");
element.setAttribute("class", this.getClass().getName());
// include contents
element.setAttribute("systemName", p.getSystemName());
storeCommon(p, element);
return element;
}
use of jmri.jmrix.grapevine.SerialSignalHead in project JMRI by JMRI.
the class SerialSignalHeadXml method load.
@Override
public boolean load(Element shared, Element perNode) {
String sys = shared.getAttribute("systemName").getValue();
Attribute a = shared.getAttribute("userName");
SignalHead h;
if (a == null) {
h = new SerialSignalHead(sys);
} else {
h = new SerialSignalHead(sys, a.getValue());
}
loadCommon(h, shared);
InstanceManager.getDefault(jmri.SignalHeadManager.class).register(h);
return true;
}
Aggregations