001package jmri.jmrit.beantable;
002
003import java.awt.BorderLayout;
004
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    private final 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 BorderLayout());
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, BorderLayout.CENTER);
052        getContentPane().add(bottomBox, BorderLayout.SOUTH);
053
054        // add extras, if desired by subclass
055        extras();
056
057    }
058
059    @Override
060    public void dispose() {
061        if (audioPanel != null) {
062            audioPanel.dispose();
063        }
064        super.dispose();
065    }
066
067}