001package jmri.jmrit.operations.trains.configurexml;
002
003import org.jdom2.Element;
004import org.slf4j.Logger;
005import org.slf4j.LoggerFactory;
006
007import jmri.jmrit.display.configurexml.LocoIconXml;
008
009/**
010 * Handle configuration for display.TrainIcon objects.
011 *
012 * @author mstevetodd Copyright: Copyright (c) 2012
013 * 
014 */
015public class TrainIconXml extends LocoIconXml {
016
017    public TrainIconXml() {
018    }
019
020    /**
021     * Default implementation for storing the contents of a TrainIcon.
022     * TrainIcons are restored by the operations code.
023     *
024     * @param o Object to store, of type TrainIcon
025     * @return Element containing the complete info
026     * 
027     */
028    @Override
029    public Element store(Object o) {
030        return null;
031    }
032
033    /**
034     * TrainIcons should be loaded by the operations function, not here
035     *
036     * @param element Top level Element to unpack.
037     * @param o       an Editor as an Object
038     * 
039     */
040    @Override
041    public void load(Element element, Object o) {
042        //NOTE: this method should not be populated.  
043        //  The operations program restores the Icons when the Trains window is opened.   
044        //  The train icons have to be placed based on the trains database state,
045        //  and not where the icons were on the panel when the panel was saved.
046        log.debug("Warning: loading of TrainIcon not implemented, TrainIcons will be placed by Operations");
047    }
048
049    private final static Logger log = LoggerFactory.getLogger(TrainIconXml.class);
050}