Class LocoNetMenu

All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, MenuElement, SwingConstants

public class LocoNetMenu extends JMenu
Create a "Systems" menu containing the Jmri LocoNet-specific tools.
See Also:
  • Constructor Details

  • Method Details

    • processExternalItem

      public Action processExternalItem(LocoNetMenuItem item, boolean isLocoNetInterface, WindowInterface wi, LocoNetSystemConnectionMemo memo)
      Create an Action suitable for inclusion as a menu item on a LocoNet menu.
      Parameters:
      item - a LocoetMenuItem object which defines the menu item's characteristics, and which will be the basis for the returned Action object.
      isLocoNetInterface - is true if the LocoNet connection has a physical interface to LocoNet, else false.
      wi - the WindowInterface associated with the JMRI instance and LocoNetMenu.
      memo - the LocoNetSystemConnectionMemo associated with the LocoNet connection.
      Returns:
      an Action which may be added to a local JMenu for inclusion in a LocoNet connection's menu; the action's object may make use of the LocoNet memo and associate its GUI objects with the JMRI WindowInterface. If the item requires a physical LocoNet interface but the connection does not have such an interface, then null is returned.
    • createGuiAction

      Create an Action object from a LocoNetMenuItem, linked to the appropriate WindowInterface, for use as a menu item on a LocoNet menu. Depending on whether the item needs a gui and/or a physical LocoNet interface, this method returns null or an Action which is suitable for use as a menu item on a LocoNet menu.
      If the item's name is found as a key the Bundle associated with this object, then the I18N'd string will be used as the Action's text.
      Parameters:
      item - LocoNetMenuItem which defines the menu item's requirements.
      wi - WindowInterface to which the item's GUI object will be linked.
      memo - LocoNetSystemConnectionMemo with which the item will be linked.
      Returns:
      null if the item's requirements are not met by the current connection, or an Action which may be used as a JMenuItem.
    • createNonGuiAction

      Create an Action object from a LocoNetMenuItem, for use as a menu item on a LocoNet menu, without linkage to the WindowInterface associated with the LocoNet menu. This method returns an Action which is suitable for use as a menu item on a LocoNet menu.
      If the item's name is found as a key the Bundle associated with this object, then the I18N'd string will be used as the Action's text.
      Parameters:
      item - LocoNetMenuItem which defines the menu item's requirements.
      Returns:
      an Action which may be used as a JMenuItem.
    • getExtensionMenuItems

      public final ArrayList<JMenu> getExtensionMenuItems(boolean isConnectionWithHardwareInterface, WindowInterface wi, LocoNetSystemConnectionMemo memo)
      Get an ArrayList of JMenu objects as provided via the SPI "extension" mechanisms.
      Parameters:
      isConnectionWithHardwareInterface - informs whether the connection has actual hardware
      wi - allows the extension menu items to be associated with the JAVA WindowInterface which relates to the connection's menu
      memo - the LocoNetSystemConnectionMemo associated with the menu to which the extension's MenuItem(s) are to be attached.
      Returns:
      an ArrayList of JMenu objects, as populated from the menu items reported by any available SPI extensions. May be an empty ArrayList if none of the SPI extensions provide menu items for this menu.
      See Also: