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