/*public*/ void AddEntryExitPairFrame::initComponents(LayoutEditor* panel) //throws Exception
{
 // the following code sets the frame's initial state

 nxPanel = new AddEntryExitPairPanel(panel);

 setTitle("Add Entry Exit Points");
 //getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
 QWidget* centralWidget = new QWidget;
 QVBoxLayout* centralWidgetLayout = new QVBoxLayout(centralWidget);
 setCentralWidget(centralWidget);

centralWidgetLayout->addWidget(nxPanel);

 QMenuBar* menuBar = new QMenuBar();//getJMenuBar();
 QAction* options = new QAction(tr("Options"), this);
 menuBar->addAction(options);
// options.addActionListener(new ActionListener() {
//     /*public*/ void actionPerformed(ActionEvent event) {
//         nxPanel.optionWindow(event);
//     }
// });
 connect(options, SIGNAL(triggered()), this, SLOT(on_options()));

 setMenuBar(menuBar);
 addHelpMenu("package.jmri.jmrit.signalling.EntryExitFrame", true);
 // pack for display
 adjustSize();
}
 //@Override
 /*public*/ void EditManifestHeaderTextFrame::initComponents() {
     OperationsFrame::initComponents();

     // build menu
     addHelpMenu("package.jmri.jmrit.operations.Operations_ManifestPrintOptionsTools", true); // NOI18N

     initMinimumSize();
 }
Beispiel #3
0
 //@Override
 /*public*/ void OptionFrame::initComponents() {
     OperationsFrame::initComponents();

     // build menu
     addHelpMenu("package.jmri.jmrit.operations.Operations_SettingsOptions", true); // NOI18N

     initMinimumSize();
 }
Beispiel #4
0
APP_NAMESPACE_START

MenuBar::MenuBar(QWidget *p)
    : QMenuBar(p)
{
    addFileMenu();
    addEditMenu();
    addProjectMenu();
    addHelpMenu();
}
Beispiel #5
0
AS_NAMESPACE_START

MenuBar::MenuBar(QWidget *p)
    : QMenuBar(p)
{
    addFileMenu();
    addEditMenu();
    addProjectMenu();
    addHelpMenu();
    _connections << connect(this, SIGNAL(projectOpen(QString)), p, SLOT(onMenuBarProjectOpen(QString)));
}
 /*public*/ RouteCopyFrame::RouteCopyFrame(QWidget* parent) : OperationsFrame(tr("Copy Route"),parent) {
     //super(tr("TitleRouteCopy"));
 log = new Logger("RouteCopyFrame");
 routeManager = RouteManager::instance();

  // labels
  textCopyRoute = new QLabel(tr("Copy Route"));
  textRouteName = new QLabel(tr("Route Name"));

  // text field
  routeNameTextField = new JTextField(Control::max_len_string_route_name);

  // check boxes
  invertCheckBox = new QCheckBox(tr("Invert"));

  // major buttons
  copyButton = new QPushButton(tr("Copy"));

  // combo boxes
  routeBox = RouteManager::instance()->getComboBox();
  // general GUI config

  //getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
  QVBoxLayout* thisLayout = new QVBoxLayout(getContentPane());

  // Set up the panels
  QWidget* p1 = new QWidget();
  p1->setLayout(new GridBagLayout());

  // Layout the panel by rows
  // row 1 textRouteName
  addItem(p1, textRouteName, 0, 1);
  addItemWidth(p1, routeNameTextField, 3, 1, 1);

  // row 2
  addItem(p1, textCopyRoute, 0, 2);
  addItemWidth(p1, routeBox, 3, 1, 2);

  // row 4
  addItem(p1, invertCheckBox, 0, 4);
  addItem(p1, copyButton, 1, 4);

  thisLayout->addWidget(p1);

  // add help menu to window
  addHelpMenu("package.jmri.jmrit.operations.Operations_CopyRoute", true); // NOI18N

  initMinimumSize(QSize(Control::panelWidth600, Control::panelHeight200));

  // setup buttons
  addButtonAction(copyButton);
 }
