001package jmri.jmrix.powerline.simulator;
002
003import javax.swing.JPanel;
004
005/**
006 * Definition of objects to handle configuring a layout connection via a
007 * Powerline Simulator object.
008 *
009 * @author Ken Cameron Copyright (C) 2011 based on NceSimulator by Bob Jacobson
010 */
011public class ConnectionConfig extends jmri.jmrix.AbstractSimulatorConnectionConfig {
012
013    public final static String NAME = Bundle.getMessage("PlSimulatorName");
014
015    /**
016     * Ctor for an object being created during load process; Swing init is
017     * deferred.
018     * @param p port adapter for simulator
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    public void loadDetails(JPanel details) {
041        super.loadDetails(details);
042    }
043
044    /**
045     * {@inheritDoc}
046     */
047    @Override
048    protected void setInstance() {
049        if (adapter == null) {
050            adapter = new SimulatorAdapter();
051        }
052    }
053
054}