001package jmri.jmrix.loconet.swing;
002
003import jmri.jmrix.loconet.LocoNetSystemConnectionMemo;
004
005/**
006 * Provide access to Swing components for the LocoNet subsystem.
007 *
008 * @author Bob Jacobsen Copyright (C) 2010
009 * @since 2.9.4
010 */
011public class LnComponentFactory extends jmri.jmrix.swing.ComponentFactory {
012
013    public LnComponentFactory(LocoNetSystemConnectionMemo memo) {
014        this.memo = memo;
015    }
016
017    LocoNetSystemConnectionMemo memo;
018
019    /**
020     * Provide a menu with all items attached to this system connection.
021     */
022    @Override
023    public javax.swing.JMenu getMenu() {
024        if (memo.getDisabled()) {
025            return null;
026        }
027        return new LocoNetMenu(memo);
028    }
029
030}