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