001package jmri.jmrix.tmcc.swing; 002 003import jmri.jmrix.tmcc.TmccMenu; 004import jmri.jmrix.tmcc.TmccSystemConnectionMemo; 005 006/** 007 * Provide access to Swing components for the TMCC subsystem. 008 * Copied from EasyDCC 2017 009 * 010 * @author Bob Jacobsen Copyright (C) 2010 011 * @author Paul Bender Copyright (C) 2010 012 * @since 4.9.6 013 */ 014public class TmccComponentFactory extends jmri.jmrix.swing.ComponentFactory { 015 016 public TmccComponentFactory(TmccSystemConnectionMemo memo) { 017 this.memo = memo; 018 019 } 020 021 private TmccSystemConnectionMemo memo; 022 023 /** 024 * Provide a menu with all items attached to this system connection 025 */ 026 @Override 027 public javax.swing.JMenu getMenu() { 028 if (memo.getDisabled()) { 029 return null; 030 } 031 return new TmccMenu(memo); 032 } 033 034}