001package jmri.jmrix.loconet.loconetovertcp; 002 003import java.awt.GraphicsEnvironment; 004import java.awt.event.ActionEvent; 005import javax.swing.AbstractAction; 006 007/** 008 * Implementation of the LocoNet over TCP Server Protocol. 009 * 010 * @author Alex Shepherd Copyright (C) 2006 011 */ 012public class LnTcpServerAction 013 extends AbstractAction { 014 015 public LnTcpServerAction(String s) { 016 super(s); 017 } 018 019 public LnTcpServerAction() { 020 this(Bundle.getMessage("ServerAction")); 021 } 022 023 @Override 024 public void actionPerformed(ActionEvent e) { 025 LnTcpServer.getDefault().enable(); 026 if (!GraphicsEnvironment.isHeadless()) { 027 LnTcpServerFrame.getDefault().setVisible(true); 028 } 029 } 030}