void MainWindow::createMenus()
{
  QMenu   *menu;
  QAction *action;

  menu = menuBar()->addMenu(_("&File"));

  //menu->addAction(_("Update"), this, SLOT(updateAll()));
  m_action_start = menu->addAction(_("&Start"));
  connect(m_action_start, SIGNAL(triggered()),
          this,           SLOT(startThreads()));
  m_action_stop = menu->addAction(_("Stop"));
  menu->addSeparator();
  menu->addAction(standardAction(Exit));

  addHelpMenu();
}
/*public*/ void SignallingFrame::initComponents(SignalMast* source, SignalMast* dest) throw (Exception)
{
    // the following code sets the frame's initial state
    sigPanel = new SignallingPanel(source, dest, (QFrame*)this);

    setWindowTitle(tr("Signalling Pairs"));
    QWidget* centralWidget = new QWidget();
    centralWidget->setLayout(new QVBoxLayout());
    setCentralWidget(centralWidget);
    //getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));

    centralWidget->layout()->addWidget(sigPanel);

    addHelpMenu("package.jmri.jmrit.signalling.AddEditSignallingLogic", true);

    resize(600, 800);
    // pack for display
    pack();
}
/*public*/ PowerPanelFrame::PowerPanelFrame(QWidget *parent) : JmriJFrame(tr("Power Panel"), parent)
{
    //super(ResourceBundle.getBundle("jmri.jmrit.powerpanel.PowerPanelBundle").getString("TitlePowerPanel"));
 pane	= new PowerPane();
    // general GUI config

 // install items in GUI
 //getContentPane()->layout()->addWidget(pane);
 setCentralWidget(pane);

 // add help menu to window
 addHelpMenu("package.jmri.jmrit.powerpanel.PowerPanelFrame", true);
 setTitle(pane->getTitle());
 setMaximumSize(300, 50);

 adjustSize();
 pane->setVisible(true);
 //QTimer::singleShot(50, this, SLOT(pack()));
}
 /*public*/ SetTrainIconRouteFrame::SetTrainIconRouteFrame(QString routeName, QWidget* parent)
 : OperationsFrame(tr("Train Icon"),parent)
 {
  //super(tr("MenuSetTrainIcon"));
  log = new Logger("SetTrainIconRouteFrame");
  value = QMessageBox::No; //JOptionPane.NO_OPTION;
  FORWARD = 1;
  BACK = -1;
  NONE = 0;

  routeManager = RouteManager::instance();

  // labels
  textX = new JLabel("   X  ");
  textY = new JLabel("   Y  ");

  routeLocationName = new JLabel();

  // text field
  // check boxes
  // major buttons
  previousButton = new QPushButton(tr("Previous"));
  nextButton = new QPushButton(tr("Next"));
  placeButton = new QPushButton(tr("Place Test Icon"));
  applyButton = new QPushButton(tr("Apply"));
  saveButton = new QPushButton(tr("Save"));

  // combo boxes
  // Spinners
  spinTrainIconX = new QSpinBox(); //(new SpinnerNumberModel(0, 0, 10000, 1));
  spinTrainIconX->setMinimum(0);
  spinTrainIconX->setMaximum(10000);
  spinTrainIconX->setValue(0);
  spinTrainIconX->setSingleStep(1);
  spinTrainIconY = new QSpinBox(); //(new SpinnerNumberModel(0, 0, 10000, 1));
  spinTrainIconY->setMinimum(0);
  spinTrainIconY->setMaximum(10000);
  spinTrainIconY->setValue(0);
  spinTrainIconY->setSingleStep(1);

  _routeIndex = 0;
  _tIon = NULL;

  // create route
  if (routeName == NULL) {
      return;
  }
  _route = RouteManager::instance()->getRouteByName(routeName);
  //_route.addPropertyChangeListener(this);
  connect(_route->pcs, SIGNAL(propertyChange(PropertyChangeEvent*)), this, SLOT(propertyChange(PropertyChangeEvent*)));

  // general GUI config
  //getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
  getContentPane()->setLayout(new QVBoxLayout);

  // set tool tips
  placeButton->setToolTip(tr("Places a set of train icons on panel") + " " + Setup::getPanelName());
  applyButton->setToolTip(tr("Update route with the new coordinates"));
  saveButton->setToolTip(tr("Saves the train icon coordinates for the selected location"));

  // Set up the panels
  QGroupBox* pRoute = new QGroupBox();
//  pRoute.setBorder(BorderFactory
//          .createTitledBorder(tr("Route") + " " + _route.getName()));
  pRoute->setStyleSheet(gbStyleSheet);
  pRoute->setTitle(tr("Route"));
  pRoute->setLayout(new GridBagLayout());
  addItem(pRoute, previousButton, 0, 0);
  addItem(pRoute, routeLocationName, 1, 0);
  addItem(pRoute, nextButton, 2, 0);

  QGroupBox* pSpin = new QGroupBox();
  pSpin->setLayout(new GridBagLayout());
  //pSpin.setBorder(BorderFactory.createTitledBorder(tr("TrainIcon")));
  pSpin->setStyleSheet(gbStyleSheet);
  pSpin->setTitle(tr("Train Icon"));
  addItem(pSpin, textX, 0, 0);
  addItem(pSpin, spinTrainIconX, 1, 0);
  addItem(pSpin, textY, 2, 0);
  addItem(pSpin, spinTrainIconY, 3, 0);

  QGroupBox* pControl = new QGroupBox();
  pControl->setLayout(new GridBagLayout());
  //pControl.setBorder(BorderFactory.createTitledBorder(""));
  pControl->setStyleSheet(gbStyleSheet);
  pControl->setTitle(tr("Route"));
  addItem(pControl, placeButton, 0, 0);
  addItem(pControl, applyButton, 1, 0);
  addItem(pControl, saveButton, 2, 0);

  getContentPane()->layout()->addWidget(pRoute);
  getContentPane()->layout()->addWidget(pSpin);
  getContentPane()->layout()->addWidget(pControl);

  // add help menu to window
  addHelpMenu("package.jmri.jmrit.operations.Operations_SetTrainIconCoordinates", true); // NOI18N

  // setup buttons
  addButtonAction(previousButton);
  addButtonAction(nextButton);
  addButtonAction(placeButton);
  addButtonAction(applyButton);
  addButtonAction(saveButton);

  // start off with save button disabled
  saveButton->setEnabled(false);

  updateRoute();

  // setup spinners
  addSpinnerChangeListerner(spinTrainIconX);
  addSpinnerChangeListerner(spinTrainIconY);

  initMinimumSize(QSize(Control::panelWidth400, Control::panelHeight400));

 }
