001package jmri.jmrit.beantable.signalmast;
002
003import javax.swing.BoxLayout;
004import jmri.util.JmriJFrame;
005
006/**
007 * JFrame to create a new SignalMast
008 *
009 * @author Bob Jacobsen Copyright (C) 2009
010 */
011public class AddSignalMastJFrame extends JmriJFrame {
012
013    public AddSignalMastJFrame() {
014        super(Bundle.getMessage("TitleAddSignalMast"), false, true);
015
016        addHelpMenu("package.jmri.jmrit.beantable.SignalMastAddEdit", true);
017        getContentPane().setLayout(new BoxLayout(this.getContentPane(), BoxLayout.Y_AXIS));
018
019        add(sigMastPanel = new AddSignalMastPanel());
020        setEscapeKeyClosesWindow(true);
021        pack();
022    }
023
024    public AddSignalMastJFrame(jmri.SignalMast mast) {
025        super(Bundle.getMessage("TitleAddSignalMast"), false, true);
026
027        addHelpMenu("package.jmri.jmrit.beantable.SignalMastAddEdit", true);
028        getContentPane().setLayout(new BoxLayout(this.getContentPane(), BoxLayout.Y_AXIS));
029
030        add(new AddSignalMastPanel(mast));
031        setEscapeKeyClosesWindow(true);
032        pack();
033    }
034
035    AddSignalMastPanel sigMastPanel = null;
036
037    public void refresh() {
038        if (sigMastPanel != null) {
039            sigMastPanel.refresh();
040        }
041    }
042
043}