001package jmri.jmrix.easydcc.serialdriver; 002 003/** 004 * Definition of objects to handle configuring an LocoBuffer layout connection 005 * via an EasyDccSerialDriverAdapter object. 006 * 007 * @author Bob Jacobsen Copyright (C) 2001, 2003 008 */ 009public class ConnectionConfig extends jmri.jmrix.AbstractSerialConnectionConfig { 010 011 /** 012 * Ctor for an object being created during load process. 013 * Swing init is deferred. 014 * @param p serial port adapter. 015 */ 016 public ConnectionConfig(jmri.jmrix.SerialPortAdapter 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("AdapterSerialName"); 031 } 032 033 /** 034 * {@inheritDoc} 035 */ 036 @Override 037 protected void setInstance() { 038 if (adapter == null) { 039 adapter = new SerialDriverAdapter(); 040 } 041 } 042 043}