001package jmri.jmrix.nce.simulator; 002 003/** 004 * Definition of objects to handle configuring a layout connection via an NCE 005 * SerialDriverAdapter object, set up as Simulator. 006 * 007 * @author Bob Jacobsen Copyright (C) 2001, 2003 Convert to multiple connection 008 * @author kcameron Copyright (C) 2010 009 */ 010public class ConnectionConfig extends jmri.jmrix.AbstractSimulatorConnectionConfig { 011 012 public final static String NAME = "NCE Simulator"; // NOI18N 013 014 /** 015 * Ctor for an object being created during load process; Swing init is 016 * deferred. 017 * 018 * @param p SerialPortAdapter for existing adapter 019 */ 020 public ConnectionConfig(jmri.jmrix.SerialPortAdapter p) { 021 super(p); 022 } 023 024 /** 025 * Ctor for a functional Swing object with no existing adapter. 026 */ 027 public ConnectionConfig() { 028 super(); 029 } 030 031 @Override 032 public String name() { 033 return NAME; 034 } 035 036 /** 037 * {@inheritDoc} 038 */ 039 @Override 040 protected void setInstance() { 041 if (adapter == null) { 042 adapter = new SimulatorAdapter(); 043 } 044 } 045 046}