001package jmri.jmrix.loconet.loconetovertcp;
002
003
004/**
005 * Definition of objects to handle configuring a LocoNetOverTcp layout
006 * connection via a LnTcpDriverAdapter object.
007 *
008 * @author Bob Jacobsen Copyright (C) 2001, 2003
009 * @author Stephen Williams Copyright (C) 2008
010 *
011 */
012public class ConnectionConfig extends jmri.jmrix.AbstractNetworkConnectionConfig {
013
014    /**
015     * Ctor for an object being created during load process; Swing init is
016     * deferred.
017     * @param p the NetworkPortAdapter to associate with this connection
018     */
019    public ConnectionConfig(jmri.jmrix.NetworkPortAdapter p) {
020        super(p);
021    }
022
023    /**
024     * Ctor for a connection configuration with no preexisting adapter.
025     * {@link #setInstance()} will fill the adapter member.
026     */
027    public ConnectionConfig() {
028        super();
029    }
030
031    @Override
032    public String name() {
033        return Bundle.getMessage("ConnectionTitle");
034    }
035
036    public boolean isOptList1Advanced() {
037        return false;
038    }
039
040    @Override
041    protected void setInstance() {
042        if (adapter == null) {
043            adapter = new LnTcpDriverAdapter();
044            adapter.setPort(1234);
045        }
046    }
047
048}