001package jmri.jmrix.rps.reversealign;
002
003import java.awt.event.ActionEvent;
004import javax.swing.AbstractAction;
005import javax.swing.BoxLayout;
006import jmri.jmrix.rps.RpsSystemConnectionMemo;
007
008/**
009 * Swing action to create and register an RpsTrackingFrame object.
010 *
011 * @author Bob Jacobsen Copyright (C) 2006
012 */
013public class AlignmentPanelAction extends AbstractAction {
014
015    RpsSystemConnectionMemo memo = null;
016
017    public AlignmentPanelAction(String s, RpsSystemConnectionMemo _memo) {
018        super(s);
019        memo = _memo;
020    }
021
022    public AlignmentPanelAction(RpsSystemConnectionMemo _memo) {
023        this("RPS Alignment Tool", _memo);
024    }
025
026    @Override
027    public void actionPerformed(ActionEvent e) {
028        jmri.util.JmriJFrame f = new jmri.util.JmriJFrame("RPS Alignment");
029
030        f.getContentPane().setLayout(new BoxLayout(f.getContentPane(), BoxLayout.Y_AXIS));
031
032        f.addHelpMenu("package.jmri.jmrix.rps.reversealign.AlignmentPanel", true);
033
034        panel = new AlignmentPanel(memo);
035        panel.initComponents();
036        f.getContentPane().add(panel);
037        f.pack();
038        f.setVisible(true);
039    }
040
041    AlignmentPanel panel;
042
043}