001package jmri.jmrix.qsi.qsimon;
002
003import java.awt.event.ActionEvent;
004import jmri.InstanceManager;
005import jmri.jmrix.qsi.QsiSystemConnectionMemo;
006import jmri.jmrix.qsi.swing.QsiSystemConnectionAction;
007
008/**
009 * Swing action to create and register a QsiMonFrame object.
010 *
011 * @author Bob Jacobsen Copyright (C) 2007
012 */
013public class QsiMonAction extends QsiSystemConnectionAction {
014
015    public QsiMonAction(String s, QsiSystemConnectionMemo memo) {
016        super(s, memo);
017    }
018
019    public QsiMonAction(QsiSystemConnectionMemo memo) {
020        this(Bundle.getMessage("MonitorXTitle", "QSI"), memo);
021    }
022
023    public QsiMonAction() {
024        this(InstanceManager.getDefault(QsiSystemConnectionMemo.class));
025    }
026
027    @Override
028    public void actionPerformed(ActionEvent e) {
029        QsiSystemConnectionMemo memo = getSystemConnectionMemo();
030        if (memo != null) {
031            // create a QsiMonFrame
032            QsiMonFrame f = new QsiMonFrame(memo);
033            f.initComponents();
034            f.setVisible(true);
035        }
036    }
037
038    // private final static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(QsiMonAction.class);
039
040}