001package jmri.jmrix.tams.swing;
002
003import jmri.jmrix.tams.TamsSystemConnectionMemo;
004
005/**
006 * Provide access to Swing components for the Tams subsystem.
007 *
008 * @author Kevin Dickerson 2010
009 */
010public class TamsComponentFactory extends jmri.jmrix.swing.ComponentFactory {
011
012    public TamsComponentFactory(TamsSystemConnectionMemo memo) {
013        this.memo = memo;
014    }
015    TamsSystemConnectionMemo 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 TamsMenu(memo);
026    }
027}