001package jmri.jmrix.dcc4pc.swing;
002
003import jmri.jmrix.dcc4pc.Dcc4PcSystemConnectionMemo;
004
005/**
006 * Provide access to Swing components for the Ecos subsystem.
007 *
008 * @author Kevin Dickerson 2010
009 */
010public class Dcc4PcComponentFactory extends jmri.jmrix.swing.ComponentFactory {
011
012    public Dcc4PcComponentFactory(Dcc4PcSystemConnectionMemo memo) {
013        this.memo = memo;
014    }
015    Dcc4PcSystemConnectionMemo memo;
016
017    /**
018     * Provide a menu with all items attached to this system connection
019     */
020    @Override
021    public javax.swing.JMenu getMenu() {
022        if (memo.getDisabled()) {
023            return null;
024        }
025        return new Dcc4PcMenu(memo);
026    }
027}