Search in sources :

Example 1 with VirtualSignalHead

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

Example 2 with VirtualSignalHead

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;
}
Also used : SignalHead(jmri.SignalHead) VirtualSignalHead(jmri.implementation.VirtualSignalHead) VirtualSignalHead(jmri.implementation.VirtualSignalHead)

Aggregations

VirtualSignalHead (jmri.implementation.VirtualSignalHead)2 SignalHead (jmri.SignalHead)1 Element (org.jdom2.Element)1