001package jmri.jmrit.operations.trains.gui;
002
003import java.awt.Dimension;
004
005import javax.swing.JMenu;
006import javax.swing.JMenuBar;
007
008import jmri.jmrit.operations.OperationsFrame;
009import jmri.jmrit.operations.setup.Control;
010import jmri.jmrit.operations.trains.Train;
011import jmri.jmrit.operations.trains.tools.*;
012
013/**
014 * Conductor Frame. Shows work for a train one location at a time.
015 *
016 * @author Dan Boudreau Copyright (C) 2011, 2013
017 * 
018 */
019public class TrainConductorFrame extends OperationsFrame {
020
021    public TrainConductorFrame(Train train) {
022        super(new TrainConductorPanel(train));
023        this.initComponents(train);
024    }
025
026    private void initComponents(Train train) {
027        super.initComponents();
028
029        if (train != null) {
030            setTitle(Bundle.getMessage("TitleTrainConductor") + " (" + train.getName() + ")");
031        }
032
033        // build menu
034        JMenuBar menuBar = new JMenuBar();
035        if (train != null) {
036            JMenu toolMenu = new JMenu(Bundle.getMessage("MenuTools"));
037            toolMenu.add(new ShowCarsInTrainAction(train));
038            toolMenu.add(new PrintShowCarsInTrainRouteAction(false, train));
039            toolMenu.add(new PrintShowCarsInTrainRouteAction(true, train));
040            toolMenu.add(new ToggleShowFullLocationName());
041            menuBar.add(toolMenu);
042        }
043        setJMenuBar(menuBar);
044        addHelpMenu("package.jmri.jmrit.operations.Operations_TrainConductor", true); // NOI18N
045
046        initMinimumSize(new Dimension(Control.panelWidth500, Control.panelHeight500));
047    }
048}