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