001package jmri.jmrit.entryexit;
002
003import javax.swing.BoxLayout;
004import javax.swing.JButton;
005import javax.swing.JMenu;
006import javax.swing.JMenuBar;
007import javax.swing.JMenuItem;
008import jmri.jmrit.display.layoutEditor.LayoutEditor;
009
010/**
011 * Create frame for an Add Entry Exit.
012 *
013 * @author Kevin Dickerson Copyright (C) 2011
014 */
015public class AddEntryExitPairFrame extends jmri.util.JmriJFrame {
016
017    public AddEntryExitPairFrame() {
018        super(true, true);
019    }
020
021    JButton sendButton;
022    AddEntryExitPairPanel nxPanel;
023
024    /**
025     * Create and set an AddEntryExitPairFrame on a given LE panel and add menuItems.
026     *
027     * @param panel the LE panel on which to create the NX frame
028     */
029    public void initComponents(LayoutEditor panel) {
030        // the following code sets the frame's initial state
031
032        nxPanel = new AddEntryExitPairPanel(panel);
033
034        setTitle(Bundle.getMessage("AddEntryExitPoints"));  // NOI18N
035        getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
036
037        getContentPane().add(nxPanel);
038
039        JMenuBar menuBar = new JMenuBar();
040        JMenu optMenu = new JMenu(Bundle.getMessage("MenuOptions"));  // NOI18N
041        JMenuItem optItem = new JMenuItem(Bundle.getMessage("MenuOptions"));  // NOI18N
042        optMenu.add(optItem);
043        menuBar.add(optMenu);
044
045        optItem.addActionListener(nxPanel::optionWindow);
046
047        setJMenuBar(menuBar);
048        addHelpMenu("package.jmri.jmrit.entryexit.EntryExitFrame", true);  // NOI18N
049        // pack for display
050        pack();
051    }
052}