001package jmri.jmrit.operations.trains; 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.tools.ShowCarsInTrainAction; 011import jmri.jmrit.operations.trains.tools.ToggleShowFullLocationName; 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 ToggleShowFullLocationName()); 039 menuBar.add(toolMenu); 040 } 041 setJMenuBar(menuBar); 042 addHelpMenu("package.jmri.jmrit.operations.Operations_TrainConductor", true); // NOI18N 043 044 initMinimumSize(new Dimension(Control.panelWidth500, Control.panelHeight500)); 045 } 046}