001package jmri.jmrix.rps.rpsmon; 002 003import java.awt.event.ActionEvent; 004import javax.swing.AbstractAction; 005import jmri.jmrix.rps.RpsSystemConnectionMemo; 006 007/** 008 * Swing action to create and register a RpsMonFrame object 009 * 010 * @author Bob Jacobsen Copyright (C) 2006 011 */ 012public class RpsMonAction extends AbstractAction { 013 014 RpsSystemConnectionMemo memo = null; 015 016 public RpsMonAction(String s, RpsSystemConnectionMemo _memo) { 017 super(s); 018 memo = _memo; 019 } 020 021 public RpsMonAction(RpsSystemConnectionMemo _memo) { 022 this("RPS Monitor", _memo); 023 } 024 025 @Override 026 public void actionPerformed(ActionEvent e) { 027 RpsMonFrame f = new RpsMonFrame(memo); 028 try { 029 f.initComponents(); 030 } catch (Exception ex) { 031 // ignore 032 } 033 f.setVisible(true); 034 } 035 036}