001package jmri.jmrix.xpa.swing;
002
003import javax.swing.JMenu;
004
005/**
006 * Create a "Systems" menu containing the Jmri XPA-specific tools
007 *
008 * @author Paul Bender Copyright 2004
009 */
010public class XpaMenu extends JMenu {
011
012    public XpaMenu(String name,jmri.jmrix.xpa.XpaSystemConnectionMemo memo) {
013        this(memo);
014        setText(name);
015    }
016
017    public XpaMenu(jmri.jmrix.xpa.XpaSystemConnectionMemo memo) {
018
019        super();
020
021        if (memo != null) {
022           setText(memo.getUserName());
023        } else {
024           setText(Bundle.getMessage("MenuXpa"));
025        }
026
027        add(new jmri.jmrix.xpa.swing.xpamon.XpaMonAction());
028        if (memo != null) {
029            add(new jmri.jmrix.xpa.swing.packetgen.XpaPacketGenAction(Bundle.getMessage("MenuItemSendCommand"), memo));
030            add(new jmri.jmrix.xpa.swing.xpaconfig.XpaConfigureAction(Bundle.getMessage("MenuItemXpaConfigTool"), memo));
031        }
032    }
033
034}