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