Search in sources :

Example 1 with SerialSignalHead

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;
}
Also used : SerialSignalHead(jmri.jmrix.grapevine.SerialSignalHead) Element(org.jdom2.Element)

Example 2 with SerialSignalHead

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;
}
Also used : Attribute(org.jdom2.Attribute) SerialSignalHead(jmri.jmrix.grapevine.SerialSignalHead) SignalHead(jmri.SignalHead) SerialSignalHead(jmri.jmrix.grapevine.SerialSignalHead)

Aggregations

SerialSignalHead (jmri.jmrix.grapevine.SerialSignalHead)2 SignalHead (jmri.SignalHead)1 Attribute (org.jdom2.Attribute)1 Element (org.jdom2.Element)1