001package jmri.jmrix.ecos.networkdriver;
002
003/**
004 * Definition of objects to handle configuring an ECoS layout connection via a
005 * NetworkDriverAdapter object.
006 *
007 * @author Bob Jacobsen Copyright (C) 2001, 2003
008 */
009public class ConnectionConfig extends jmri.jmrix.AbstractNetworkConnectionConfig {
010
011    /**
012     * Ctor for an object being created during load process; Swing init is
013     * deferred.
014     * @param p the NetworkPortAdapter to associate with this connection
015     */
016    public ConnectionConfig(jmri.jmrix.NetworkPortAdapter p) {
017        super(p);
018    }
019
020    /**
021     * Ctor for a connection configuration with no preexisting adapter.
022     * {@link #setInstance()} will fill the adapter member.
023     */
024    public ConnectionConfig() {
025        super();
026    }
027
028    @Override
029    public String name() {
030        return Bundle.getMessage("EcosViaNetworkConnection");
031    }
032
033    /**
034     * Access to current selected command station mode
035     */
036    /*public String getMode() {
037     return opt2Box.getSelectedItem().toString();
038     }*/
039
040    /**
041     * {@inheritDoc}
042     */
043    @Override
044    public void setInstance() {
045        if (adapter == null) {
046            adapter = new NetworkDriverAdapter();
047            adapter.setPort(15471);
048        }
049    }
050
051}