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