001package jmri.jmrix.rfid.swing;
002
003import javax.swing.JMenu;
004import jmri.jmrix.rfid.RfidSystemConnectionMemo;
005
006/**
007 * Provide access to Swing components for the Rfid subsystem.
008 * <hr>
009 * This file is part of JMRI.
010 * <p>
011 * JMRI is free software; you can redistribute it and/or modify it under the
012 * terms of version 2 of the GNU General Public License as published by the Free
013 * Software Foundation. See the "COPYING" file for a copy of this license.
014 * <p>
015 * JMRI is distributed in the hope that it will be useful, but WITHOUT ANY
016 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
017 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
018 *
019 * @author Matthew Harris Copyright (C) 2011
020 */
021public class RfidComponentFactory extends jmri.jmrix.swing.ComponentFactory {
022
023    RfidSystemConnectionMemo memo;
024
025    public RfidComponentFactory(RfidSystemConnectionMemo memo) {
026        this.memo = memo;
027    }
028
029    @Override
030    public JMenu getMenu() {
031        if (memo.getDisabled()) {
032            return null;
033        }
034        return new RfidMenu(memo);
035    }
036
037}