001package apps.PanelPro;
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 PanelPro start window.
010 *
011 * @author Bob Jacobsen (C) 2014
012 */
013public class PanelProAction extends JmriAbstractAction {
014
015    public PanelProAction(String s, WindowInterface wi) {
016        super(s, wi);
017    }
018
019    public PanelProAction(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 PanelProAction(String s) {
029        super(s);
030    }
031
032    public PanelProAction() {
033        this("PanelPro");
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 PanelProPane(), "PanelPro");
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
057}