001package apps.PanelPro;
002
003import apps.Apps;
004
005import java.awt.event.ActionEvent;
006import java.awt.Component;
007
008import javax.swing.AbstractAction;
009import javax.swing.Action;
010import javax.swing.BoxLayout;
011import javax.swing.JButton;
012import javax.swing.JPanel;
013
014/**
015 * The JMRI main pane for creating control panels.
016 *
017 * <hr>
018 * This file is part of JMRI.
019 * <p>
020 * JMRI is free software; you can redistribute it and/or modify it under the
021 * terms of version 2 of the GNU General Public License as published by the Free
022 * Software Foundation. See the "COPYING" file for a copy of this license.
023 * <p>
024 * JMRI is distributed in the hope that it will be useful, but WITHOUT ANY
025 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
026 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
027 *
028 * @author Bob Jacobsen Copyright 2003, 2014
029 */
030public class PanelProPane extends apps.AppsLaunchPane {
031
032    PanelProPane() {
033        super();
034    }
035
036    /**
037     * Returns the ID for the window's help, which is application specific
038     */
039    @Override
040    protected String windowHelpID() {
041        return "package.apps.PanelPro.PanelPro";
042    }
043
044    @Override
045    protected String logo() {
046        return "resources/PanelPro.gif";
047    }
048
049    @Override
050    protected String line1() {
051        return Bundle.getMessage("PanelProVersionCredit", jmri.Version.name());
052    }
053
054    @Override
055    protected String line2() {
056        return "https://jmri.org/PanelPro";
057    }
058
059    @Override
060    protected JPanel statusPanel() {
061        JPanel j = new JPanel();
062        j.setLayout(new BoxLayout(j, BoxLayout.Y_AXIS));
063        j.add(super.statusPanel());
064
065        // Buttons
066        Action quit = new AbstractAction(Bundle.getMessage("MenuItemQuit")) {
067            @Override
068            public void actionPerformed(ActionEvent e) {
069                Apps.handleQuit();
070            }
071        };
072
073        JPanel p3 = new JPanel();
074        p3.setLayout(new java.awt.FlowLayout());
075        JButton h1 = new JButton(Bundle.getMessage("ButtonHelp"));
076        jmri.util.HelpUtil.addHelpToComponent(h1, "html.apps.PanelPro.index");
077        h1.setAlignmentX(Component.CENTER_ALIGNMENT);
078        p3.add(h1);
079        JButton q1 = new JButton(Bundle.getMessage("ButtonQuit"));
080        q1.addActionListener(quit);
081        q1.setAlignmentX(Component.CENTER_ALIGNMENT);
082        p3.add(q1);
083        j.add(p3);
084
085        return j;
086    }
087
088}