AddEditLightDialog::AddEditLightDialog(AbstractLight* light, QWidget *parent) :
    JmriJFrame(parent),
    ui(new Ui::AddEditLightDialog1)
{
 ui->setupUi(this);
 addHelpMenu("package.jmri.jmrit.beantable.LightAddEdit", true);
 curLight = light;
 log = new Logger("AddEditLightDialog");
 sensorControl = tr("Sensor Control");
 fastClockControl = tr("Fast Clock Control");
 turnoutStatusControl = tr("Turnout Status Control");
 timedOnControl = tr("Timed On Control");
 twoSensorControl = tr("Two Sensor Control");
 noControl = tr("No Control");
 mgr = (ProxyLightManager*)InstanceManager::lightManagerInstance();
 noWarn = false;
 lightCreatedOrUpdated = false;

 if(light == NULL)
 {
  inEditMode = false;
  setWindowTitle(tr("Add Light"));
  ui->btnUpdate->setVisible(false);
  QList<Manager*> mgrList = mgr->getManagerList();
  for(int i=0; i < mgrList.count(); i++)
  {
   if(((AbstractManager*)mgrList.at(i))->getSystemPrefix() == "I")
    continue;
   if(((AbstractManager*)mgrList.at(i))->getSystemPrefix() == "L")
    ui->prefixBox->addItem("LocoNet");
  }
  controlList = new QList<LightControl*>();
 }
 else
 {
  setWindowTitle("Edit Light");
  setLight(light);
  inEditMode = true;
  }

 lightControlTableModel = new AELLightControlTableModel(this);
 ui->tableView->setModel(lightControlTableModel);
 ui->tableView->resizeColumnsToContents();
 ui->tableView->setItemDelegateForColumn(AELLightControlTableModel::EDIT_COLUMN, new PushButtonDelegate(this));
 ui->tableView->setItemDelegateForColumn(AELLightControlTableModel::REMOVE_COLUMN, new PushButtonDelegate( this));

 lightControlChanged = false;
 inEditControlMode = false;
 addControlFrame = NULL;
 typeBoxLabel = new QLabel( tr("Control Type") );
 defaultControlIndex = 0;
 inEditControlMode = false;
 lc = NULL;
 field1a = new JTextField(10);  // Sensor
 field1a2 = new JTextField(10);  // Sensor 2
 field1b = new JTextField(8);  // Fast Clock
 field1c = new JTextField(10);  // Turnout
 field1d = new JTextField(10);  // Timed ON
 f1Label = new QLabel( tr("Sensor") );
 field2a = new JTextField(8);  // Fast Clock
 field2b = new JTextField(8); // Timed ON
 f2Label = new QLabel( tr("Sense for ON") );

}
 // major buttons
 // javax.swing.JButton addButton = new javax.swing.JButton();
 /*public*/ SchedulesTableFrame::SchedulesTableFrame(QWidget* parent)
     : OperationsFrame(tr("Schedules"), parent)
 {
     //super(tr("TitleSchedulesTable"));
  log = new Logger("SchedulesTableFrame");
  schedulesModel = new SchedulesTableModel();
  schedulesTable = new JTable(schedulesModel);
  schedulesTable->setObjectName("SchedulesTable");
 //JScrollPane schedulesPane;

 // labels
  textSort = new QLabel();
  textSep = new QLabel();

 // radio buttons
  sortByName = new QRadioButton(tr("Name"));
  sortById = new QRadioButton(tr("Id"));

  // general GUI config

  //getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
QVBoxLayout* thisLayout = new QVBoxLayout(getContentPane());
  // Set up the jtable in a Scroll Pane..
//        schedulesPane = new JScrollPane(schedulesTable);
//        schedulesPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
//        schedulesPane
//                .setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  schedulesModel->initTable(this, schedulesTable);
  thisLayout->addWidget(/*schedulesPane*/schedulesTable);

  // Set up the control panel
  QWidget* controlPanel = new QWidget();
  controlPanel->setLayout(new FlowLayout());

  textSort->setText(tr("SortBy"));
  controlPanel->layout()->addWidget(textSort);
  controlPanel->layout()->addWidget(sortByName);
  sortByName->setChecked(true);
  controlPanel->layout()->addWidget(sortById);
  textSep->setText("          ");
  controlPanel->layout()->addWidget(textSep);

  // TODO allow user to add schedule to a spur
  // addButton.setText(tr("Add"));
  // addButton.setVisible(true);
  // controlPanel.add (addButton);
  controlPanel->setMaximumSize(QSize(Control::panelWidth1025, 50));
  thisLayout->addWidget(controlPanel);

  // setup buttons
  // addButtonAction(addButton);
  addRadioButtonAction(sortByName);
  addRadioButtonAction(sortById);

  // build menu
  QMenuBar* menuBar = new QMenuBar();
  QMenu* toolMenu = new QMenu("Tools");
  toolMenu->addAction(new ScheduleCopyAction(this));
  toolMenu->addAction(new SchedulesByLoadAction(tr("Show Schedules By Load"),this));
  toolMenu->addAction(new SchedulesResetHitsAction(tr("Reset Hit Counts"),this));
  toolMenu->addAction(new PrintLocationsAction(tr("Print"), false,this));
  toolMenu->addAction(new PrintLocationsAction(tr("Preview"), true,this));

  menuBar->addMenu(toolMenu);
  setMenuBar(menuBar);
  addHelpMenu("package.jmri.jmrit.operations.Operations_LocationSchedules", true); // NOI18N

  initMinimumSize();
  // make panel a bit wider than minimum if the very first time opened
  if (width() == Control::panelWidth500)
  {
   resize(Control::panelWidth1025, height());
  }
  setLocation(10,20);

 }
 /*public*/ EnginesTableFrame::EnginesTableFrame(QWidget* parent) :
 OperationsFrame(tr("Engines Table"), parent)
 {
        //super(tr("Engines Table"));
        // general GUI config
 setObjectName("EnginesTableFrame");
 log = new Logger("EnginesTableFrame");
  engineManager = EngineManager::instance();
  // labels
  numEngines = new QLabel();
  textEngines = new QLabel();
  textSep1 = new QLabel("          ");
  f = NULL;
  setStatusBar(new QStatusBar());
  statusBar()->setSizeGripEnabled(true);

  // radio buttons
  sortByNumber = new QRadioButton(tr("Number"));
  sortByRoad = new QRadioButton(tr("Road"));
  sortByModel = new QRadioButton(tr("Model"));
  sortByConsist = new QRadioButton(tr("Consist"));
  sortByLocation = new QRadioButton(tr("Location"));
  sortByDestination = new QRadioButton(tr("Destination"));
  sortByTrain = new QRadioButton(tr("Train"));
  sortByMoves = new QRadioButton(tr("Moves"));
  sortByBuilt = new QRadioButton(tr("Built"));
  sortByOwner = new QRadioButton(tr("Owner"));
  sortByValue = new QRadioButton(Setup::getValueLabel());
  sortByRfid = new QRadioButton(Setup::getRfidLabel());
  sortByLast = new QRadioButton(tr("Last"));
  QButtonGroup* group = new QButtonGroup();

  // major buttons
  addButton = new QPushButton(tr("Add"));
  findButton = new QPushButton(tr("Find"));
  saveButton = new QPushButton(tr("Save"));

  findEngineTextBox = new JTextField(6);
  QVBoxLayout* thisLayout;
  log->debug(tr("getContentPane returned %1").arg(getContentPane()->objectName()));
  getContentPane()->setLayout(thisLayout = new QVBoxLayout); //(getContentPane(), BoxLayout.Y_AXIS));

  // Set up the jtable in a Scroll Pane..
  enginesModel = new EnginesTableModel();
  //sorter = new TableSorter(enginesModel);
  sorter = new QSortFilterProxyModel();
  sorter->setSourceModel(enginesModel);
  enginesTable = new JTable(sorter);
  //sorter.setTableHeader(enginesTable.getTableHeader());
//        enginesPane = new JScrollPane(enginesTable);
//        enginesPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
  enginesModel->initTable(enginesTable, this);

  // load the number of engines and listen for changes
  numEngines->setText(QString::number(engineManager->getNumEntries()));
  //engineManager.addPropertyChangeListener(this);
  connect(engineManager->pcs, SIGNAL(propertyChange(PropertyChangeEvent*)), this, SLOT(propertyChange(PropertyChangeEvent*)));
  textEngines->setText(tr("engines"));

  // Set up the control panel
  // row 1
  QGroupBox* cp1 = new QGroupBox();
  //cp1.setBorder(BorderFactory.createTitledBorder(tr("SortBy")));
  QString     gbStyleSheet = "QGroupBox { border: 2px solid gray; border-radius: 3px;} QGroupBox::title { /*background-color: transparent;*/  subcontrol-position: top left; /* position at the top left*/  padding:0 0px;} ";
  cp1->setStyleSheet(gbStyleSheet);
  FlowLayout * cp1Layout = new FlowLayout(cp1);
  cp1->setTitle(tr("Sort By"));
  cp1Layout->addWidget(sortByNumber);
  cp1Layout->addWidget(sortByRoad);
  cp1Layout->addWidget(sortByModel);
  cp1Layout->addWidget(sortByConsist);
  cp1Layout->addWidget(sortByLocation);
  cp1Layout->addWidget(sortByDestination);
  cp1Layout->addWidget(sortByTrain);
  QFrame* movep = new QFrame();
  //movep.setBorder(BorderFactory.createTitledBorder(""));
  FlowLayout * movepLayout = new FlowLayout(movep);
  movepLayout->addWidget(sortByMoves);
  movepLayout->addWidget(sortByBuilt);
  movepLayout->addWidget(sortByOwner);
  if (Setup::isValueEnabled()) {
      movepLayout->addWidget(sortByValue);
  }
  if (Setup::isRfidEnabled()) {
      movepLayout->addWidget(sortByRfid);
  }
  movepLayout->addWidget(sortByLast);
  cp1Layout->addWidget(movep);

  // row 2
  QWidget* cp2 = new QWidget();
  //cp2.setLayout(new BoxLayout(cp2, BoxLayout.X_AXIS));
  QHBoxLayout* cp2Layout = new QHBoxLayout(cp2);

  QFrame* cp2Add = new QFrame();
  //cp2Add.setBorder(BorderFactory.createTitledBorder(""));
  cp2Add->setFrameShape(QFrame::StyledPanel);
  cp2Add->setFrameShadow(QFrame::Raised);
  QHBoxLayout* cp2AddLayout = new QHBoxLayout(cp2Add);

  cp2AddLayout->addWidget(numEngines);
  cp2AddLayout->addWidget(textEngines);
  cp2AddLayout->addWidget(textSep1);
  cp2AddLayout->addWidget(addButton);
  cp2Layout->addWidget(cp2Add);

  QGroupBox* cp2Find = new QGroupBox();
  //cp2Find.setBorder(BorderFactory.createTitledBorder(""));
  cp2Find->setStyleSheet(gbStyleSheet);
  cp2Find->setTitle("");
  FlowLayout* cp2FindLayout = new FlowLayout(cp2Find);
  findButton->setToolTip(tr("Find locomotive by road number. Asterisk \"*\" = wild card."));
  findEngineTextBox->setToolTip(tr("Find locomotive by road number. Asterisk \"*\" = wild card."));
  cp2FindLayout->addWidget(findButton);
  cp2FindLayout->addWidget(findEngineTextBox);
  cp2Layout->addWidget(cp2Find);

  QWidget* cp2Save = new QWidget();
  //cp2Save.setBorder(BorderFactory.createTitledBorder(""));
  FlowLayout* cp2SaveLayout = new FlowLayout(cp2Save);
  cp2SaveLayout->addWidget(saveButton);
  cp2Layout->addWidget(cp2Save);

  // place controls in scroll pane
  QWidget* controlPanel = new QWidget();
  //controlPanel.setLayout(new BoxLayout(controlPanel, BoxLayout.Y_AXIS));
  QVBoxLayout* controlPanelLayout = new QVBoxLayout(controlPanel);
  controlPanelLayout->addWidget(cp1);
  controlPanelLayout->addWidget(cp2);

  // some tool tips
  sortByLast->setToolTip(tr("Last Moved"));

  QScrollArea* controlPane = new QScrollArea();
  controlPane->setWidget(controlPanel);
  controlPane->setWidgetResizable(true);

  thisLayout->addWidget(/*enginesPane*/enginesTable);
  thisLayout->addWidget(controlPane);

  // setup buttons
  addButtonAction(addButton);
  addButtonAction(findButton);
  addButtonAction(saveButton);

  sortByNumber->setChecked(true);

  addRadioButtonAction(sortByNumber);
  addRadioButtonAction(sortByRoad);
  addRadioButtonAction(sortByModel);
  addRadioButtonAction(sortByConsist);
  addRadioButtonAction(sortByLocation);
  addRadioButtonAction(sortByDestination);
  addRadioButtonAction(sortByTrain);
  addRadioButtonAction(sortByMoves);
  addRadioButtonAction(sortByBuilt);
  addRadioButtonAction(sortByOwner);
  addRadioButtonAction(sortByValue);
  addRadioButtonAction(sortByRfid);
  addRadioButtonAction(sortByLast);

  group->addButton(sortByNumber);
  group->addButton(sortByRoad);
  group->addButton(sortByModel);
  group->addButton(sortByConsist);
  group->addButton(sortByLocation);
  group->addButton(sortByDestination);
  group->addButton(sortByTrain);
  group->addButton(sortByMoves);
  group->addButton(sortByBuilt);
  group->addButton(sortByOwner);
  group->addButton(sortByValue);
  group->addButton(sortByRfid);
  group->addButton(sortByLast);

  // build menu
  QMenuBar* menuBar = new QMenuBar();
  QMenu* toolMenu = new QMenu(tr("Tools"));
  toolMenu->addMenu(new EngineRosterMenu(tr("Engine Roster"), EngineRosterMenu::MAINMENU, this));
//        toolMenu.add(new NceConsistEngineAction(tr("MenuItemNceSync"), this));
  menuBar->addMenu(toolMenu);
  menuBar->addMenu(new OperationsMenu());
  setMenuBar(menuBar);
  addHelpMenu("package.jmri.jmrit.operations.Operations_Locomotives", true); // NOI18N

  initMinimumSize();

  //addHorizontalScrollBarKludgeFix(controlPane, controlPanel);

  // create ShutDownTasks
  createShutDownTask();

 }
