001package jmri.jmrix.sprog.packetgen;
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 SprogPacketGenFrame object
011 *
012 * @author Bob Jacobsen Copyright (C) 2001
013 */
014public class SprogPacketGenAction extends AbstractAction {
015
016    private SprogSystemConnectionMemo _memo;
017
018    public SprogPacketGenAction(String s,SprogSystemConnectionMemo memo) {
019        super(s);
020        _memo = memo;
021    }
022
023    @Override
024    public void actionPerformed(ActionEvent e) {
025        SprogPacketGenFrame f = new SprogPacketGenFrame(_memo);
026        try {
027            f.initComponents();
028        } catch (Exception ex) {
029            log.error("Exception: {}", ex.toString());
030        }
031        f.setVisible(true);
032    }
033    private final static Logger log = LoggerFactory.getLogger(SprogPacketGenAction.class);
034}
035
036
037