001package jmri.jmrix.ecos.swing.preferences;
002
003import java.awt.event.ActionEvent;
004import javax.swing.AbstractAction;
005import jmri.jmrix.ecos.EcosSystemConnectionMemo;
006import org.slf4j.Logger;
007import org.slf4j.LoggerFactory;
008
009/**
010 * Swing action to create and register a PreferencesFrame object
011 *
012 * @author Kevin Dickerson Copyright (C) 2009
013 */
014public class PreferencesFrameAction extends AbstractAction {
015
016    public PreferencesFrameAction(String s, EcosSystemConnectionMemo memo) {
017        super(s);
018        adaptermemo = memo;
019    }
020
021    EcosSystemConnectionMemo adaptermemo;
022
023    @Override
024    public void actionPerformed(ActionEvent e) {
025        PreferencesFrame f = new PreferencesFrame();
026        try {
027            f.initComponents(adaptermemo);
028        } catch (Exception ex) {
029            log.error("Exception: ", ex);
030        }
031        f.setVisible(true);
032    }
033
034    private final static Logger log = LoggerFactory.getLogger(PreferencesFrameAction.class);
035
036}