001package jmri.jmrix.maple;
002
003import javax.swing.JMenu;
004
005/**
006 * Create a "Systems" menu containing the Jmri Maple-specific tools.
007 *
008 * @author Bob Jacobsen Copyright 2008
009 */
010public class MapleMenu extends JMenu {
011
012    public MapleMenu(String name, MapleSystemConnectionMemo memo) {
013        this(memo);
014        setText(name);
015    }
016
017    public MapleMenu(MapleSystemConnectionMemo memo) {
018
019        super();
020        if (memo != null) {
021            setText(memo.getUserName());
022        } else {
023            setText(Bundle.getMessage("MenuMaple"));
024        }
025
026        add(new jmri.jmrix.maple.serialmon.SerialMonAction(Bundle.getMessage("MenuItemCommandMonitor"), memo));
027        add(new jmri.jmrix.maple.packetgen.SerialPacketGenAction(Bundle.getMessage("MenuItemSendCommand"), memo));
028        add(new javax.swing.JSeparator());
029        if (memo != null) {
030            add(new jmri.jmrix.maple.nodeconfig.NodeConfigAction(memo));
031        }
032        add(new javax.swing.JSeparator());
033        if (memo != null) {
034            add(new jmri.jmrix.maple.assignment.ListAction(Bundle.getMessage("MenuItemAssignments"), memo));
035        }
036    }
037
038}