001package apps.gui3.paned;
002
003import java.awt.event.ActionEvent;
004import javax.swing.Icon;
005import jmri.util.swing.JmriPanel;
006import jmri.util.swing.WindowInterface;
007
008/**
009 * Action to produce a new, standalone PanelPro window.
010 *
011 * Ignores WindowInterface.
012 *
013 * @author Bob Jacobsen Copyright (C) 2010
014 */
015public class PanelProAction extends jmri.util.swing.JmriAbstractAction {
016
017    /**
018     * Enhanced constructor for placing the pane in various GUIs
019     * @param s Name of the action
020     * @param wi The window this action is associated with
021     */
022    public PanelProAction(String s, WindowInterface wi) {
023        super(s, wi);
024    }
025
026    public PanelProAction(String s, Icon i, WindowInterface wi) {
027        super(s, i, wi);
028    }
029
030    @Override
031    public void actionPerformed(ActionEvent e) {
032        jmri.util.swing.multipane.MultiPaneWindow mainFrame
033                = new PanelProFrame("PanelPro");
034        mainFrame.setSize(mainFrame.getMaximumSize());
035        mainFrame.setVisible(true);
036    }
037
038    // never invoked, because we overrode actionPerformed above
039    @Override
040    public void dispose() {
041        throw new IllegalArgumentException("Should not be invoked");
042    }
043
044    // never invoked, because we overrode actionPerformed above
045    @Override
046    public JmriPanel makePanel() {
047        throw new IllegalArgumentException("Should not be invoked");
048    }
049
050}