001package jmri.jmrit.beantable;
002
003import javax.swing.Box;
004import javax.swing.BoxLayout;
005import javax.swing.JMenu;
006import javax.swing.JMenuBar;
007
008import jmri.Audio;
009
010/**
011 *
012 * <hr>
013 * This file is part of JMRI.
014 * <p>
015 * JMRI is free software; you can redistribute it and/or modify it under the
016 * terms of version 2 of the GNU General Public License as published by the Free
017 * Software Foundation. See the "COPYING" file for a copy of this license.
018 * <p>
019 * JMRI is distributed in the hope that it will be useful, but WITHOUT ANY
020 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
021 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
022 *
023 * @author Bob Jacobsen Copyright (C) 2003
024 * @author Matthew Harris copyright (c) 2009
025 */
026public class AudioTableFrame extends BeanTableFrame<Audio> {
027
028    AudioTablePanel audioPanel;
029
030    public AudioTableFrame(AudioTablePanel panel, String helpTarget) {
031
032        super();
033
034        audioPanel = panel;
035
036        // general GUI config
037        getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
038
039        // add save menu item
040        JMenuBar menuBar = new JMenuBar();
041        JMenu fileMenu = new JMenu(Bundle.getMessage("MenuFile"));
042        menuBar.add(fileMenu);
043        fileMenu.add(new jmri.configurexml.StoreMenu());
044        fileMenu.add(panel.getPrintItem());
045
046        setJMenuBar(menuBar);
047
048        addHelpMenu(helpTarget, true);
049
050        // install items in GUI
051        getContentPane().add(audioPanel);
052        bottomBox = Box.createHorizontalBox();
053        bottomBox.add(Box.createHorizontalGlue()); // stays at end of box
054        bottomBoxIndex = 0;
055
056        getContentPane().add(bottomBox);
057
058        // add extras, if desired by subclass
059        extras();
060
061    }
062
063    @Override
064    public void dispose() {
065        if (audioPanel != null) {
066            audioPanel.dispose();
067        }
068        super.dispose();
069    }
070
071}