001package jmri.jmrix.roco.z21.swing; 002 003import jmri.jmrix.roco.z21.Z21SystemConnectionMemo; 004 005/** 006 * Provide access to Swing components for the Roco Z21 subsystem. 007 * 008 * @author Paul Bender Copyright (C) 2014 009 */ 010public class Z21ComponentFactory extends jmri.jmrix.swing.ComponentFactory { 011 012 public Z21ComponentFactory(Z21SystemConnectionMemo memo) { 013 this.memo = memo; 014 } 015 016 Z21SystemConnectionMemo memo; 017 018 /** 019 * Provide a menu with all items attached to this system connection 020 */ 021 @Override 022 public javax.swing.JMenu getMenu() { 023 if (memo.getDisabled()) { 024 return null; 025 } 026 return new Z21Menu(memo); 027 } 028 029}