001package jmri.jmrix.powerline.swing;
002
003import jmri.jmrix.powerline.SerialSystemConnectionMemo;
004
005/**
006 * Provide access to Swing components for the Powerline subsystem.
007 *
008 * @author Bob Jacobsen Copyright (C) 2010 coverted to multiple connection
009 * @author kcameron Copyright (C) 2011
010 */
011public class PowerlineComponentFactory extends jmri.jmrix.swing.ComponentFactory {
012
013    public PowerlineComponentFactory(SerialSystemConnectionMemo memo) {
014        this.memo = memo;
015    }
016
017    SerialSystemConnectionMemo 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 PowerlineMenu(memo);
028    }
029}
030
031
032