001package jmri.jmrit.entryexit;
002
003import java.awt.event.ActionEvent;
004import javax.swing.AbstractAction;
005import jmri.jmrit.display.layoutEditor.LayoutEditor;
006import org.slf4j.Logger;
007import org.slf4j.LoggerFactory;
008
009/**
010 * Swing action to create and register the Add Entry Exit Pair.
011 *
012 * @author Kevin Dickerson Copyright (C) 2011
013 */
014public class AddEntryExitPairAction extends AbstractAction {
015
016    public AddEntryExitPairAction(String s, LayoutEditor panel) {
017        super(s);
018        this.panel = panel;
019    }
020    LayoutEditor panel;
021
022    @Override
023    public void actionPerformed(ActionEvent e) {
024        AddEntryExitPairFrame f = new AddEntryExitPairFrame();
025        try {
026            f.initComponents(panel);
027        } catch (Exception ex) {
028            log.error("Exception: ", ex);
029        }
030        f.setVisible(true);
031    }
032    private final static Logger log = LoggerFactory.getLogger(AddEntryExitPairAction.class);
033}