001package jmri.jmrix.ieee802154.xbee.swing; 002 003import java.util.ResourceBundle; 004import javax.swing.JMenu; 005 006/** 007 * Create a menu containing the XBee specific tools 008 * 009 * @author Paul Bender Copyright 2013 010 */ 011public class XBeeMenu extends JMenu { 012 013 public XBeeMenu(String name, jmri.jmrix.ieee802154.xbee.XBeeConnectionMemo memo) { 014 this(memo); 015 setText(name); 016 } 017 018 public XBeeMenu(jmri.jmrix.ieee802154.xbee.XBeeConnectionMemo memo) { 019 020 //super(memo); 021 022 ResourceBundle rb = ResourceBundle.getBundle("jmri.jmrix.ieee802154.IEEE802154ActionListBundle"); 023 024 if (memo != null) { 025 setText(memo.getUserName()); 026 } else { 027 setText(rb.getString("MenuXBee")); 028 } 029 030 add(new jmri.jmrix.ieee802154.xbee.swing.packetgen.PacketGenAction(rb.getString("jmri.jmrix.ieee802154.xbee.swing.packetgen.PacketGenAction"), memo)); 031 add(new jmri.jmrix.ieee802154.xbee.swing.nodeconfig.XBeeNodeConfigAction(rb.getString("jmri.jmrix.ieee802154.xbee.swing.nodeconfig.XBeeNodeConfigAction"), memo)); 032 033 } 034 035}