001package jmri.jmrix.dccpp.dccppovertcp; 002 003import java.awt.event.ActionEvent; 004import javax.swing.AbstractAction; 005import jmri.InstanceManager; 006 007/** 008 * Implementation of the DCCppOverTcp LbServer Server Protocol. 009 * 010 * @author Alex Shepherd Copyright (C) 2006 011 * @author Mark Underwood Copyright (C) 2015 012 */ 013public class ServerAction 014 extends AbstractAction { 015 016 public ServerAction(String s) { 017 super(s); 018 // Get a server instance to cause the config to be read and the server 019 // started if necessary 020 InstanceManager.getDefault(Server.class); 021 } 022 023 public ServerAction() { 024 this("DCC++OverTcp Server"); 025 } 026 027 @Override 028 public void actionPerformed(ActionEvent e) { 029 ServerFrame f = InstanceManager.getDefault(ServerFrame.class); 030 f.setVisible(true); 031 } 032 033}