/*private*/ void ImageIndexEditor::init(Editor* /*editor*/) {
    QMenuBar* menuBar = new QMenuBar();
    QMenu* findIcon = new QMenu(tr("File"));
    menuBar->addMenu(findIcon);
    QAction* storeItem = new QAction(tr("Store Image Index"),this);
    findIcon->addAction(storeItem);
//    storeItem.addActionListener(new ActionListener() {
//            /*public*/ void actionPerformed(ActionEvent event) {
//                storeImageIndex();
//            }
//    });
    connect(storeItem, SIGNAL(triggered()), this, SLOT(storeImageIndex()));

    findIcon->addSeparator();
    QAction* openItem = new QAction(tr("Open a File System Directory"), this);
//    openItem.addActionListener(new ActionListener() {
//            /*public*/ void actionPerformed(ActionEvent e) {
//                DirectorySearcher.instance().openDirectory(false);
//            }
//        });
    findIcon->addAction(openItem);
    connect(openItem, SIGNAL(triggered()), this, SLOT(openItem_triggered()));
    QMenu* editMenu = new QMenu(tr("Edit"));
    menuBar->addMenu(editMenu);
    QAction* addItem = new QAction(tr("Add Node"),this);
//    addItem.addActionListener (new ActionListener () {
//            /*public*/ void actionPerformed(ActionEvent e) {
//                addNode();
//            }
//        });
    connect(addItem, SIGNAL(triggered()), this, SLOT(addNode()));
    editMenu->addAction(addItem);
    QAction* renameItem = new QAction(tr("Rename Node"), this);
//    renameItem.addActionListener (new ActionListener () {
//            /*public*/ void actionPerformed(ActionEvent e) {
//                renameNode();
//            }
//        });
    editMenu->addAction(renameItem);
    connect(renameItem, SIGNAL(triggered()), this, SLOT(renameNode()));
    QAction* deleteItem = new QAction(tr("Delete Node"), this);
//    deleteItem.addActionListener (new ActionListener () {
//            /*public*/ void actionPerformed(ActionEvent e) {
//                deleteNode();
//            }
//        });
    connect(deleteItem, SIGNAL(triggered()), this, SLOT(deleteNode()));
    editMenu->addAction(deleteItem);
    setMenuBar(menuBar);

    addHelpMenu("package.jmri.jmrit.catalog->ImageIndex", true);

    QWidget* mainPanel = new QWidget();
    mainPanel->setLayout(new QVBoxLayout(mainPanel/*, BoxLayout.Y_AXIS*/));
    QWidget* labelPanel = new QWidget();
    labelPanel->setLayout(new QHBoxLayout());
//    QString msg = java.text.MessageFormat.format(
//                       tr("dragIcons"),
//                       new Object[] {tr("defaultCatalog"), tr("ImageIndex")});
    QString msg = tr("Drag icons from the %1 viewing panel to nodes in the %2 tree.").arg("Default Catalogues:").arg("Image Index:");
    labelPanel->layout()->addWidget(new QLabel(msg/*, SwingConstants.LEFT*/));
    mainPanel->layout()->addWidget(labelPanel);
    QWidget* catalogsPanel = new QWidget();
    catalogsPanel->setLayout(new QHBoxLayout(catalogsPanel/*, BoxLayout.X_AXIS*/));
    catalogsPanel->layout()->addWidget(makeCatalogPanel());
//    catalogsPanel->layout()->addWidget(new JSeparator(SwingConstants.VERTICAL));
    QFrame* line = new QFrame(/*centralwidget()*/this);
    line->setObjectName(QString::fromUtf8("line"));
    line->setFrameShape(QFrame::HLine);
    line->setFrameShadow(QFrame::Sunken);
    catalogsPanel->layout()->addWidget(line);
    catalogsPanel->layout()->addWidget(makeIndexPanel());
    mainPanel->layout()->addWidget(catalogsPanel);
    if(centralWidget()== NULL)
    {
        QWidget* centralWidget = new QWidget();
        centralWidget->setLayout(new QVBoxLayout());
        setCentralWidget(centralWidget);
    }
    centralWidget()->layout()->addWidget(mainPanel);

    // when this window closes, check for saving
//    addWindowListener(new java.awt.event.WindowAdapter() {
//        /*public*/ void windowClosing(java.awt.event.WindowEvent e) {
//            DirectorySearcher.instance().close();
//            checkImageIndex();
//        }
//    });
    addWindowListener(new IIEWindowListener(this));
    //setLocation(10, 200);
    pack();
    setVisible(true);
}