001package jmri.jmrix.cmri.serial.cmrinetmanager;
002
003import java.awt.event.ActionEvent;
004import javax.swing.AbstractAction;
005import jmri.jmrix.cmri.CMRISystemConnectionMemo;
006import org.slf4j.Logger;
007import org.slf4j.LoggerFactory;
008
009/**
010 * Swing action to create and register a CMRInetManagerAction object
011 *
012 * @author Chuck Catania Copyright (C) 2014, 2015, 2016, 2017
013 */
014public class CMRInetManagerAction extends AbstractAction {
015
016    CMRISystemConnectionMemo _memo = null;
017
018    public CMRInetManagerAction(String s, CMRISystemConnectionMemo memo) {
019        super(s);
020        _memo = memo;
021    }
022
023    public CMRInetManagerAction(CMRISystemConnectionMemo memo) {
024        this("WindowTitle", memo);
025    }
026
027    @Override
028    public void actionPerformed(ActionEvent e) {
029        CMRInetManagerFrame f = new CMRInetManagerFrame(_memo);
030        try {
031            f.initComponents();
032        } catch (Exception ex) {
033            log.error("CMRInetManagerAction-C2: {}", ex.toString());
034        }
035        f.setLocation(20, 40);
036        f.setVisible(true);
037    }
038    private final static Logger log = LoggerFactory.getLogger(CMRInetManagerAction.class);
039}