001package jmri.jmrix.loconet.locobufferusb;
002
003import jmri.util.SystemType;
004
005/**
006 * Definition of objects to handle configuring a LocoBuffer-USB layout
007 * connection via a LocoBufferIIAdapter object.
008 *
009 * @author Bob Jacobsen Copyright (C) 2001, 2003
010 */
011public class ConnectionConfig extends jmri.jmrix.AbstractSerialConnectionConfig {
012
013    /**
014     * Ctor for an object being created during load process; Swing init is
015     * deferred.
016     * @param p the SerialPortAdapter to associate with this connection
017     */
018    public ConnectionConfig(jmri.jmrix.SerialPortAdapter p) {
019        super(p);
020    }
021
022    /**
023     * Ctor for a connection configuration with no preexisting adapter.
024     * {@link #setInstance()} will fill the adapter member.
025     */
026    public ConnectionConfig() {
027        super();
028    }
029
030    @Override
031    public String name() {
032        return "LocoNet LocoBuffer-USB"; // NOI18N
033    }
034
035    public boolean isOptList2Advanced() {
036        return false;
037    }
038
039    @Override
040    protected void setInstance() {
041        if (adapter == null) {
042            adapter = new LocoBufferUsbAdapter();
043        }
044    }
045
046    @Override
047    protected String[] getPortFriendlyNames() {
048        if (SystemType.isWindows()) {
049            return new String[]{"LocoBuffer-USB", "LocoBuffer"}; // NOI18N
050        }
051        return new String[]{};
052    }
053
054}