001package jmri.jmrix.srcp.swing;
002
003import javax.swing.JMenu;
004import jmri.jmrix.srcp.SRCPSystemConnectionMemo;
005import jmri.jmrix.srcp.swing.packetgen.PacketGenAction;
006import jmri.jmrix.srcp.swing.srcpmon.SRCPMonAction;
007
008/**
009 * Create a "Systems" menu containing the system-specific SRCP tools.
010 *
011 * @author Bob Jacobsen Copyright 2008
012 */
013public class SystemMenu extends JMenu {
014
015    public SystemMenu(String name, SRCPSystemConnectionMemo memo) {
016        this(memo);
017        setText(name);
018    }
019
020    public SystemMenu(SRCPSystemConnectionMemo memo) {
021        super();
022
023        if (memo != null) {
024            setText(memo.getUserName());
025        } else {
026            setText(Bundle.getMessage("MenuItemSRCP"));
027        }
028
029        if (memo != null) {
030            add(new SRCPMonAction());
031            add(new PacketGenAction(Bundle.getMessage("MenuItemSendCommand"), memo));
032        }
033    }
034
035}