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