001package jmri.jmrix.nce.serialdriver;
002
003/**
004 * Definition of objects to handle configuring a layout connection via an NCE
005 * SerialDriverAdapter object.
006 *
007 * @author Bob Jacobsen Copyright (C) 2001, 2003
008 * @author kcameron Copyright (C) 2010 added multiple connections
009 */
010public class ConnectionConfig extends jmri.jmrix.AbstractSerialConnectionConfig {
011
012    public final static String NAME = Bundle.getMessage("TypeSerial");
013
014    /**
015     * Ctor for an object being created during load process; Swing init is
016     * deferred.
017     *
018     * @param p SerialPortAdapter for existing adapter
019     */
020    public ConnectionConfig(jmri.jmrix.SerialPortAdapter p) {
021        super(p);
022    }
023
024    /**
025     * Ctor for a functional Swing object with no existing adapter
026     */
027    public ConnectionConfig() {
028        super();
029    }
030
031    @Override
032    public String name() {
033        return NAME;
034    }
035
036    /**
037     * {@inheritDoc}
038     */
039    @Override
040    protected void setInstance() {
041        if (adapter == null) {
042            adapter = new SerialDriverAdapter();
043        }
044    }
045
046}