001package apps.DecoderPro;
002
003import java.awt.event.ActionEvent;
004import javax.swing.Icon;
005import jmri.util.swing.JmriAbstractAction;
006import jmri.util.swing.WindowInterface;
007
008/**
009 * Create a new DecoderPro start window.
010 *
011 * @author Bob Jacobsen (C) 2014
012 */
013public class DecoderProAction extends JmriAbstractAction {
014
015    public DecoderProAction(String s, WindowInterface wi) {
016        super(s, wi);
017    }
018
019    public DecoderProAction(String s, Icon i, WindowInterface wi) {
020        super(s, i, wi);
021    }
022
023    /**
024     * Constructor
025     *
026     * @param s Name for the action.
027     */
028    public DecoderProAction(String s) {
029        super(s);
030    }
031
032    public DecoderProAction() {
033        this("DecoderPro");
034    }
035
036    apps.AppsLaunchFrame frame = null;
037
038    /**
039     * The action is performed. Create a new ThrottleFrame.
040     *
041     * @param e The event causing the action.
042     */
043    @Override
044    public void actionPerformed(ActionEvent e) {
045        if (frame == null) {
046            frame = new apps.AppsLaunchFrame(new DecoderProPane(), "DecoderPro");
047        }
048        frame.setVisible(true);
049    }
050
051    // never invoked, because we overrode actionPerformed above
052    @Override
053    public jmri.util.swing.JmriPanel makePanel() {
054        throw new IllegalArgumentException("Should not be invoked");
055    }
056}