001package jmri.jmrix.cmri.serial.cmrinetmanager; 002 003import java.awt.event.ActionEvent; 004import jmri.jmrix.cmri.CMRISystemConnectionMemo; 005import org.slf4j.Logger; 006import org.slf4j.LoggerFactory; 007 008import javax.swing.AbstractAction; 009 010/** 011 * CMRInet Network Metrics 012 * 013 * @author Chuck Catania 2016, 2017 014 */ 015public class CMRInetMetricsAction extends AbstractAction { 016 017 CMRISystemConnectionMemo _memo = null; 018 019 public CMRInetMetricsAction(String s, CMRISystemConnectionMemo memo) { 020 super(s); 021 _memo = memo; 022 } 023 024 public CMRInetMetricsAction(CMRISystemConnectionMemo memo) { 025 this(Bundle.getMessage("MetricsWindowTitle"), memo); 026 } 027 028 @Override 029 public void actionPerformed(ActionEvent e) { 030 // create a CMRInetMetricsAction 031 CMRInetMetricsFrame f = new CMRInetMetricsFrame(_memo); 032 try { 033 f.initComponents(); 034 } catch (Exception ex) { 035 log.warn("SerialFilterAction starting CMRInetMetricsAction: Exception: {}", ex.toString()); 036 } 037 f.setVisible(true); 038 } 039 040 private final static Logger log = LoggerFactory.getLogger(CMRInetMetricsAction.class.getName()); 041 042}