001package jmri.jmrix.rps.swing.debugger; 002 003import java.awt.event.ActionEvent; 004import javax.swing.AbstractAction; 005import org.slf4j.Logger; 006import org.slf4j.LoggerFactory; 007import jmri.jmrix.rps.RpsSystemConnectionMemo; 008 009/** 010 * Swing action to create and register a DisplayFrame object. 011 * 012 * @author Bob Jacobsen Copyright (C) 2008 013 */ 014public class DebuggerAction extends AbstractAction { 015 016 RpsSystemConnectionMemo memo = null; 017 018 public DebuggerAction(String s,RpsSystemConnectionMemo _memo) { 019 super(s); 020 memo = _memo; 021 } 022 023 public DebuggerAction(RpsSystemConnectionMemo _memo) { 024 this("RPS Debugger Window", _memo); 025 } 026 027 @Override 028 public void actionPerformed(ActionEvent e) { 029 log.debug("starting frame creation"); 030 DebuggerFrame f = new DebuggerFrame(memo); 031 try { 032 f.initComponents(); 033 } catch (Exception ex) { 034 log.warn("starting frame: Exception: ", ex); 035 } 036 f.setVisible(true); 037 038 } 039 040 private final static Logger log = LoggerFactory.getLogger(DebuggerAction.class); 041 042}