001package jmri.jmrix.powerline.serialdriver; 002 003import javax.swing.JPanel; 004 005/** 006 * Definition of objects to handle configuring a Powerline layout connection. 007 * 008 * @author Bob Jacobsen Copyright (C) 2003, 2006, 2007, 2008 009 */ 010public class ConnectionConfig extends jmri.jmrix.AbstractSerialConnectionConfig { 011 012 /** 013 * Ctor for an object being created during load process; Swing init is 014 * deferred. 015 * @param p port adapter for connection 016 */ 017 public ConnectionConfig(jmri.jmrix.SerialPortAdapter p) { 018 super(p); 019 } 020 021 /** 022 * Ctor for a connection configuration with no preexisting adapter. 023 * {@link #setInstance()} will fill the adapter member. 024 */ 025 public ConnectionConfig() { 026 super(); 027 } 028 029 /** 030 * {@inheritDoc} 031 */ 032 @Override 033 public void loadDetails(JPanel details) { 034 super.loadDetails(details); 035 036 // add another button 037 //JButton b = new JButton("Configure nodes"); 038 //details.add(b); 039 //b.addActionListener(new NodeConfigAction()); 040 } 041 042 @Override 043 public String name() { 044 return Bundle.getMessage("PlDeviceConnectionTitle"); 045 } 046 047 public boolean isOptList1Advanced() { 048 return false; 049 } 050 051 /** 052 * {@inheritDoc} 053 */ 054 @Override 055 protected void setInstance() { 056 if (adapter == null) { 057 adapter = new SerialDriverAdapter(); 058 } 059 } 060 061}