001package jmri.jmrix.tmcc.serialdriver; 002 003/** 004 * Definition of objects to handle configuring a TMCC layout connection 005 * 006 * @author Bob Jacobsen Copyright (C) 2003, 2006 007 */ 008public class ConnectionConfig extends jmri.jmrix.AbstractSerialConnectionConfig { 009 010 /** 011 * Create a connection configuration with an existing adapter. 012 * 013 * @param p the adapter 014 */ 015 public ConnectionConfig(jmri.jmrix.SerialPortAdapter p) { 016 super(p); 017 } 018 019 /** 020 * Ctor for a connection configuration with no preexisting adapter. 021 * {@link #setInstance()} will fill the adapter member. 022 */ 023 public ConnectionConfig() { 024 super(); 025 } 026 027 @Override 028 public String name() { 029 return Bundle.getMessage("AdapterSerialName"); 030 } 031 032 /** 033 * {@inheritDoc} 034 */ 035 @Override 036 protected void setInstance() { 037 if (adapter == null) { 038 adapter = new SerialDriverAdapter(); 039 } 040 } 041 042}