001package jmri.jmrix.loconet.pr3; 002 003import jmri.util.SystemType; 004 005/** 006 * Definition of objects to handle configuring a PR3 layout connection via a 007 * PR2Adapter object. 008 * 009 * @author Bob Jacobsen Copyright (C) 2001, 2003, 2008, 2010 010 */ 011public class ConnectionConfig extends jmri.jmrix.AbstractSerialConnectionConfig { 012 013 /** 014 * Ctor for an object being created during load process; Swing init is 015 * deferred. 016 * 017 * @param p Serial port adapter for the connection 018 */ 019 public ConnectionConfig(jmri.jmrix.SerialPortAdapter 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 /** 032 * Get the connection type name. 033 * 034 * @return Connection type name 035 */ 036 @Override 037 public String name() { 038 return "LocoNet PR3"; // NOI18N 039 } 040 041 /** 042 * Is Option List 2 Advanced? 043 * @return boolean, always false 044 */ 045 public boolean isOptList2Advanced() { 046 return false; 047 } 048 049 @Override 050 protected String[] getPortFriendlyNames() { 051 if (SystemType.isWindows()) { 052 return new String[]{"Communications Port"}; // NOI18N 053 } 054 return new String[]{}; 055 } 056 057 /** 058 * {@inheritDoc} 059 */ 060 @Override 061 protected void setInstance() { 062 if (adapter == null) { 063 adapter = new PR3Adapter(); 064 } 065 } 066 067}