001package jmri.jmrix.easydcc.swing; 002 003import jmri.jmrix.easydcc.EasyDccMenu; 004import jmri.jmrix.easydcc.EasyDccSystemConnectionMemo; 005 006/** 007 * Provide access to Swing components for the EasyDCC subsystem. 008 * Copied from Acela 2017 009 * 010 * @author Bob Jacobsen Copyright (C) 2010 011 * @author Paul Bender Copyright (C) 2010 012 * @since 4.9.5 013 */ 014public class EasyDccComponentFactory extends jmri.jmrix.swing.ComponentFactory { 015 016 public EasyDccComponentFactory(EasyDccSystemConnectionMemo memo) { 017 this.memo = memo; 018 019 } 020 021 private EasyDccSystemConnectionMemo 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 EasyDccMenu(memo); 032 } 033 034}