001package jmri.jmrix.oaktree;
002
003import javax.swing.JMenu;
004
005/**
006 * Create a "Systems" menu containing the JMRI Oak Tree-specific tools.
007 *
008 * @author Bob Jacobsen Copyright 2003, 2006
009 */
010public class OakTreeMenu extends JMenu {
011
012    public OakTreeMenu(String name, OakTreeSystemConnectionMemo memo) {
013        this(memo);
014        setText(name);
015    }
016
017    public OakTreeMenu(OakTreeSystemConnectionMemo memo) {
018        super();
019
020        setText(Bundle.getMessage("MenuOakTree"));
021
022        if (memo != null) {
023            // do we have a SerialTrafficController?
024            setEnabled(memo.getTrafficController() != null); // disable menu, no connection, no tools!
025            add(new jmri.jmrix.oaktree.serialmon.SerialMonAction(Bundle.getMessage("MenuItemCommandMonitor"), memo));
026            add(new jmri.jmrix.oaktree.packetgen.SerialPacketGenAction(Bundle.getMessage("MenuItemSendCommand"), memo));
027            add(new jmri.jmrix.oaktree.nodeconfig.NodeConfigAction(Bundle.getMessage("ConfigNodesTitle"), memo));
028        }
029    }
030
031}