001package jmri.jmrix.can.swing; 002 003import jmri.jmrix.can.CanSystemConnectionMemo; 004 005/** 006 * Provide access to Swing components for the LocoNet subsystem. 007 * 008 * @author Bob Jacobsen Copyright (C) 2010 009 * @since 2.99.2 010 */ 011public class CanComponentFactory extends jmri.jmrix.swing.ComponentFactory { 012 013 public CanComponentFactory(CanSystemConnectionMemo memo) { 014 this.memo = memo; 015 } 016 017 CanSystemConnectionMemo 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 CanMenu(memo); 028 } 029 030}