001package jmri.jmrix.sprog.sprogmon;
002
003import java.awt.event.ActionEvent;
004import javax.swing.AbstractAction;
005import jmri.jmrix.sprog.SprogSystemConnectionMemo;
006import org.slf4j.Logger;
007import org.slf4j.LoggerFactory;
008
009/**
010 * Swing action to create and register a SprogMonFrame object
011 *
012 * @author Bob Jacobsen Copyright (C) 2001
013 */
014public class SprogMonAction extends AbstractAction {
015
016    private SprogSystemConnectionMemo _memo = null;
017
018    public SprogMonAction(String s, SprogSystemConnectionMemo memo) {
019        super(s);
020        _memo = memo;
021    }
022
023    @Override
024    public void actionPerformed(ActionEvent e) {
025        // create a SprogMonFrame
026        SprogMonFrame f = new SprogMonFrame(_memo);
027        try {
028            f.initComponents();
029        } catch (Exception ex) {
030            log.warn("SprogMonAction starting SprogMonFrame: Exception: {}", ex.toString());
031        }
032        f.setVisible(true);
033    }
034
035    private final static Logger log = LoggerFactory.getLogger(SprogMonAction.class);
036
037}